[Reproducible-builds] [PATCH 1/5] scripts/kernel-doc: parse kernel-doc deterministically

Ben Hutchings ben at decadent.org.uk
Wed Jul 8 19:06:33 UTC 2015


From: Jérémy Bobbio <lunar at debian.org>

Regular expressions for highlights in kernel-doc are stored in a Perl
hash.  These hashes are ordered differently for each Perl run. This will
prevent kernel-doc to behave deterministically when parsing “@foo()” as
in some runs it will be interpreted as a parameter and in the others it
will be interpreted as a function.

We now sort the %highlights hash to get the same behavior on every run.

Signed-off-by: Jérémy Bobbio <lunar at debian.org>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
 scripts/kernel-doc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 9922e66..71ada00 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -2587,7 +2587,7 @@ $kernelversion = get_kernel_version();
 
 # generate a sequence of code that will splice in highlighting information
 # using the s// operator.
-foreach my $pattern (keys %highlights) {
+foreach my $pattern (sort keys %highlights) {
 #   print STDERR "scanning pattern:$pattern, highlight:($highlights{$pattern})\n";
     $dohighlight .=  "\$contents =~ s:$pattern:$highlights{$pattern}:gs;\n";
 }

-- 
Ben Hutchings
If the facts do not conform to your theory, they must be disposed of.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 811 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20150708/c4e95795/attachment.sig>


More information about the Reproducible-builds mailing list