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:   21-Jan-2003 20:57:51
  Branch: HEAD                             Handle: 2003012119575000

  Added files:
    openpkg-web/press       .cvsignore 00UPDATE.pl

  Log:
    add quick txt to html conversion

  Summary:
    Revision    Changes     Path
    1.1         +1  -0      openpkg-web/press/.cvsignore
    1.1         +43 -0      openpkg-web/press/00UPDATE.pl
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-web/press/.cvsignore
  ============================================================================
  $ cvs diff -u -r0 -r1.1 .cvsignore
  --- /dev/null 2003-01-21 20:57:51.000000000 +0100
  +++ .cvsignore        2003-01-21 20:57:51.000000000 +0100
  @@ -0,0 +1 @@
  +*.html
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-web/press/00UPDATE.pl
  ============================================================================
  $ cvs diff -u -r0 -r1.1 00UPDATE.pl
  --- /dev/null 2003-01-21 20:57:51.000000000 +0100
  +++ 00UPDATE.pl       2003-01-21 20:57:51.000000000 +0100
  @@ -0,0 +1,43 @@
  +#!/usr/bin/perl
  +##
  +##  Update Security Advisory HTML Versions
  +##
  +
  +my @PR = glob("PR-*.txt");
  +foreach my $pr (@PR) {
  +    $pr =~ s|\.txt$||s;
  +    print "$pr\n";
  +    open(FP, "<$pr.txt") || die;
  +    my $c = '';
  +    $c .= $_ while (<FP>);
  +    close(FP);
  +
  +    my $L = {};
  +    my $x = $c;
  +    $x =~ s%^\s*\[(\d+)\]\s+((?:http|ftp)://\S+)%$L->{$1} = $2, ''%mge;
  +
  +    $c =~ s/&/&amp;/sg;
  +    $c =~ s/</&lt;/sg;
  +    $c =~ s/>/&gt;/sg;
  +    $c =~ s/((?:http|ftp):\/\/[^\s]+[^\s\.\)\&])/<a href="$1">$1<\/a>/sg;
  +    $c =~ s/([a-zA-Z0-9_.-]+\@[^\s\)\&]+)/<a href="mailto:$1";>$1<\/a>/sg;
  +    $c =~ s/^(\s*)([A-Z']{3,}\s+[A-Z]{2,}.+)$/$1<b>$2<\/b>/mg;
  +
  +    $c = "<html>\n" .
  +         "<head>\n" .
  +         "<title>OpenPKG Press Release [$pr]</title>\n" .
  +         "</head>\n" .
  +         "<body background=\"../bg.jpg\" bgcolor=\"#ffffff\" link=\"#a09080\" 
alink=\"#a09080\" vlink=\"#a09080\">\n" .
  +         "<blockquote>\n" .
  +         "<pre>\n" .
  +         $c .
  +         "</pre>\n" .
  +         "</blockquote>\n" .
  +         "</body>\n" .
  +         "</html>\n";
  +
  +    open(FP, ">$pr.html") || die;
  +    print FP $c;
  +    close(FP);
  +}
  +
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to