summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2022-09-27 12:51:29 +0000
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2022-09-27 12:51:29 +0000
commitce1485e1504f74c90c0e976971ecce94eff68f97 (patch)
tree0aac270fa95573b3f5db455207cbd546af0bddee
parent0f93067221f32ea42e0f7903ba162c17e86702a6 (diff)
parent7646c38d153ffdfbca2134f1d1ea524b7d07ca77 (diff)
downloadmm-common-ce1485e1504f74c90c0e976971ecce94eff68f97.tar.gz
Merge branch 'tarball' into 'master'
util/meson_aux: make tarball reproducible See merge request GNOME/mm-common!6
-rwxr-xr-xutil/meson_aux/skeletonmm-tarball.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/util/meson_aux/skeletonmm-tarball.py b/util/meson_aux/skeletonmm-tarball.py
index db9e650..138184c 100755
--- a/util/meson_aux/skeletonmm-tarball.py
+++ b/util/meson_aux/skeletonmm-tarball.py
@@ -39,10 +39,16 @@ elif output_file.endswith('.gz'):
else:
mode = 'w'
+def reset(tarinfo):
+ tarinfo.uid = tarinfo.gid = 0
+ tarinfo.uname = tarinfo.gname = "root"
+ return tarinfo
+
+
with tarfile.open(output_file, mode=mode) as tar_file:
os.chdir(source_dir) # Input filenames are relative to source_dir.
for file in sys.argv[3:]:
- tar_file.add(file)
+ tar_file.add(file, filter=reset)
# Errors raise exceptions. If an exception is raised, Meson+ninja will notice
# that the command failed, despite exit(0).
sys.exit(0)