+ # target name collisions are an error
+ collisions = []
+ for target, sources in targetmap.items():
+ target_names = {}
+ for source in sources:
+ name = source.basename()
+ if name in target_names:
+ collisions.append((target, source, target_names[name]))
+ else:
+ target_names[name] = source
+ if collisions:
+ self.to_stderr("cannot copy multiple files with the same name into the same target directory")
+ # I'm not sure how to show where the collisions are coming from
+ #for (target, source1, source2) in collisions:
+ # self.to_stderr(source1.basename())
+ return 1
+