From 3947fa2b295fea167dd92cd9be4df92a891aadda Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 12 Feb 2014 21:00:23 -0800 Subject: [PATCH] results2html: Add SHA-1 and SHA-256 to .tar.gz build products. Requested by John Darrington because guix requires a sha256 of the source trees that it downloads. --- results2html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/results2html b/results2html index a5a7688e5a..1e8ea80222 100755 --- a/results2html +++ b/results2html @@ -3,6 +3,7 @@ use strict; use warnings; +use Digest::SHA; use File::Spec; use HTML::Entities qw(); use URI::Escape; @@ -175,7 +176,17 @@ foreach my $p (@products) { print INDEX encode_entities ($p->{NAME}), ": " if defined ($p->{NAME}); print INDEX "{HREF}), "\">"; print INDEX encode_entities ($p->{PRODUCT}); - print INDEX "\n"; + print INDEX "\n"; + if ($p->{PRODUCT} =~ /\.tar\.gz$/) { + my $sha = Digest::SHA->new(1); + $sha->addfile($p->{PRODUCT}); + print INDEX "
sha1: ", $sha->hexdigest, "\n"; + + $sha = Digest::SHA->new(256); + $sha->addfile($p->{PRODUCT}); + print INDEX "
sha256: ", $sha->hexdigest, "\n"; + } + print INDEX "\n"; } print INDEX "\n"; -- 2.30.2