Skip to contentSkip to conversation

support/download: generate reproducible Bazaar archives

PATCH New Yann E. MORIN 2 participants 2 messages Jan 2, 2016 – Jan 3, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 support/download: generate reproducible Bazaar archives

Similarly to what has previously been done for the Hg download backend, instruct bzr to generate the archive on stdout, so that we can generate reproducible archives.

When instructing bzr to generate the output file by itself, it uses a temporary file that is then fed to gzip, which in turn stores the timestamp of that file in the generated archive, whereas when the output is generated on stdout, there is no timestamp, so the archive is then reproducible.

Bizarely enough, we can tell 'bazaar' not to generate a bazaar in the archive. Cool, uh? ;-]

---
 support/download/bzr | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
support/download/bzr +3 -1
index cec9ce8..a8a8887 100755
@@ -32,4 +32,6 @@ _bzr() {
     eval ${BZR} "${@}"
 }
 
-_bzr export ${verbose} --root="'${basename}/'" --format=tgz "'${output}'" "'${repo}'" -r "'${rev}'"
+_bzr export ${verbose} --root="'${basename}/'" --format=tgz \
+    --per-file-timestamps - "'${repo}'" -r "'${rev}'" \
+    >"${output}"
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 support/download: generate reproducible Bazaar archives

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Similarly to what has previously been done for the Hg download backend, instruct bzr to generate the archive on stdout, so that we can generate reproducible archives.

Quoted 8 lines

When instructing bzr to generate the output file by itself, it uses a temporary file that is then fed to gzip, which in turn stores the timestamp of that file in the generated archive, whereas when the output is generated on stdout, there is no timestamp, so the archive is then reproducible.

Bizarely enough, we can tell 'bazaar' not to generate a bazaar in the archive. Cool, uh? ;-]

:P

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard