]> err.no Git - dak/commitdiff
Fix Release file hardlink handling
authorMark Hymers <mhy@debian.org>
Sat, 26 Mar 2011 11:25:02 +0000 (11:25 +0000)
committerMark Hymers <mhy@debian.org>
Sat, 26 Mar 2011 11:25:02 +0000 (11:25 +0000)
Signed-off-by: Mark Hymers <mhy@debian.org>
dak/generate_releases.py

index 8a371e8a8d3dd5a3ff925d4009950614afbea03d..8cbd8031c53c0d04aafec7d06f678fa0edcccfff 100755 (executable)
@@ -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))