Changeset 822 in openpam


Ignore:
Timestamp:
Oct 9, 2014, 3:15:42 PM (6 years ago)
Author:
Dag-Erling Smørgrav
Message:

merge r819, r820, r821: improvements to history2wiki

Location:
branches/nooath
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/nooath

  • branches/nooath/misc/history2wiki.pl

    r648 r822  
    3434use warnings;
    3535
     36my $CVEURL = "http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-";
     37
    3638while (<>) {
    3739    if (m/^OpenPAM ([A-Z][a-z]+)\t+(\d\d\d\d-\d\d-\d\d)\s*$/) {
    3840        my ($relname, $reldate) = ($1, $2);
    39         my $wikitext = "= OpenPAM $relname =\n" .
    40             "\n" .
    41             "OpenPAM $relname was released on $reldate.\n";
     41        my $changes;
    4242        while (<>) {
    4343            last if m/^=+$/;
    44             $wikitext .= $_;
     44            $changes .= $_;
    4545        }
    46         $wikitext =~ s/^ - ([A-Z]+): / - '''$1''' /gm;
    47         $wikitext =~ s/(\w+\(\d*\))/`$1`/gs;
    48         $wikitext =~ s/([^'])\b([A-Z_]{2,})\b([^'])/$1`$2`$3/gs;
    49         $wikitext =~ s/([.!?])\n +(\w)/$1  $2/gs;
    50         $wikitext =~ s/(\S)\n +(\S)/$1 $2/gs;
    51         $wikitext .= "\n" .
    52             "[http://sourceforge.net/projects/openpam/files/openpam/$relname/ Download from Sourceforge]\n";
     46        $changes =~ s/^ - ([A-Z]+): / - '''$1''' /gm;
     47        $changes =~ s/([\w.-]+\(\d*\))/`$1`/gs;
     48        $changes =~ s/([^'])\b([A-Z_]{2,})\b([^'])/$1`$2`$3/gs;
     49        $changes =~ s/`CVE`-(\d{4}-\d+)/[$CVEURL$1 CVE-$1]/gs;
     50        $changes =~ s/([.!?])\n +(\w)/$1  $2/gs;
     51        $changes =~ s/(\S)\n +(\S)/$1 $2/gs;
    5352        open(my $fh, ">", "$relname.txt")
    5453            or die("$relname.txt: $!\n");
    55         print($fh $wikitext);
     54        print($fh "= OpenPAM $relname =\n",
     55              "\n",
     56              "OpenPAM $relname was released on $reldate.\n",
     57              $changes,
     58              "\n",
     59              "[http://sourceforge.net/projects/openpam/files/openpam/$relname/ Download from Sourceforge]\n");
    5660        close($fh);
    5761        print("|| $reldate || [[Releases/$relname|$relname]] ||\n");
Note: See TracChangeset for help on using the changeset viewer.