Refactor. The only major change is that CVE numbers now link to the
corresponding NVD database entry. git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@819 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
parent
8ad7aa9039
commit
561cd87dbe
1 changed files with 16 additions and 12 deletions
|
@ -33,26 +33,30 @@
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
|
my $CVEURL = "http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-";
|
||||||
|
|
||||||
while (<>) {
|
while (<>) {
|
||||||
if (m/^OpenPAM ([A-Z][a-z]+)\t+(\d\d\d\d-\d\d-\d\d)\s*$/) {
|
if (m/^OpenPAM ([A-Z][a-z]+)\t+(\d\d\d\d-\d\d-\d\d)\s*$/) {
|
||||||
my ($relname, $reldate) = ($1, $2);
|
my ($relname, $reldate) = ($1, $2);
|
||||||
my $wikitext = "= OpenPAM $relname =\n" .
|
my $changes;
|
||||||
"\n" .
|
|
||||||
"OpenPAM $relname was released on $reldate.\n";
|
|
||||||
while (<>) {
|
while (<>) {
|
||||||
last if m/^=+$/;
|
last if m/^=+$/;
|
||||||
$wikitext .= $_;
|
$changes .= $_;
|
||||||
}
|
}
|
||||||
$wikitext =~ s/^ - ([A-Z]+): / - '''$1''' /gm;
|
$changes =~ s/^ - ([A-Z]+): / - '''$1''' /gm;
|
||||||
$wikitext =~ s/(\w+\(\d*\))/`$1`/gs;
|
$changes =~ s/([\w.-]+\(\d*\))/`$1`/gs;
|
||||||
$wikitext =~ s/([^'])\b([A-Z_]{2,})\b([^'])/$1`$2`$3/gs;
|
$changes =~ s/([^'])\b([A-Z_]{2,})\b([^'])/$1`$2`$3/gs;
|
||||||
$wikitext =~ s/([.!?])\n +(\w)/$1 $2/gs;
|
$changes =~ s/`CVE`-(\d{4}-\d+)/[$CVEURL$1 CVE-$1]/gs;
|
||||||
$wikitext =~ s/(\S)\n +(\S)/$1 $2/gs;
|
$changes =~ s/([.!?])\n +(\w)/$1 $2/gs;
|
||||||
$wikitext .= "\n" .
|
$changes =~ s/(\S)\n +(\S)/$1 $2/gs;
|
||||||
"[http://sourceforge.net/projects/openpam/files/openpam/$relname/ Download from Sourceforge]\n";
|
|
||||||
open(my $fh, ">", "$relname.txt")
|
open(my $fh, ">", "$relname.txt")
|
||||||
or die("$relname.txt: $!\n");
|
or die("$relname.txt: $!\n");
|
||||||
print($fh $wikitext);
|
print($fh "= OpenPAM $relname =\n",
|
||||||
|
"\n",
|
||||||
|
"OpenPAM $relname was released on $reldate.\n",
|
||||||
|
$changes,
|
||||||
|
"\n",
|
||||||
|
"[http://sourceforge.net/projects/openpam/files/openpam/$relname/ Download from Sourceforge]\n");
|
||||||
close($fh);
|
close($fh);
|
||||||
print("|| $reldate || [[Releases/$relname|$relname]] ||\n");
|
print("|| $reldate || [[Releases/$relname|$relname]] ||\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue