From: Mark Hymers Date: Sat, 26 Mar 2011 11:25:02 +0000 (+0000) Subject: Fix Release file hardlink handling X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=e933af8ef0e915f0d44e9c59111d8e15e346e670;p=dak.git Fix Release file hardlink handling Signed-off-by: Mark Hymers --- diff --git a/dak/generate_releases.py b/dak/generate_releases.py index 8a371e8a..8cbd8031 100755 --- a/dak/generate_releases.py +++ b/dak/generate_releases.py @@ -154,7 +154,7 @@ class ReleaseWriter(object): suite_suffix = "%s" % (cnf.Find("Dinstall::SuiteSuffix")) outfile = os.path.join(cnf["Dir::Root"], 'dists', "%s/%s" % (suite.suite_name, suite_suffix), "Release") - out = open(outfile, "w") + out = open(outfile + ".new", "w") for key, dbfield in attribs: if getattr(suite, dbfield) is not None: @@ -280,6 +280,7 @@ class ReleaseWriter(object): out.write(" %s %8d %s\n" % (fileinfo[filename][h], fileinfo[filename]['len'], filename)) out.close() + os.rename(outfile + '.new', outfile) sign_release_dir(suite, os.path.dirname(outfile))