use strict;
use warnings;
+use Digest::SHA;
use File::Spec;
-use HTML::Entities;
+use HTML::Entities qw();
use URI::Escape;
+sub encode_entities {
+ return HTML::Entities::encode_entities($_[0], "<&>'\"");
+}
+
my $gitweb_url = 'http://benpfaff.org/cgi-bin/gitweb.cgi?p=pspp;a=blob;f=[FILE];hb=[BRANCH]#l[LINE]';
open (LOG, '<', "LOG");
print LOG_HTML <<EOF;
<html>
<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="build.css">
</head>
<body>
$p{HREF} = $href;
$p{LN} = $ln;
push (@products, \%p);
- push (@{$steps[$#steps]{CHILDREN}}, \%p);
+ push (@{$steps[$#steps]{CHILDREN}}, \%p) if @steps;
if (defined ($name) && $name eq 'source distribution') {
open (DIST, '-|', "zcat $product | tar tf -");
print INDEX <<EOF;
<html>
<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="build.css">
</head>
<body>
print INDEX encode_entities ($p->{NAME}), ": " if defined ($p->{NAME});
print INDEX "<a href=\"", encode_entities ($p->{HREF}), "\">";
print INDEX encode_entities ($p->{PRODUCT});
- print INDEX "</a></li>\n";
+ print INDEX "</a>\n";
+ if ($p->{PRODUCT} =~ /\.tar\.gz$/) {
+ my $sha = Digest::SHA->new(1);
+ $sha->addfile($p->{PRODUCT});
+ print INDEX "<br>sha1: ", $sha->hexdigest, "\n";
+
+ $sha = Digest::SHA->new(256);
+ $sha->addfile($p->{PRODUCT});
+ print INDEX "<br>sha256: ", $sha->hexdigest, "\n";
+ }
+ print INDEX "</li>\n";
}
print INDEX "</ul>\n";