Package: usb-modeswitch-data
Version: 20160112-2
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: locale, fileordering

Hi,

the attached Git patch series makes the package build reproducibly in
my local rebuild.sh test environment. Please consider applying them :)

Cheers,
--
intrigeri

>From 40b452eb2070ca76d7cebb5ad729b2639e6a6ac4 Mon Sep 17 00:00:00 2001
From: intrigeri <[email protected]>
Date: Sat, 4 Jun 2016 16:28:04 +0000
Subject: [PATCH 1/2] 02_pack_config_reproducibly.patch: update to make the
 sort order independent of the build locale.

tar's --sort=name has no effect when it's passed an explicit list of
files on the command-line, whose order is locale-dependent, as we do
here with '*'. So, we instead pass tar the list of files sorted in
a locale-independent way, thanks to find|sort|tar.
---
 debian/patches/02_pack_config_reproducibly.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/patches/02_pack_config_reproducibly.patch b/debian/patches/02_pack_config_reproducibly.patch
index 265221a..0eefeaf 100644
--- a/debian/patches/02_pack_config_reproducibly.patch
+++ b/debian/patches/02_pack_config_reproducibly.patch
@@ -8,7 +8,7 @@ Last-Update: 2016-03-02
  	@# Create a compressed tar without gzip timestamp, so tar.gz
  	@# differs only if content is different
 -	cd ./usb_modeswitch.d; tar --mode=go=rX,u+rw,a-s -cf ../configPack.tar *
-+	cd ./usb_modeswitch.d; tar --sort=name --mode=go=rX,u+rw,a-s -cf ../configPack.tar *
++	cd ./usb_modeswitch.d; find -print0 | LC_ALL=C sort -z | tar --no-recursion --null --files-from=- --mode=go=rX,u+rw,a-s -cf ../configPack.tar
  	gzip -f9n ./configPack.tar
  	install --mode=644 -t $(PREFIX)/share/usb_modeswitch ./configPack.tar.gz
  	rm -f ./configPack.tar.gz
-- 
2.8.1

>From 7210f460a421513cebda3230de493566a0420dac Mon Sep 17 00:00:00 2001
From: intrigeri <[email protected]>
Date: Sat, 4 Jun 2016 17:32:43 +0000
Subject: [PATCH 2/2] Create 40-usb_modeswitch.rules reproducibly.

---
 ...reate-40-usb_modeswitch.rules-reproducibly.patch | 21 +++++++++++++++++++++
 debian/patches/series                               |  1 +
 2 files changed, 22 insertions(+)
 create mode 100644 debian/patches/03-Create-40-usb_modeswitch.rules-reproducibly.patch

diff --git a/debian/patches/03-Create-40-usb_modeswitch.rules-reproducibly.patch b/debian/patches/03-Create-40-usb_modeswitch.rules-reproducibly.patch
new file mode 100644
index 0000000..02e6fb3
--- /dev/null
+++ b/debian/patches/03-Create-40-usb_modeswitch.rules-reproducibly.patch
@@ -0,0 +1,21 @@
+From: intrigeri <[email protected]>
+Date: Sat, 4 Jun 2016 17:31:48 +0000
+Subject: Create 40-usb_modeswitch.rules reproducibly.
+
+---
+ gen-rules.tcl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gen-rules.tcl b/gen-rules.tcl
+index 44781d3..22b7d7b 100755
+--- a/gen-rules.tcl
++++ b/gen-rules.tcl
+@@ -27,7 +27,7 @@ if {![file isdirectory usb_modeswitch.d]} {
+ 	exit
+ }
+ 
+-set filelist [glob -nocomplain ./usb_modeswitch.d/*]
++set filelist [lsort [glob -nocomplain ./usb_modeswitch.d/*]]
+ if {[llength $filelist] == 0} {
+ 	puts "The \"usb_modeswitch.d\" subfolder is empty"
+ 	exit
diff --git a/debian/patches/series b/debian/patches/series
index f05eca5..7596337 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 01_no_udev_reload.patch
 02_pack_config_reproducibly.patch
+03-Create-40-usb_modeswitch.rules-reproducibly.patch
-- 
2.8.1

Reply via email to