208 def run(self, dry_run=False):
209 file_list_to_check = self.input_file.
split()
210 if os.path.isfile(self.merged_file) and self.rename_suffix:
211 old_name = os.path.splitext(self.merged_file)
212 new_name = old_name[0] + self.rename_suffix + old_name[1]
213 self.executable = 'mv {} {}; {}'.format(self.merged_file, new_name, self.executable)
214 if new_name in file_list_to_check:
215 file_list_to_check.remove(new_name)
216 file_list_to_check.append(self.merged_file)
217 self.log.
debug(
'%s checking if the input files exist: %s', self.name, str(file_list_to_check))
218 if not dry_run:
219 for file_name in file_list_to_check:
220 if len(glob.glob(file_name)) < 1:
221 self.log.warning('%s: file %s requested to be merged but does not exist', self.name, file_name)
222 self.result = 1
223 return self.result, '# (internal) {} in={} out={} -> failed'.format(self.name, self.input_file, self.merged_file)
224 return super(RootMergeStep, self).
run(dry_run)
225
226
std::vector< std::string > split(const std::string &s, const std::string &t=":")