From: Joerg Jaspert Date: Tue, 8 Dec 2015 22:45:01 +0000 (+0100) Subject: Fix pdiff Index file hardlink handling X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=d0c49b947585bfb1f358ce291c5066452124aa2d;p=dak.git Fix pdiff Index file hardlink handling Signed-off-by: Joerg Jaspert --- diff --git a/dak/generate_index_diffs.py b/dak/generate_index_diffs.py index ba5e37d0..da748725 100755 --- a/dak/generate_index_diffs.py +++ b/dak/generate_index_diffs.py @@ -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():