From dd2cdbcf934f25727bc940e4f5ee440c63ef16b6 Mon Sep 17 00:00:00 2001 From: "Ira W. Snyder" Date: Tue, 26 Dec 2006 20:25:15 -0800 Subject: [PATCH] [RARSLAVE] Fix noextract extraction This adds a fix to the noextract type of extraction (usually mv), which will exit early (and successfully) if the same file is being moved between. Signed-off-by: Ira W. Snyder --- rarslave.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rarslave.py b/rarslave.py index ceb7eac..739fdc7 100644 --- a/rarslave.py +++ b/rarslave.py @@ -103,6 +103,10 @@ class RarslaveExtractor (object): # FIXME: NOTE: mv will fail by itself if you're moving to the same dir! NOEXTRACT_CMD = config.get_value ('commands', 'noextract') + # Make sure that both files are not the same file. If they are, don't run at all. + if os.path.samefile (file, os.path.join (todir, file)): + return SUCCESS + cmd = NOEXTRACT_CMD % (file, todir) ret = run_command (cmd) -- 2.34.1