Skip to contentSkip to conversation

support/download: generate reproducible Hg archives

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

lore
Share & tools
lore
#0 lore raw

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

When hg directly creates the output file, the hash for that file changes everytime.

However, if we just tell hg to output the archive on stdout and we do the redirect to the file, then the archive is reproducible.

(The reason is that in the first case, a temporary file is created and then compressed, and gzip is adding the filename and its timestamp in the gzip header, while in the second case, there is no temporary file, and thus no timestamp and thus it is reproducible.)

---
Note: Yegor, you'll now be able to use the 'hg' method to download reproducible archives! Hehe! ;-)

---
 support/download/hg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
support/download/hg +1 -1
index 5bdbbc8..25cb4e9 100755
@@ -35,4 +35,4 @@ _hg clone ${verbose} --noupdate "'${repo}'" "'${basename}'"
 
 _hg archive ${verbose} --repository "'${basename}'" --type tgz \
             --prefix "'${basename}'" --rev "'${cset}'" \
-            "'${output}'"
+            - >"${output}"
Signature · 1 line
1.9.1
#1 lore raw

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

Quoted 6 lines · Yann E. MORIN

When hg directly creates the output file, the hash for that file changes everytime.

However, if we just tell hg to output the archive on stdout and we do the redirect to the file, then the archive is reproducible.

Quoted 7 lines

(The reason is that in the first case, a temporary file is created and then compressed, and gzip is adding the filename and its timestamp in the gzip header, while in the second case, there is no temporary file, and thus no timestamp and thus it is reproducible.)

Quoted 20 lines

---
Note: Yegor, you'll now be able to use the 'hg' method to download reproducible archives! Hehe! ;-)

---
 support/download/hg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
support/download/hg +1 -2
index 5bdbbc8..25cb4e9 100755
@@ -35,4 +35,4 @@ _hg clone ${verbose} --noupdate "'${repo}'" "'${basename}'"
 
 _hg archive ${verbose} --repository "'${basename}'" --type tgz \
             --prefix "'${basename}'" --rev "'${cset}'" \
-            "'${output}'"
+            - >"${output}"
--

1.9.1

#2 lore raw

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

In reply to Yann E. MORIN
Quoted 13 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

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

When hg directly creates the output file, the hash for that file changes everytime.

However, if we just tell hg to output the archive on stdout and we do the redirect to the file, then the archive is reproducible.

(The reason is that in the first case, a temporary file is created and then compressed, and gzip is adding the filename and its timestamp in the gzip header, while in the second case, there is no temporary file, and thus no timestamp and thus it is reproducible.)

Quoted 6 lines

---
Note: Yegor, you'll now be able to use the 'hg' method to download reproducible archives! Hehe! ;-)

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard