[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#977180: mlpost: reproducible builds: examples.tar.gz includes user, group and file mode



Source: mlpost
Severity: normal
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: umask username
X-Debbugs-Cc: reproducible-bugs@lists.alioth.debian.org

The file /usr/share/doc/mlpost/examples/examples.tar.gz includes user,
group and file mode that may vary between builds:

  https://tests.reproducible-builds.org/debian/rb-pkg/bullseye/amd64/diffoscope-results/mlpost.html

  1 drwxr-xr-x···0·pbuilder1··(1111)·pbuilder1··(1111)········0·2017-03-10·08:57:15.000000·examples/
  1 drwxrwxr-x···0·pbuilder2··(2222)·pbuilder2··(2222)········0·2017-03-10·08:57:15.000000·examples/


The attached patch fixes this by passing arguments to tar to ensure
consistent user id, group id, sort order, timestamps and pax headers.


Thanks for maintaining mlpost!


live well,
  vagrant
From 2974d881f31bc9808f3334565bbbd126beb4295f Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Sat, 12 Dec 2020 05:51:14 +0000
Subject: [PATCH 2/2] Patch Makefile.in to generate tarball with consistent
 user id, group id, sort order, timestamps and pax headers.

This patch relies on extensions to GNU tar and may require
adjustments to make portable across implementations.

https://reproducible-builds.org/docs/archives/
---
 Makefile.in | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile.in b/Makefile.in
index f454959..065f35b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -214,7 +214,11 @@ source:
 	mkdir -p export/$(EXPORTDIR)/contrib/lablgtk
 	cp $(CONTRIBDOTFILES) export/$(EXPORTDIR)/contrib/dot
 	cp $(CONTRIBLABLGTKFILES) export/$(EXPORTDIR)/contrib/lablgtk
-	cd export ; tar cf $(TAR) $(EXPORTDIR) ; gzip -f --best $(TAR)
+	cd export ; tar --sort=name \
+		--mtime="@$${SOURCE_DATE_EPOCH}" \
+		--owner=0 --group=0 --numeric-owner \
+		--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \
+		-cf $(TAR) $(EXPORTDIR) ; gzip -f --best $(TAR)
 
 
 DOCFILES:=$(shell echo *.mli)
-- 
2.29.2

Attachment: signature.asc
Description: PGP signature


Reply to: