#!/usr/bin/perl -w # This programme turns the ChangeLog into changelog.html for display # on the website. That lives at http://zsh.sourceforge.net/Etc/changelog.html. my $out = "changelog.html"; open CL, "ChangeLog" or die "No ChangeLog --- run in top level directory.\n"; if (-f $out) { die "Will not overwrite existing $out. Delete by hand.\n"; } my $version; my $changes = 0; while () { /^\d+/ and $changes++; if (/version\.mk.*version\s+(\d+(\.\d+)*(-\S+)?)/i) { $version = $1; $version =~ s/\.$//; last; } } if (defined $version) { warn "Outputting changelog.html for version \"$version\".\n"; if ($changes) { warn "WARNING: there are changes since this version.\n"; } } else { $version = "X.X.X"; warn "WARNING: no version found. Set by hand\n"; } seek CL, 0, 0; open NEW, ">changelog.html"; select NEW; print <<"EOH"; ChangeLog for zsh version $version

ChangeLog for zsh version $version

EOH

while () {
    s/&/&/g;
    s//>/g;

    print;
}

my $now = gmtime(time);

print <<"EOH";

Automatically generated from ChangeLog at $now EOH