]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
More post-release checklist updates, and a new script.
authorSimon Tatham <anakin@pobox.com>
Sat, 7 Nov 2015 15:59:00 +0000 (15:59 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 7 Nov 2015 16:14:28 +0000 (16:14 +0000)
I've added a few sample shell commands in the upload procedure (mostly
so that I don't have to faff about remembering how rsync trailing
slashes work every time), and also written a script called
'release.pl', which automates the updating of the version number in
all the various places it needs to be done and also ensures the PSCP
and Plink transcripts in the docs will match the release itself.

CHECKLST.txt
release.pl [new file with mode: 0755]

index ff3c62fa39b5fd0bcbc7e9dac0b499a7918f2e8b..51e11593cdbafa15b674dd9148b4642e95cb5ea1 100644 (file)
@@ -64,29 +64,25 @@ for it:
    XXX-REVIEW-BEFORE-RELEASE. ('git grep XXX-RE' should only show up
    hits in this file itself.)
 
- - Now update version numbers in
-    * putty/LATEST.VER
-    * putty/windows/putty.iss (four times, on consecutive lines)
-    * putty/doc/pscp.but (and make sure the rest of the transcript is
-      up to date)
-    * putty/doc/plink.but (likewise)
+ - Now update the version numbers and the transcripts in the docs, by
+   checking out the release branch and running
+
+      make distclean
+      ./release.pl --set-version=X.YZ
 
- - Reset the epoch used for the $(Days) value computed in Buildscr for
-   the Windows binary version resource. It's probably not a good idea
-   to set it to _today_ (since it might clash with the zero-valued
-   field used in actual releases), so perhaps we should start it 1000
-   days before the release date so as to have a largish number
-   recognisable as being the right kind of thing by its order of
-   magnitude. So, do this:
+   Then check that the resulting automated git commit has updated the
+   version number in the following places:
 
-     perl -e 'printf "%d\n", time/86400 - 1000'
+    * putty/LATEST.VER
+    * putty/doc/plink.but
+    * putty/doc/pscp.but
+    * putty/windows/putty.iss (four times, on consecutive lines)
 
-   and then substitute the resulting value into the definition of
-   'Epoch' in Buildscr.
+   and also check that it has reset the definition of 'Epoch' in
+   Buildscr.
 
- - Commit those version number and epoch changes (on the appropriate
-   branch, of course!), and then make the release tag pointing at the
-   resulting commit.
+ - Make the release tag, pointing at the version-update commit we just
+   generated.
 
  - If the release is on a branch (which I expect it generally will
    be), merge that branch to master.
@@ -146,8 +142,10 @@ locally, this is the procedure for putting it up on the web.
 
  - Save the link maps. Currently I keep these on atreus, in
    src/putty-local/maps-<version>.
+      rsync -av maps-x86/ atreus:src/putty-local/maps-X.YZ
 
  - Upload the entire release directory to atreus:www/putty/<version>.
+      rsync -av putty/ atreus:www/putty/X.YZ
 
  - Do final checks on the release directory in its new location:
     + verify all the signatures:
@@ -160,6 +158,8 @@ locally, this is the procedure for putting it up on the web.
 
  - Having double-checked the release, copy it from atreus to
    chiark:ftp/putty-<ver> and to the:www/putty/<ver>.
+      rsync -av putty/ chiark:ftp/putty-X.YZ
+      rsync -av putty/ the:www/putty/X.YZ
 
  - Check the permissions! Actually try downloading from the, to make
    sure it really works.
@@ -175,7 +175,9 @@ locally, this is the procedure for putting it up on the web.
    redirect.)
 
  - Check that the web server attaches the right content type to .HLP,
-   .CNT and .CHM files.
+   .CNT and .CHM files, by downloading one of each and checking
+   they're all application/octet-stream.
+     for ext in hlp cnt chm; do curl -v http://the.earth.li/~sgtatham/putty/X.YZ/putty.$ext 2>&1 >/dev/null | grep Content-Type; done
 
  - Run 'git push' in the website checkout, and then 'git pull' in
    ~/www/putty on atreus to fetch the website updates.
diff --git a/release.pl b/release.pl
new file mode 100755 (executable)
index 0000000..27e0f8c
--- /dev/null
@@ -0,0 +1,71 @@
+#!/usr/bin/perl
+
+# Script to automate some easy-to-mess-up parts of the PuTTY release
+# procedure.
+
+use strict;
+use warnings;
+use Getopt::Long;
+use File::Temp qw/tempdir/;
+
+my $version = undef; 
+GetOptions("set-version=s" => \$version)
+    or &usage();
+
+if (defined $version) {
+    0 == system "git", "diff-index", "--quiet", "--cached", "HEAD"
+        or die "index is dirty";
+    0 == system "git", "diff-files", "--quiet" or die "working tree is dirty";
+    -f "Makefile" and die "run 'make distclean' first";
+    my $builddir = tempdir(DIR => ".", CLEANUP => 1);
+    0 == system "./mkfiles.pl" or die;
+    0 == system "cd $builddir && ../configure" or die;
+    0 == system "cd $builddir && make pscp plink RELEASE=${version}" or die;
+    our $pscp_transcript = `cd $builddir && ./pscp --help`;
+    $pscp_transcript =~ s/^Unidentified build/Release ${version}/m or die;
+    $pscp_transcript =~ s/^/\\c /mg;
+    our $plink_transcript = `cd $builddir && ./plink --help`;
+    $plink_transcript =~ s/^Unidentified build/Release ${version}/m or die;
+    $plink_transcript =~ s/^/\\c /mg;
+    &transform("LATEST.VER", sub { s/^\d+\.\d+$/$version/ });
+    &transform("windows/putty.iss", sub {
+        s/^(AppVerName=PuTTY version |VersionInfoTextVersion=Release |AppVersion=|VersionInfoVersion=)\d+\.\d+/$1$version/ });
+    our $transforming = 0;
+    &transform("doc/pscp.but", sub {
+        if (/^\\c.*>pscp$/) { $transforming = 1; $_ .= $pscp_transcript; }
+        elsif (!/^\\c/) { $transforming = 0; }
+        elsif ($transforming) { $_=""; }
+    });
+    $transforming = 0;
+    &transform("doc/plink.but", sub {
+        if (/^\\c.*>plink$/) { $transforming = 1; $_ .= $plink_transcript; }
+        elsif (!/^\\c/) { $transforming = 0; }
+        elsif ($transforming) { $_=""; }
+    });
+    &transform("Buildscr", sub {
+        s!^(set Epoch )\d+!$1 . sprintf "%d", time/86400 - 1000!e });
+    0 == system ("git", "commit", "-a", "-m",
+                 "Update version number for ${version} release.") or die;
+    exit 0;
+}
+
+&usage();
+
+sub transform {
+    my ($filename, $proc) = @_;
+    my $file;
+    open $file, "<", $filename or die "$file: open for read: $!\n";
+    my $data = "";
+    while (<$file>) {
+        $proc->();
+        $data .= $_;
+    }
+    close $file;
+    open $file, ">", $filename or die "$file: open for write: $!\n";
+    print $file $data;
+    close $file or die "$file: close after write: $!\n";;
+}
+
+sub usage {
+    die "usage: release.pl --set-version=X.YZ\n";
+}