chiark / gitweb /
ownsource: do not include files more than once in srcbomb
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 4 Apr 2017 23:37:43 +0000 (00:37 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 4 Apr 2017 23:38:12 +0000 (00:38 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
hippotatlib/ownsource.py

index 385c9ea..8ecc7f2 100644 (file)
@@ -342,11 +342,16 @@ class SourceShipmentPreparer():
 
   def mk_inner_portmanteau(s):
     outputs = [s.manifest_name]
+    outputs_done = { }
     mfh = s.open_output_fh(s.manifest_name,'w')
     for me in s._manifest:
       try: fname = me['file']
       except KeyError: fname = me.get('file_print','')
-      else: outputs.append(fname)
+      else:
+        try: outputs_done[fname]
+        except KeyError:
+          outputs.append(fname)
+          outputs_done[fname] = 1
       print('%s\t%s' % (fname, me['info']), file=mfh)
     mfh.close()