]> git.decadent.org.uk Git - dak.git/blobdiff - dak/generate_index_diffs.py
Debug suites might also miss the source package
[dak.git] / dak / generate_index_diffs.py
index ba5e37d02e96fd73b2ed36b23281d511214b282c..e3cbd320786ba53399bda3ffa4ff34dd8b365072 100755 (executable)
@@ -337,9 +337,9 @@ def genchanges(Options, outdir, oldfile, origfile, maxdiffs = 56):
         os.link(origfile + origext, oldfile + origext)
         os.unlink(newfile)
 
-        f = open(outdir + "/Index", "w")
-        upd.dump(f)
-        f.close()
+        with open(outdir + "/Index.new", "w") as f:
+            upd.dump(f)
+        os.rename(outdir + "/Index.new", outdir + "/Index")
 
 
 def main():
@@ -429,13 +429,14 @@ def main():
                     packages = "Sources"
                     maxsuite = maxsources
                 else:
-                    longarch = "binary-%s"% (architecture)
+                    longarch = "binary-%s" % (architecture)
                     packages = "Packages"
                     maxsuite = maxpackages
-                    # Process Contents
-                    file = "%s/%s/Contents-%s" % (tree, component, architecture)
-                    storename = "%s/%s_%s_contents_%s" % (Options["TempDir"], suite, component, architecture)
-                    genchanges(Options, file + ".diff", storename, file, maxcontents)
+
+                # Process Contents
+                file = "%s/%s/Contents-%s" % (tree, component, architecture)
+                storename = "%s/%s_%s_contents_%s" % (Options["TempDir"], suite, component, architecture)
+                genchanges(Options, file + ".diff", storename, file, maxcontents)
 
                 file = "%s/%s/%s/%s" % (tree, component, longarch, packages)
                 storename = "%s/%s_%s_%s" % (Options["TempDir"], suite, component, architecture)