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:   20-Feb-2003 09:34:27
  Branch: HEAD                             Handle: 2003022008342600

  Added files:
    openpkg-web             security.rdf.mk
  Modified files:
    openpkg-web             .cvsignore Makefile

  Log:
    provide security advisories also in RDF/RSS format

  Summary:
    Revision    Changes     Path
    1.3         +1  -0      openpkg-web/.cvsignore
    1.14        +3  -0      openpkg-web/Makefile
    1.1         +60 -0      openpkg-web/security.rdf.mk
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-web/.cvsignore
  ============================================================================
  $ cvs diff -u -r1.2 -r1.3 .cvsignore
  --- openpkg-web/.cvsignore    17 Oct 2001 12:25:45 -0000      1.2
  +++ openpkg-web/.cvsignore    20 Feb 2003 08:34:26 -0000      1.3
  @@ -3,3 +3,4 @@
   dep
   *.html
   news.rdf
  +security.rdf
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-web/Makefile
  ============================================================================
  $ cvs diff -u -r1.13 -r1.14 Makefile
  --- openpkg-web/Makefile      23 Jan 2003 10:37:13 -0000      1.13
  +++ openpkg-web/Makefile      20 Feb 2003 08:34:26 -0000      1.14
  @@ -15,6 +15,7 @@
   bugdb.html    \
   support.html  \
   security.html  \
  +security.rdf  \
   petidomo.head.html \
   petidomo.foot.html \
   tutorial.html \
  @@ -48,6 +49,8 @@
        wmk -f support.wml
   security.html: security.wml security.txt
        wmk -f security.wml
  +security.rdf: security.txt
  +     ./security.rdf.mk
   bugdb.html: bugdb.wml
        wmk -f bugdb.wml
   tutorial.html: tutorial.wml
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-web/security.rdf.mk
  ============================================================================
  $ cvs diff -u -r0 -r1.1 security.rdf.mk
  --- /dev/null 2003-02-20 09:34:27.000000000 +0100
  +++ security.rdf.mk   2003-02-20 09:34:27.000000000 +0100
  @@ -0,0 +1,60 @@
  +#!/e/openpkg/sw/bin/perl
  +##
  +##  security.rdf.mk -- Generate news.rdf in XML/RDF/RSS 1.0 format
  +##  See http://www.purl.org/rss/ for details about RSS 1.0.
  +##
  +
  +my $txt = '';
  +open(FP, "<security.txt");
  +$txt .= $_ while (<FP>);
  +$txt =~ s|^(([^\n]+\n){15}).*$|$1|s;
  +close(FP);
  +
  +my $rdf = '';
  +$rdf .= "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" .
  +        "<rdf:RDF\n" .
  +        "  xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n"; .
  +        "  xmlns=\"http://purl.org/rss/1.0/\"\n"; .
  +        ">\n";
  +
  +$rdf .= "<channel rdf:about=\"http://www.openpkg.org/security.rdf\";>\n" .
  +        "  <title>OpenPKG Security Advisories</title>\n" .
  +        "  <link>http://www.openpkg.org/</link>\n" .
  +        "  <description>OpenPKG Security Advisories</description>\n" .
  +        "</channel>\n";
  +
  +my $refs  = '';
  +my $items = '';
  +
  +$txt =~ s|^(.+):\s+(.+)$|&do1($1, $2), ''|mge;
  +sub do1 {
  +    my ($date, $entry) = @_;
  +    my ($link, $text);
  +
  +    $text = $entry;
  +    $link = "http://www.openpkg.org/";;
  +    if ($text =~ s|S<([^>]+)>|$1|s) {
  +        $link = "http://www.openpkg.org/security/$1.html";;
  +    }
  +    $text =~ s|S<([^>]+)>|$1|sg;
  +    $refs .= "    <rdf:li resource=\"$link\" />\n"; 
  +    $items .= "<item rdf:about=\"$link\">\n" .
  +              "  <title>$text</title>\n" .
  +              "  <link>$link</link>\n" .
  +              "</item>\n";
  +}
  +
  +$rdf .= "<items>\n" .
  +        "  <rdf:Seq>\n" .
  +        $refs .
  +        "  </rdf:Seq>\n" .
  +        "</items>\n";
  +
  +$rdf .= $items;
  +
  +$rdf .= "</rdf:RDF>\n";
  +
  +open(FP, ">security.rdf");
  +print FP $rdf;
  +close(FP);
  +
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to