]> git.decadent.org.uk Git - dak.git/commitdiff
Fix pdiff Index file hardlink handling
authorJoerg Jaspert <joerg@debian.org>
Tue, 8 Dec 2015 22:45:01 +0000 (23:45 +0100)
committerJoerg Jaspert <joerg@debian.org>
Tue, 8 Dec 2015 22:48:37 +0000 (23:48 +0100)
Signed-off-by: Joerg Jaspert <joerg@debian.org>
dak/generate_index_diffs.py

index ba5e37d02e96fd73b2ed36b23281d511214b282c..da748725fa9177decbad7100020e01f74eb87b84 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():