Source: stgit
Version: 0.19-1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0] we noticed
that stgit could not be built reproducibly.

This is because the contents of the dynamically-compiled Bash
completion script was not being generated in a deterministic manner,
as well as the cmdlist.py module.

Patch attached.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
--- a/debian/patches/reproducible_build 1969-12-31 16:00:00.000000000 -0800
--- b/debian/patches/reproducible_build 2019-10-08 16:26:23.686338925 -0700
@@ -0,0 +1,33 @@
+Description: Make the build reproducible
+Author: Chris Lamb <la...@debian.org>
+Last-Update: 2019-10-08
+
+--- stgit-0.19.orig/stgit/argparse.py
++++ stgit-0.19/stgit/argparse.py
+@@ -260,7 +260,7 @@ class CompgenBase(object):
+             cmd += ['-A', act]
+         words = self.words(var)
+         if words:
+-            cmd += ['-W', '"%s"' % ' '.join(words)]
++            cmd += ['-W', '"%s"' % ' '.join(sorted(words))]
+         cmd += ['--', '"%s"' % var]
+         return ' '.join(cmd)
+ 
+@@ -310,4 +310,4 @@ class patch_range(CompgenBase):
+         for e in self.__endpoints:
+             assert not e.actions(var)
+             words |= e.words(var)
+-        return set(['$(_patch_range "%s" "%s")' % (' '.join(words), var)])
++        return set(['$(_patch_range "%s" "%s")' % (' '.join(sorted(words)), 
var)])
+
+--- stgit-0.19.orig/stgit/commands/__init__.py
++++ stgit-0.19/stgit/commands/__init__.py
+@@ -63,7 +63,7 @@
+ def py_commands(commands, f):
+     f.write('from __future__ import unicode_literals\n\n')
+     f.write('command_list = {\n')
+-    for name, (mod, kind, help) in commands.items():
++    for name, (mod, kind, help) in sorted(commands.items()):
+         f.write('    %r: (\n' % name)
+         f.write('        %r,\n' % mod)
+         f.write('        %r,\n' % kind)
--- a/debian/patches/series     2019-10-08 15:32:52.384349390 -0700
--- b/debian/patches/series     2019-10-08 16:15:53.573193060 -0700
@@ -2,3 +2,4 @@
 stg-gitk_bashism
 disable_interactive_test
 Avoid-the-git-error-messages-when-running-stg-outside-of-.patch
+reproducible_build

Reply via email to