From 9457bd6c94a411fd6292550e3913f13a5978fdbb Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 20 Jun 2003 10:46:48 +0000 Subject: 18618: add Etc/changelog2html.pl --- ChangeLog | 5 ++++ Etc/changelog2html.pl | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100755 Etc/changelog2html.pl diff --git a/ChangeLog b/ChangeLog index 64c6e5329..fe7cc96da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-06-20 Peter Stephenson + + * 18618: Etc/changelog2html.pl: Script to turn ChangeLog into + HTML for display on the website. + 2003-06-19 Peter Stephenson * 18616: Src/Modules/zutil.c, Doc/Zsh/mod_zutil.yo: Add diff --git a/Etc/changelog2html.pl b/Etc/changelog2html.pl new file mode 100755 index 000000000..ec7c29a6f --- /dev/null +++ b/Etc/changelog2html.pl @@ -0,0 +1,69 @@ +#!/usr/bin/perl -w + +# This programme turns the ChangeLog into changelog.html for display +# on the website. That lives at http://zsh.sunsite.dk/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 -- cgit 1.4.1