OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /e/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-web Date: 23-Jan-2003 13:29:40 Branch: HEAD Handle: 2003012312293900 Added files: openpkg-web/press Makefile page.pl page.wml Removed files: openpkg-web/press 00UPDATE.pl Log: apply RSE cosmetics also to the press release area Summary: Revision Changes Path 1.2 +0 -43 openpkg-web/press/00UPDATE.pl 1.1 +4 -0 openpkg-web/press/Makefile 1.1 +59 -0 openpkg-web/press/page.pl 1.1 +13 -0 openpkg-web/press/page.wml ____________________________________________________________________________ rm -f openpkg-web/press/00UPDATE.pl <<'@@ .' Index: openpkg-web/press/00UPDATE.pl ============================================================================ [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED] @@ . patch -p0 <<'@@ .' Index: openpkg-web/press/Makefile ============================================================================ $ cvs diff -u -r0 -r1.1 Makefile --- /dev/null 2003-01-23 13:29:40.000000000 +0100 +++ Makefile 2003-01-23 13:29:40.000000000 +0100 @@ -0,0 +1,4 @@ + +all: + perl -w ./page.pl + @@ . patch -p0 <<'@@ .' Index: openpkg-web/press/page.pl ============================================================================ $ cvs diff -u -r0 -r1.1 page.pl --- /dev/null 2003-01-23 13:29:40.000000000 +0100 +++ page.pl 2003-01-23 13:29:40.000000000 +0100 @@ -0,0 +1,59 @@ +## +## page.pl -- generate corresponding .html version for each .txt +## + +use strict; + +use IO; + +my @PR = glob("PR-*.txt"); + +my $sidebar = '<u>Press Releases:</u><p>'; +foreach my $pr (reverse sort @PR) { + my ($base, $name) = ($pr =~ m|^(PR-(.+))\.txt$|); + next if ($name =~ m|^0000|); + $sidebar .= "<a href=\"$base.html\">$name</a><br>"; +} + +foreach my $pr (@PR) { + $pr =~ s|\.txt$||s; + + print "$pr\n"; + my $io = new IO::File "<$pr.txt" or die; + my $txt = ''; + $txt .= $_ while (<$io>); + $io->close; + + my $L = {}; + my $x = $txt; + $txt =~ s%^\s*\[(\d+)\]\s+((?:http|ftp)://\S+)%$L->{$1} = $2, ''%mge; + + $txt =~ s/&/&/sg; + $txt =~ s/</</sg; + $txt =~ s/>/>/sg; + $txt =~ s/((?:http|ftp):\/\/[^\s]+[^\s\.\)\&])/<a href="$1">$1<\/a>/sg; + $txt =~ s/([a-zA-Z0-9_.-]+\@[^\s\)\&]+)/<a href="mailto:$1">$1<\/a>/sg; + $txt =~ s/^(\s*)([A-Z']{3,}\s+[A-Z]{2,}.+)$/$1<b>$2<\/b>/mg; + + my $head = ''; + $io = new IO::File "<page.head.html" || die; + $head .= $_ while (<$io>); + $io->close; + my $foot = ''; + $io = new IO::File "<page.foot.html" || die; + $foot .= $_ while (<$io>); + $io->close; + + $head =~ s|\@TXT\@|$pr.txt|sg; + $head =~ s|\@ID\@|$pr|sg; + $head =~ s|\@SIDEBAR\@|$sidebar|s; + + my $out = $head . + "<pre>\n" . $txt . "</pre>\n" . + $foot; + + $io = new IO::File ">$pr.html" || die; + $io->print($out); + $io->close; +} + @@ . patch -p0 <<'@@ .' Index: openpkg-web/press/page.wml ============================================================================ $ cvs diff -u -r0 -r1.1 page.wml --- /dev/null 2003-01-23 13:29:40.000000000 +0100 +++ page.wml 2003-01-23 13:29:40.000000000 +0100 @@ -0,0 +1,13 @@ +#!wml -oPAGE_HEADuPAGE_BODY:page.head.html -oPAGE_FOOT:page.foot.html + +#use "page.inc" page=press + +<title>Press Release [@ID@]</title> + +<a href="../press.html"><< back</a> + +<h1>OpenPKG Press Release</h1> +<h2><a href="@TXT@">[@ID@]</a></h2> + +<sidebar>@SIDEBAR@</sidebar> + @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List [EMAIL PROTECTED]