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

Bug#775531: console-setup: please make the build reproducible



On 05/18/2015 07:44 PM, Cyril Brulebois wrote:
>>> It looks a bit too much to consider at this time of the freeze, so it'll
>>> probably be considered after jessie is out. Feel free to ping when that
>>> happens.
>>
>> ping.
> 
> Feel free to push, but I'd prefer a split into logical patches (-n vs.
> sort vs.  srand) to have happened beforehand.
> 

I attached three patches that split up the three logical changes.

Regards,
 Reiner

diff --git a/Fonts/bdf2psf b/Fonts/bdf2psf
index 0f1d176..5bc3dfd 100755
--- a/Fonts/bdf2psf
+++ b/Fonts/bdf2psf
@@ -746,6 +746,7 @@ if ($font_type != 2) {
     }
 }
 
+srand(0);
 for my $c (0 ... $font_size - 1) {
     for my $i (0 ... matrix_size () - 1) {
 	if (defined $unicode[$c]) {
diff --git a/Fonts/Makefile b/Fonts/Makefile
index 6d053f3..07ec91f 100644
--- a/Fonts/Makefile
+++ b/Fonts/Makefile
@@ -7,7 +7,7 @@ build-any:
 
 
 %.gz : %
-	gzip -9 <$< >$@
+	gzip -9n <$< >$@
 
 # All available non-legacy font faces
 FACES = Fixed13 Fixed14 Fixed15 Fixed16 \
diff --git a/Keyboard/Makefile b/Keyboard/Makefile
index e6c22cc..5d53511 100644
--- a/Keyboard/Makefile
+++ b/Keyboard/Makefile
@@ -15,7 +15,7 @@ build-mini-linux : $(gzipped_ekmaps) charmap_functions.sh
 build-mini-freebsd : $(gzipped_ekbds) charmap_functions.sh
 
 %.gz : %
-	gzip -9 <$< >$@
+	gzip -9n <$< >$@
 
 %.ekmap : 
 	./kbdcompiler $(@:%.ekmap=%) KeyboardNames.pl $(xkbdir) >$@
diff --git a/Makefile b/Makefile
index 84d70df..ba17d2e 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ gziped_acmfiles = $(addsuffix .gz, $(acmfiles))
 gziped_acmfiles : $(gziped_acmfiles)
 
 %.gz : %
-	gzip -9 <$< >$@
+	gzip -9n <$< >$@
 
 build-common: gziped_acmfiles
 	cd Keyboard && $(MAKE) build
diff --git a/debian/rules b/debian/rules
index d709312..3098c7f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -49,7 +49,7 @@ main_build:
 debian/kbdnames.gz: main_build
 	( cd Keyboard \
 	&& ./kbdnames-maker KeyboardNames.pl \
-		| grep -v '^C[*]' | grep -v '[*]model[*]' | sort | gzip -9 ) >$@
+		| grep -v '^C[*]' | grep -v '[*]model[*]' | sort | gzip -9n ) >$@
 
 models = amiga ataritt macintosh_old pc105 sun4 sun5
 
@@ -61,7 +61,7 @@ gzipped_ekbds = pc105.ekbd.gz
 di-kbdnames = $(shell grep -A 2 keyboard-configuration/xkb-keymap debian/console-setup-udeb.templates | tail -n 1 | cut -d ' ' -f 2- | tr -d , | tr ' ' '\n' | grep -v skip-config)
 
 %.gz : %
-	gzip -9 <$< >$@
+	gzip -9n <$< >$@
 
 %.ekmap : main_build
 	(cd Keyboard \
diff --git a/setupcon b/setupcon
index e4a0851..ad01867 100755
--- a/setupcon
+++ b/setupcon
@@ -828,7 +828,7 @@ if [ "$savekbdfile" ]; then
 	        $installdir/bin/ckbcomp -backspace "$backspace" $acm_option \
                     $rules_option -model "$XKBMODEL" \
 	            "$XKBLAYOUT" "$XKBVARIANT" "$XKBOPTIONS" >$TMPFILE \
-                    && gzip -9 <$TMPFILE >"$savekbdfile"
+                    && gzip -9n <$TMPFILE >"$savekbdfile"
             } || exit 1
             ;;
         freebsd)
diff --git a/Fonts/fbsdmap b/Fonts/fbsdmap
index c99bd59..51f702e 100755
--- a/Fonts/fbsdmap
+++ b/Fonts/fbsdmap
@@ -97,7 +97,7 @@ sub lines {
 
 sub print_term {
     my $ac = "";
-    for my $name (keys %acsc) {
+    for my $name (sort keys %acsc) {
         if ($acsc{$name}[1]) {
             $ac = $ac . sprintf("%s\\%03o", $acsc{$name}[0], $acsc{$name}[1]);
         }
@@ -316,7 +316,7 @@ while (<ACM>) {
 close ACM;
 
 my @acm2acsname;
-for my $name (keys %acsc) {
+for my $name (sort keys %acsc) {
     my $a = $acsc{$name}[1];
     next if ($a == 0);
     my $uni = hex($acs2uni{$name});
diff --git a/Keyboard/compose_translator b/Keyboard/compose_translator
index 46b12f2..aa21200 100755
--- a/Keyboard/compose_translator
+++ b/Keyboard/compose_translator
@@ -2124,7 +2124,7 @@ while (<>) {
     $compose{$sequence} = $result;
 }
 
-my @sequences = keys %compose;
+my @sequences = sort keys %compose;
 
 my %lc_compose;
 my %lc_sequences;
@@ -2149,7 +2149,7 @@ foreach my $sequence (@sequences) {
     }
 }
 
-foreach my $lcase (keys %lc_compose) {
+foreach my $lcase (sort keys %lc_compose) {
     next if ($lc_compose{$lcase} eq 'DISAGREEMENT');
     foreach my $sequence (@{$lc_sequences{$lcase}}) {
 	delete $compose{$sequence};
@@ -2159,7 +2159,7 @@ foreach my $lcase (keys %lc_compose) {
 
 my %output;
 my %original_sequences;
-foreach my $sequence (keys %compose) {
+foreach my $sequence (sort keys %compose) {
     my @k = split ' ', $sequence;
     for my $i (0 .. $#k) {
 	if (defined $xkbsym_table{$k[$i]}) {
@@ -2209,7 +2209,7 @@ foreach my $sequence (keys %compose) {
     } 
 }
 
-@sequences = sort (keys %output);
+@sequences = sort (sort keys %output);
 
 for my $sequence (@sequences) {
     print "compose $sequence to $output{$sequence}\n";
diff --git a/Keyboard/kbdcompiler b/Keyboard/kbdcompiler
index 7c2451b..f97d4c8 100755
--- a/Keyboard/kbdcompiler
+++ b/Keyboard/kbdcompiler
@@ -182,12 +182,12 @@ for $k1 (keys %kmaps) {
 
 printf STDERR "Reducing the keymaps for %s...\n", $model;
 
-while (keys %kmaps) {
+while (sort keys %kmaps) {
     my $mink1 = '';
     my $mink2 = '';
     my $minsub = 10000000;
-    for $k1 (keys %kmaps) {
-	for $k2 (keys %kmaps) {
+    for $k1 (sort keys %kmaps) {
+	for $k2 (sort keys %kmaps) {
 	    next if ($k1 eq $k2);
 	    if ($matrice{$k1}{$k2} < $minsub) {
 		$mink1 = $k1;
@@ -197,7 +197,7 @@ while (keys %kmaps) {
 	}
     }
     if ($mink1 eq '') {
-        for $k2 (keys %kmaps) {
+        for $k2 (sort keys %kmaps) {
             $mink1 = $k2;
             last;
         }
@@ -208,7 +208,7 @@ while (keys %kmaps) {
 
 printf STDERR "Dumping the encoded keymaps for %s...\n", $model;
 
-for $k1 (keys %reduce) {
+for $k1 (sort keys %reduce) {
     my $kmap1 = $keymaps{$k1};
     $k2 = $reduce{$k1};
     if ($k2 ne '') {
@@ -298,7 +298,7 @@ my %keycodes = (
 my $keycodes =  (defined $keycodes {$model}
 		 ? $keycodes {$model}
 		 : 'xfree86');
-for my $option (keys %options) {
+for my $option (sort keys %options) {
     my $layout = '';
     for my $mod (@{$options{$option}}) {
 	$layout = $layout . "+stdmodifiers($mod)";
diff --git a/Keyboard/kbdnames-maker b/Keyboard/kbdnames-maker
index edfe4fa..7acf019 100755
--- a/Keyboard/kbdnames-maker
+++ b/Keyboard/kbdnames-maker
@@ -15,15 +15,15 @@ BEGIN {
     do "$file";
 }
 
-for my $model (keys %KeyboardNames::models) {
+for my $model (sort keys %KeyboardNames::models) {
     my $name = $KeyboardNames::models{$model};
     print "C*model*$name*$model\n"
 }
-for my $layout (keys %KeyboardNames::layouts) {
+for my $layout (sort keys %KeyboardNames::layouts) {
     my $name = $KeyboardNames::layouts{$layout};
     print "C*layout*$name*$layout\n";
     print "C*variant*$name**$layout\n";
-    for my $variant (keys %{$KeyboardNames::variants{$name}}) {
+    for my $variant (sort keys %{$KeyboardNames::variants{$name}}) {
 	my $variantname = $KeyboardNames::variants{$name}{$variant};
 	print "C*variant*$name*$variantname*$layout - $variant\n";
     }
@@ -44,16 +44,16 @@ for my $mo (</usr/share/locale/*/LC_MESSAGES/xkeyboard-config.mo>) {
 
     my $d = Locale::gettext->domain("xkeyboard-config");
 
-    for my $model (keys %KeyboardNames::models) {
+    for my $model (sort keys %KeyboardNames::models) {
 	my $name = $KeyboardNames::models{$model};
 	print "$lang*model*$name*".($d->get($model))."\n"
     }
-    for my $layout (keys %KeyboardNames::layouts) {
+    for my $layout (sort keys %KeyboardNames::layouts) {
 	my $name = $KeyboardNames::layouts{$layout};
 	my $local_layout = $d->get($layout);
 	print "$lang*layout*$name*$local_layout\n";
 	print "$lang*variant*$name**$local_layout\n";
-	for my $variant (keys %{$KeyboardNames::variants{$name}}) {
+	for my $variant (sort keys %{$KeyboardNames::variants{$name}}) {
 	    my $variantname = $KeyboardNames::variants{$name}{$variant};
 	    print "$lang*variant*$name*$variantname*$local_layout - ".($d->get($variant))."\n";
 	}

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: