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 12:32:44 Branch: HEAD Handle: 2003012311324300 Added files: openpkg-web/security Makefile page.pl page.wml Removed files: openpkg-web/security 00UPDATE.pl Log: apply the usual amount of RSE cosmetics to give our SAs a more prominent look and feel Summary: Revision Changes Path 1.2 +0 -45 openpkg-web/security/00UPDATE.pl 1.1 +4 -0 openpkg-web/security/Makefile 1.1 +59 -0 openpkg-web/security/page.pl 1.1 +13 -0 openpkg-web/security/page.wml ____________________________________________________________________________ rm -f openpkg-web/security/00UPDATE.pl <<'@@ .' Index: openpkg-web/security/00UPDATE.pl ============================================================================ [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED] @@ . patch -p0 <<'@@ .' Index: openpkg-web/security/Makefile ============================================================================ $ cvs diff -u -r0 -r1.1 Makefile --- /dev/null 2003-01-23 12:32:43.000000000 +0100 +++ Makefile 2003-01-23 12:32:43.000000000 +0100 @@ -0,0 +1,4 @@ + +all: + perl -w ./page.pl + @@ . patch -p0 <<'@@ .' Index: openpkg-web/security/page.pl ============================================================================ $ cvs diff -u -r0 -r1.1 page.pl --- /dev/null 2003-01-23 12:32:43.000000000 +0100 +++ page.pl 2003-01-23 12:32:44.000000000 +0100 @@ -0,0 +1,59 @@ +## +## page.pl -- generate corresponding .html version for each .txt +## + +use strict; + +use IO; + +my @SA = glob("OpenPKG-SA-*.txt"); + +my $sidebar = '<u>Security Advisories:</u><p>'; +foreach my $sa (reverse sort @SA) { + my ($base, $name) = ($sa =~ m|^(OpenPKG-SA-(.+))\.txt$|); + next if ($name =~ m|^SA-0000|); + $sidebar .= "<a href=\"$base.html\">$name</a><br>"; +} + +foreach my $sa (@SA) { + $sa =~ s|\.txt$||s; + + print "$sa\n"; + my $io = new IO::File "<$sa.txt" or die; + my $txt = ''; + $txt .= $_ while (<$io>); + $io->close; + + my $L = {}; + my $x = $txt; + $x =~ 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/(OpenPKG Security Advisory)/<b>$1<\/b>/sg; + $txt =~ s/^((\s*[A-Z][a-zA-Z]+)+:)/<b>$1<\/b>/mg; + $txt =~ s/(\[(\d+)\])(?!\s+(?:http|ftp):\/\/)/"<a href=\"".$L->{$2}."\">".$1."<\/a>"/sge; + + 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|\@ID\@|<a href="$sa.txt">$sa</a>|sg; + $head =~ s|\@SIDEBAR\@|$sidebar|s; + + my $out = $head . + "<pre>\n" . $txt . "</pre>\n" . + $foot; + + $io = new IO::File ">$sa.html" || die; + $io->print($out); + $io->close; +} + @@ . patch -p0 <<'@@ .' Index: openpkg-web/security/page.wml ============================================================================ $ cvs diff -u -r0 -r1.1 page.wml --- /dev/null 2003-01-23 12:32:43.000000000 +0100 +++ page.wml 2003-01-23 12:32:44.000000000 +0100 @@ -0,0 +1,13 @@ +#!wml -oPAGE_HEADuPAGE_BODY:page.head.html -oPAGE_FOOT:page.foot.html + +#use "page.inc" page=security + +<title>Security Advisory [@ID@]</title> + +<a href="../security.html"><< back</a> + +<h1>OpenPKG Security Advisory</h1> +<h2>[@ID@]</h2> + +<sidebar>@SIDEBAR@</sidebar> + @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List [EMAIL PROTECTED]