[firmware-nonfree] 01/07: genorig.py: Make orig tarballs really reproducible

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Sun Jan 10 21:34:08 UTC 2016


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

benh pushed a commit to branch master
in repository firmware-nonfree.

commit 013238c36401354fb14d417cd89273126da8336d
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Sun Jan 10 20:51:37 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 5c231f0..fcbd79a 100755
--- a/debian/bin/genorig.py
+++ b/debian/bin/genorig.py
@@ -32,6 +32,7 @@ class Main(object):
     def __call__(self):
         import tempfile
         self.dir = tempfile.mkdtemp(prefix='genorig', dir='debian')
+        old_umask = os.umask(0o022)
         try:
             self.upstream_export()
 
@@ -46,8 +47,10 @@ class Main(object):
                     .st_mtime))
 
             self.delete_excluded()
+            os.umask(old_umask)
             self.tar(orig_date)
         finally:
+            os.umask(old_umask)
             shutil.rmtree(self.dir)
 
     def upstream_export(self):
@@ -85,7 +88,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 844bdd0..a78dadd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,9 @@
 firmware-nonfree (20151207-2) UNRELEASED; urgency=medium
 
   * Add AppStream metadata to all packages containing firmware blobs
+  * 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>  Sun, 10 Jan 2016 17:58:39 +0000
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/firmware-nonfree.git



More information about the Kernel-svn-changes mailing list