[Buildroot] [git commit] support/download: generate reproducible Hg archives

Peter Korsgaard peter at korsgaard.com
Sun Jan 3 20:50:38 UTC 2016


commit: http://git.buildroot.net/buildroot/commit/?id=76b51f90c0e393349dd0c71d7e6cf82fbc094282
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master

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.)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
Cc: Yegor Yefremov <yegorslists at googlemail.com>
Tested-by: Yegor Yefremov <yegorslists at googlemail.com>
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
---
 support/download/hg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/support/download/hg b/support/download/hg
index 5bdbbc8..25cb4e9 100755
--- a/support/download/hg
+++ b/support/download/hg
@@ -35,4 +35,4 @@ _hg clone ${verbose} --noupdate "'${repo}'" "'${basename}'"
 
 _hg archive ${verbose} --repository "'${basename}'" --type tgz \
             --prefix "'${basename}'" --rev "'${cset}'" \
-            "'${output}'"
+            - >"${output}"


More information about the buildroot mailing list