[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible_json.py: Fix cross-device-link error by creating temp file in the same directory.

Holger Levsen holger at layer-acht.org
Mon Apr 3 14:24:52 UTC 2017


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit e7957d7508e6c1e8f4403e6827e5ee82ce730159
Author: Chris Lamb <lamby at debian.org>
Date:   Mon Apr 3 16:20:36 2017 +0200

    reproducible_json.py: Fix cross-device-link error by creating temp file in the same directory.
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 bin/reproducible_json.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/reproducible_json.py b/bin/reproducible_json.py
index cfb6e95..6fb6549 100755
--- a/bin/reproducible_json.py
+++ b/bin/reproducible_json.py
@@ -114,7 +114,7 @@ for data, fn, target in (
     (output4tracker, open, REPRODUCIBLE_TRACKER_JSON),
     (output4tracker, bz2.BZ2File, REPRODUCIBLE_TRACKER_JSON + '.bz2'),
 ):
-    tmpfile = tempfile.mkstemp()[1]
+    tmpfile = tempfile.mkstemp(dir=os.path.dirname(target))[1]
     with fn(tmpfile, 'w') as fd:
         json.dump(data, fd, indent=4, sort_keys=True)
     os.rename(tmpfile, target)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list