Update GPG key for signing flatpaks.
[pspp] / results2html
index 4e3224fca3ba9589f147706469845ed5692612e0..b330c871abbdae8a74df08a6fa36cb5d52eb6c3b 100755 (executable)
@@ -3,10 +3,15 @@
 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");
@@ -15,6 +20,7 @@ open (LOG_HTML, '>', "log.html");
 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>
@@ -74,7 +80,7 @@ while (<LOG>) {
            $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 -");
@@ -145,6 +151,7 @@ open (INDEX, '>','index.html');
 print INDEX <<EOF;
 <html>
 <head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <link rel="stylesheet" href="build.css">
 </head>
 <body>
@@ -170,7 +177,17 @@ foreach my $p (@products) {
     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";