From: Ben Pfaff Date: Thu, 13 Feb 2014 05:00:23 +0000 (-0800) Subject: results2html: Add SHA-1 and SHA-256 to .tar.gz build products. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=3947fa2b295fea167dd92cd9be4df92a891aadda 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. --- 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";