diff options
author | Chris Lamb <lamby@debian.org> | 2017-04-03 16:20:36 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2017-04-03 16:24:48 +0200 |
commit | e7957d7508e6c1e8f4403e6827e5ee82ce730159 (patch) | |
tree | 0867f15b7fded6762f876221f96f9f56e506b298 /bin | |
parent | c0ebfbc8df77d5a982f1b1897c2114c735a9b8db (diff) | |
download | jenkins.debian.net-e7957d7508e6c1e8f4403e6827e5ee82ce730159.tar.xz |
reproducible_json.py: Fix cross-device-link error by creating temp file in the same directory.
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_json.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/reproducible_json.py b/bin/reproducible_json.py index cfb6e95b..6fb6549a 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) |