From d0c49b947585bfb1f358ce291c5066452124aa2d Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Tue, 8 Dec 2015 23:45:01 +0100 Subject: [PATCH] Fix pdiff Index file hardlink handling Signed-off-by: Joerg Jaspert --- dak/generate_index_diffs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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(): -- 2.39.5