Permalink
Browse files

Make tarballs reproducible.

  • Loading branch information...
1 parent b2a0453 commit ef8dc31e7f67dcb73f9045f36ccf824bfe4a6886 @SamB committed Mar 29, 2012
Showing with 9 additions and 2 deletions.
  1. +1 −0 debian/changelog
  2. +8 −2 debian/extract-doc-tarball-from-upstream
View
@@ -8,6 +8,7 @@ gcc-4.6-doc-non-dfsg (4.6.2-1~naesten5) UNRELEASED; urgency=low
will be working in git.
* debian/rules, debian/extract-doc-tarball-from-upstream:
+ Update for impending rename (of source package) to gcc-X.Y-doc.
+ + Set mtime=0 in gzip header, so tarballs are reproducible.
-- Samuel Bronson <naesten@gmail.com> Sun, 04 Mar 2012 14:32:51 -0500
@@ -23,9 +23,14 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-import sys, tarfile, re, posixpath
+import sys
+import tarfile
+import gzip
+import re
+import posixpath
from pprint import pprint
+
try:
infn, pkg, ver = sys.argv[1:]
except ValueError:
@@ -38,7 +43,8 @@ outfn = '%s_%s.orig.tar.gz' % (pkg, ver)
outdir = '%s-%s.orig' % (pkg, ver)
intar = tarfile.open(infn, 'r|*', format=tarfile.PAX_FORMAT)
-outtar = tarfile.open(outfn, 'w:gz')
+outtarball = gzip.GzipFile(outfn, 'wb', mtime=0)
+outtar = tarfile.open(None, 'w:tar', fileobj=outtarball)
pat_s = r"""
^gcc/.*\.(7|texi)$

0 comments on commit ef8dc31

Please sign in to comment.