This is done using the par2repair command by default"""
- PAR2_CMD = rsutil.common.config_get_value ('commands', 'par2repair')
-
- # assemble the command
- # par2repair -- PAR2 PAR2_EXTRA [JOIN_FILES]
- command = "%s \"%s\" " % (PAR2_CMD, self.p2file)
-
- for f in self.all_p2files:
- if f != self.p2file:
- command += "\"%s\" " % os.path.split (f)[1]
-
- for f in self.find_joinfiles ():
- command += "\"%s\" " % os.path.split (f)[1]
-
- # run the command
- ret = rsutil.common.run_command (command, self.dir)
-
- # check the result
- if ret != 0:
- logging.critical ('PAR2 Check / Repair failed: %s' % self.p2file)
- return -rsutil.common.ECHECK
-
- return rsutil.common.SUCCESS
+ rsutil.common.run_command(['par2repair'] + self.all_p2files + self.find_joinfiles(), self.dir)
def find_deleteable_files (self):
"""Find all files which are deletable by using the regular expression from the
This command ignores the extraction if file and todir+file are the same
file. This keeps things like mv working smoothly."""
- NOEXTRACT_CMD = rsutil.common.config_get_value ('commands', 'noextract')
-
- # Make sure that both files are not the same file. If they are, don't run at all.
- # NOTE: os.path.samefile() doesn't exist on win32, so we can't use it.
- if rsutil.common.full_abspath (file) == \
- rsutil.common.full_abspath (os.path.join (todir, file)):
- return rsutil.common.SUCCESS
-
- cmd = NOEXTRACT_CMD % (file, todir)
- ret = rsutil.common.run_command (cmd)
-
- # Check error code
- if ret != 0:
- return -rsutil.common.EEXTRACT
-
- return rsutil.common.SUCCESS
-
+ # The Join type doesn't need any extraction
+ pass