def addHead (self, dir, head):
assert os.path.isdir (dir)
- # REQUIRES that the dir is valid, but not that the file is valid, so that
- # we can move a file that doesn't exist yet.
- # FIXME: probably CAN add this back, since we should be running this AFTER repair.
- #assert os.path.isfile (os.path.join (dir, head))
+ assert os.path.isfile (os.path.join (dir, head))
full_head = os.path.join (dir, head)
logger.addMessage ('Adding extraction head: %s' % full_head, RarslaveLogger.MessageType.Debug)
# 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)
assert os.path.isdir (indir) # MUST be a directory!
os.chdir (indir)
- # FIXME: re-enable this after testing
- print 'RUNNING (%s): %s' % (indir, cmd)
- return SUCCESS
-
- # return os.system (cmd)
-
+ return os.system (cmd)
def full_abspath (p):
return os.path.abspath (os.path.expanduser (p))
return SUCCESS
for f in files:
- # FIXME: re-enable this in production
- # os.remove (f)
- print 'rm \"%s\"' % f
+ os.remove (f)
return SUCCESS