From: Ira W. Snyder Date: Wed, 27 Dec 2006 04:25:15 +0000 (-0800) Subject: [RARSLAVE] Fix noextract extraction X-Git-Tag: v2.0.0~41 X-Git-Url: https://www.irasnyder.com/gitweb/?a=commitdiff_plain;h=dd2cdbcf934f25727bc940e4f5ee440c63ef16b6;p=rarslave2.git [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 --- 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)