- 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