]> xenbits.xensource.com Git - people/larsk/xen-release-scripts.git/commitdiff
Added make-webpage tool to generate pages for https://xenproject.org/downloads/xen...
authorLars Kurth <lars.kurth@citrix.com>
Fri, 7 Jul 2017 14:26:33 +0000 (15:26 +0100)
committerLars Kurth <lars.kurth@citrix.com>
Fri, 7 Jul 2017 14:26:33 +0000 (15:26 +0100)
README
make-webpage [new file with mode: 0755]

diff --git a/README b/README
index 3e68704c6905236af33f52cdbc7338df07fd4e63..e15d4b958f714023a9b042958718dc117b1c9f25 100644 (file)
--- a/README
+++ b/README
@@ -130,4 +130,24 @@ TODO
 
 ISSUES
 ------
-* *smart*: currently falls over and produces a non-match if the per-file diffs from *git show* and in the *.patch* file are listed in a different order. This seems to happen rarely, but does happen.
\ No newline at end of file
+* *smart*: currently falls over and produces a non-match if the per-file diffs from *git show* and in the *.patch* file are listed in a different order. This seems to happen rarely, but does happen.
+
+
+
+make-webpage
+============
+
+For 4.6.6 (tagged):
+
+    ./make-webpage --version 4 --major 6 --since 5 --until 6 --xsastart 210 --xsaend 225
+    
+Or as the other tools:
+
+    ./make-webpage --version 4 --major 6 --since 5 --until 6 --xsastart 210 --xsaend 225 --getlogs --logroot dir
+    
+Creates a file called *webpage.html* in the relevant log directory:
+* The XSA table needs to be edited to match *match-xsa*
+
+TODO
+----
+* Make generation of XSA table fully automatic 
\ No newline at end of file
diff --git a/make-webpage b/make-webpage
new file mode 100755 (executable)
index 0000000..9fbf370
--- /dev/null
@@ -0,0 +1,120 @@
+#!/usr/bin/perl
+# Usage
+# $0 --version 4 --major 7 --since 0 --until 1 [--getlogs] [--logroot dir] --xsastart start --xsaend end
+# Logs will be put into the log directory under "webpage.html"
+
+use strict;
+use warnings;
+use 5.010;
+use Getopt::Long qw(GetOptions);
+use Cwd;
+use File::Slurp;
+use Text::Diff;
+use File::Spec;
+
+my $GETLOGS=0;
+my $VERSION;
+my $MAJOR;
+my $SINCE="none";
+my $UNTIL="stable";
+my $XSASTART;
+my $XSAEND;
+my $LOGROOT = File::Spec->canonpath(cwd()."/../xen-release-logs" );
+
+GetOptions(
+    'getlogs'    => \$GETLOGS,
+    'version=s'  => \$VERSION,
+    'major=s'    => \$MAJOR,
+    'since=s'    => \$SINCE,
+    'until=s'    => \$UNTIL,
+    'xsastart=s' => \$XSASTART,
+    'xsaend=s'   => \$XSAEND,
+    'logroot=s'  => \$LOGROOT,
+) or 
+die "Usage: $0 --version 4 --major 7 --since 0 --until 1 [--getlogs] [--logroot dir] --xsastart start --xsaend end\n";
+if ($GETLOGS) {
+    system("./xen-release-logs --version $VERSION --major $MAJOR --since $SINCE --until $UNTIL --logroot $LOGROOT");
+}
+
+# Calculate log file names
+my $short="$VERSION$MAJOR$SINCE-$UNTIL";
+
+# Directories
+# Output
+my $dir=$LOGROOT;
+my $output="$dir/logs-$short/webpage.html";
+
+# Input
+my $xen_log="$dir/logs-$short/xen_$short-pretty.log";
+my $qemuu_log="$dir/logs-$short/qemuu_$short-pretty.log";
+my $qemut_log="$dir/logs-$short/qemut_$short-pretty.log";
+
+my $s;
+my $releaseshort=$VERSION.".".$MAJOR;
+my $release=$VERSION.".".$MAJOR.".".$UNTIL;
+
+# CREATE REPORT
+$s .= '<p>We are pleased to announce the release of Xen '.$release.'. This is available immediately from its git '; 
+$s .= 'repository </p>'."\n";
+$s .= '<p><a href="https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=refs/heads/stable-'.$releaseshort.'">';
+$s .= 'https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=refs/heads/stable-'.$releaseshort.'</a> ';
+$s .= '(tag <em>RELEASE-'.$release.'</em>) or from this download page</p>'."\n";
+$s .= '<p>This release contains the following bug-fixes and improvements in the Xen Project hypervisor:</p>'."\n";
+$s .= '<ul>'."\n";
+
+# INSERT $xen_log
+$s .= read_file("$xen_log");
+
+$s .= '</ul>'."\n";
+$s .= '<p>In addition, this release also contains the following fixes to ';
+$s .= '<a href="https://blog.xenproject.org/2013/09/20/qemu-vs-qemu-traditional-update/">qemu-traditional</a>:</p>'."\n";
+$s .= '<ul>'."\n";
+
+# INSERT $qemut_log
+$s .= read_file("$qemut_log");
+
+$s .= '</ul>'."\n";
+
+$s .= '<p>This release also contains changes to <a href="http://wiki.xenproject.org/wiki/QEMU_Upstream">qemu-upstream</a>, ';
+$s .= 'whose changelogs we do not list here as it contains many changes that are not directly releated to the Xen Project ';
+$s .= 'Hypervisor and thus this release. However, you can check ';
+$s .= '<a href="https://xenbits.xenproject.org/gitweb/?p=qemu-xen.git;a=shortlog">';
+$s .= 'https://xenbits.xenproject.org/gitweb/?p=qemu-xen.git;a=shortlog</a> ';
+$s .= '(between tags <em>qemu-xen-'.$releaseshort.'.'.$SINCE.'</em> and <em>qemu-xen-'.$releaseshort.'.'.$UNTIL.'</em>).</p>'."\n";
+
+$s .= '<p>This release, which includes source code for qemu-traditional and qemu-upstream, contains the following security '; 
+$s .= 'fixes. </p>'."\n";
+
+# XSA TABLE
+$s .= '<table class="zebra">'."\n";
+$s .= '<tbody>'."\n";
+$s .= '<tr>'."\n";
+$s .= '<td width="70px"><strong>XSA</strong></td>'."\n";
+$s .= '<td width="120px"><strong>Xen</strong></td>'."\n";
+$s .= '<td width="120px"><strong>qemu-traditional</strong></td>'."\n";
+$s .= '<td width="120px"><strong>qemu-upstream </strong></td>'."\n";
+$s .= '</tr>'."\n";
+
+# INSERT table elements
+my $i;
+for($i=$XSASTART; $i<=$XSAEND; $i++) {
+  $s .= '<tr>'."\n";
+  $s .= '<!-- Make bold if one applies, if none applies put why after N/A in () and use ... -->'."\n";
+  $s .= '<td><a href="https://xenbits.xenproject.org/xsa/advisory-'.$i.'.html"><strong>XSA-'.$i.'</strong></a></td>'."\n";
+  $s .= '<td>TODO: Applied|N/A|...</td>'."\n";
+  $s .= '<td>TODO: Applied|N/A|...</td>'."\n";
+  $s .= '<td>TODO: Applied|N/A|...</td>'."\n";
+  $s .= '</tr>'."\n";
+}
+
+$s .= '</tbody>'."\n";
+$s .= '</table>'."\n";
+
+$s .= '<p><br />See <a href="https://xenbits.xenproject.org/xsa/">https://xenbits.xenproject.org/xsa/</a> ';
+$s .= 'for details related to Xen Project security advisories.</p>'."\n";
+
+$s .= '<p>We recommend all users of the '.$releaseshort.' stable series to update to this latest point release.</p>'."\n";
+
+# WRITE REPORT
+write_file($output, $s);     
\ No newline at end of file