]> granicus.if.org Git - python/commitdiff
Modified version of a patch from Jeremy Kloth, to make .get_outputs()
authorAndrew M. Kuchling <amk@amk.ca>
Tue, 16 Jan 2001 16:16:03 +0000 (16:16 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Tue, 16 Jan 2001 16:16:03 +0000 (16:16 +0000)
produce a list of unique filenames:
    "While attempting to build an RPM using distutils on Python 2.0,
    rpm complained about duplicate files.  The following patch fixed
    that problem.

Lib/distutils/command/install.py

index 806da01afa4f1575ef645fc7f15a9a53da69f183..40e00705d3a5a0ba313e051b598a1a80e2fe5d07 100644 (file)
@@ -530,7 +530,11 @@ class install (Command):
         outputs = []
         for cmd_name in self.get_sub_commands():
             cmd = self.get_finalized_command(cmd_name)
-            outputs.extend(cmd.get_outputs())
+            # Add the contents of cmd.get_outputs(), ensuring
+            # that outputs doesn't contain duplicate entries
+            for filename in cmd.get_outputs():
+                if filename not in outputs:
+                    outputs.append(filename)
 
         return outputs