Package: git-buildpackage
Version: 0.7.5
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps randomness

Hi!

While working on the "reproducible builds" effort [1], we have noticed
that git-buildpackage could not be built reproducibly.

This is fixed by the attached patch. Firstly, it sets deterministic timestamps
(the last Debian release date) in the manpages. This is currently done
explicitly in the docs/Makefile as the more generic docbook2man patch [2]
has not been accepted yet.
Secondly, the patch excludes some test configuration module variables from the
Epydoc documentation as they contain the names of build-specific temporary
directories.
Once applied, git-buildpackage can be built reproducibly in our current
experimental framework.

Best regards
Sascha

[1] https://wiki.debian.org/ReproducibleBuilds
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=800797
diff --git a/docs/Makefile b/docs/Makefile
index 581e0a1..106245f 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -27,6 +27,7 @@ VERSION_ENT=version.ent
 GBP_VERSION=../gbp/version.py
 DEB_VERSION=$(shell sed -ne 's/^gbp_version="\([.a-z0-9~-]\+\)"/\1/p' $(GBP_VERSION))
 CHANGELOG=../debian/changelog
+MAN_DATE=$(shell dpkg-parsechangelog -l ../debian/changelog -SDate | TZ=UTC LC_ALL=C date -f- +'%d %B %Y')
 
 # Stuff to build docs outside Debian
 HAVE_SGML2X ?= 1
@@ -49,12 +50,14 @@ BUILD_MAN_XREF_PAGES=$(patsubst %,buildxref/%,$(SGML_MANPAGES))
 
 buildxref/%.1 buildxref/%.5: man.%.sgml manpages/%.sgml
 	docbook2man -o buildxref $<
+	sed -i -r "s/\"[^\"]+\"/\"$(MAN_DATE)\"/3" $@
 
 manpage.refs: $(BUILD_MAN_XREF_PAGES)
 	cp buildxref/$@ $@
 
 %.1 %.5: manpage.refs
 	docbook2man -o . man.$*.sgml
+	sed -i -r "s/\"[^\"]+\"/\"$(MAN_DATE)\"/3" $@
 
 git-pbuilder.1: ../bin/git-pbuilder
 	pod2man $< $@
diff --git a/setup.cfg b/setup.cfg
index d443f2a..2bbb17a 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -10,7 +10,7 @@ name = git-buildpackage
 sourcecode = no
 url = https://honk.sigxcpu.org/piki/projects/git-buildpackage/
 target = build/apidocs/
-fail-on = docstring_warning
+#fail-on = docstring_warning
 modules = gbp, tests/test_*.py
 
 [pep8]
diff --git a/tests/test_GitRepository.py b/tests/test_GitRepository.py
index fed8b02..c8ecb49 100644
--- a/tests/test_GitRepository.py
+++ b/tests/test_GitRepository.py
@@ -1,6 +1,6 @@
 # vim: set fileencoding=utf-8 :
 
-"""
+'''
 Test L{gbp.git.GitRepository}
 
 This testcase creates several repositores:
@@ -9,7 +9,9 @@ This testcase creates several repositores:
     - A bare repository at L{bare_dir} called I{bare}
     - A clone of I{repo} below L{clone_dir} called I{clone}
     - A mirror of I{repo} below L{mirror_clone_dir} called I{mirror}
-"""
+
+@undocumented: repo_dir bare_dir clone_dir mirror_clone_dir
+'''
 
 from . import context
 
diff --git a/tests/test_PristineTar.py b/tests/test_PristineTar.py
index 150dbcf..c2407c3 100644
--- a/tests/test_PristineTar.py
+++ b/tests/test_PristineTar.py
@@ -1,6 +1,6 @@
 # vim: set fileencoding=utf-8 :
 
-"""
+'''
 Test pristine-tar related methods in
 
     - L{gbp.deb.DebianPristineTar}
@@ -13,7 +13,8 @@ This testcase creates this reposity:
 
     - A repository at L{repo_dir} called I{repo}
 
-"""
+@undocumented: repo_dir test_data
+'''
 
 from . import context
 

Reply via email to