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 <devel@irasnyder.com>
# 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)