[linux] 01/03: genorig.py: Make orig tarballs really reproducible
debian-kernel at lists.debian.org
debian-kernel at lists.debian.org
Fri Jan 8 19:44:15 UTC 2016
This is an automated email from the git hooks/post-receive script.
benh pushed a commit to branch sid
in repository linux.
commit 0c23e537455be4451b48b1bb9117083634060fc3
Author: Ben Hutchings <ben at decadent.org.uk>
Date: Fri Jan 8 19:31:40 2016 +0000
genorig.py: Make orig tarballs really reproducible
- Override umask while extracting/exporting files
- Override user and group names in tarball
---
debian/bin/genorig.py | 5 ++++-
debian/changelog | 3 +++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/debian/bin/genorig.py b/debian/bin/genorig.py
index b83f31c..c3a4eea 100755
--- a/debian/bin/genorig.py
+++ b/debian/bin/genorig.py
@@ -40,6 +40,7 @@ class Main(object):
def __call__(self):
import tempfile
self.dir = tempfile.mkdtemp(prefix='genorig', dir='debian')
+ old_umask = os.umask(0o022)
try:
if os.path.isdir(self.input_files[0]):
self.upstream_export(self.input_files[0])
@@ -59,8 +60,10 @@ class Main(object):
.st_mtime))
self.debian_patch()
+ os.umask(old_umask)
self.tar(orig_date)
finally:
+ os.umask(old_umask)
shutil.rmtree(self.dir)
def upstream_export(self, input_repo):
@@ -131,7 +134,7 @@ class Main(object):
self.log("Generate tarball %s\n" % out)
cmdline = '''(cd '%s' && find '%s' -print0) |
LC_ALL=C sort -z |
- tar -C '%s' --no-recursion --null -T - --mtime '%s' -caf '%s'
+ tar -C '%s' --no-recursion --null -T - --mtime '%s' --owner root --group root -caf '%s'
''' % (self.dir, self.orig, self.dir, orig_date, out)
try:
if os.spawnv(os.P_WAIT, '/bin/sh', ['sh', '-c', cmdline]):
diff --git a/debian/changelog b/debian/changelog
index ba7ff0e..9f6c605 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,9 @@ linux (4.3.3-6) UNRELEASED; urgency=medium
* debian.py: Implement stable order of fields in debian/tests/control
* debian.py: Implement stable order of fields not in the predefined order
+ * genorig.py: Make orig tarballs really reproducible:
+ - Override umask while extracting/exporting files
+ - Override user and group names in tarball
-- Ben Hutchings <ben at decadent.org.uk> Fri, 08 Jan 2016 12:08:13 +0000
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git
More information about the Kernel-svn-changes
mailing list