mirror of
https://github.com/zsh-users/zsh
synced 2024-07-08 19:55:44 +00:00
18618: add Etc/changelog2html.pl
This commit is contained in:
parent
7b60aae9f3
commit
9457bd6c94
|
@ -1,3 +1,8 @@
|
|||
2003-06-20 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 18618: Etc/changelog2html.pl: Script to turn ChangeLog into
|
||||
HTML for display on the website.
|
||||
|
||||
2003-06-19 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 18616: Src/Modules/zutil.c, Doc/Zsh/mod_zutil.yo: Add
|
||||
|
|
69
Etc/changelog2html.pl
Executable file
69
Etc/changelog2html.pl
Executable file
|
@ -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 (<CL>) {
|
||||
/^\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";
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>ChangeLog for zsh version $version</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>ChangeLog for zsh version $version</h1>
|
||||
<pre>
|
||||
EOH
|
||||
|
||||
while (<CL>) {
|
||||
s/&/&/g;
|
||||
s/</</g;
|
||||
s/>/>/g;
|
||||
|
||||
print;
|
||||
}
|
||||
|
||||
my $now = gmtime(time);
|
||||
|
||||
print <<"EOH";
|
||||
</pre>
|
||||
<hr>
|
||||
Automatically generated from ChangeLog at $now
|
||||
</body>
|
||||
</html>
|
||||
EOH
|
Loading…
Reference in New Issue
Block a user