/[secure-testing]/bin/updatehtmllist
ViewVC logotype

Contents of /bin/updatehtmllist

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6076 - (show annotations) (download)
Fri Jun 29 16:36:14 2007 UTC (5 years, 11 months ago) by stef-guest
File size: 1514 byte(s)
back out website changes I didn't really want to commit
1 #!/usr/bin/perl
2 # Must be run from the website dir
3 use Getopt::Long;
4
5 my $output;
6 if (! GetOptions(
7 "output=s", \$output)
8 || ! @ARGV[0]) {
9 die "usage: $0 [--output=file] list\n";
10 }
11
12 if (defined $output) {
13 open (OUT, ">$output.tmp.$$") || die "output.tmp.$$: $!"; # Set the output to a file
14 }
15 else {
16 open (OUT, ">&STDOUT"); # Set the output to stdout
17 }
18
19 open (HEAD,"header.html") || die("Could not open header.html: $!");
20 while(<HEAD>) {
21 $line = $_ ;
22 print OUT "$line" ;
23 }
24 close HEAD;
25
26 print OUT "<dl>\n";
27
28 my $pack = 0;
29 my $date = "";
30 my $dtsa = "";
31 my $package = "";
32 my $desc = "";
33 open (LIST,@ARGV[0]) || die("Could not open list ".@ARGV[0].": $!");
34 while(<LIST>) {
35 $line = $_ ;
36 if ($line=~/^(\[.+\]) (DTSA-[0-9]+-[0-9]+) ([^ ].+) - (.+)$/) {
37 if ($pack == 1) {
38 # print the previous acvisory, as it wasn't unreleased
39 print OUT "<dt>$date <a href='DTSA/$dtsa.html'>$dtsa $package</a></dt>\n";
40 print OUT "<dd>$desc</dd>\n";
41 }
42 $date = $1;
43 $dtsa = $2;
44 $package = $3;
45 $desc = $4;
46 $pack = 1;
47 }
48 if ($line=~/TODO: unreleased$/) {
49 $pack = 0;
50 }
51 }
52 if ($pack == 1) {
53 # print the previous acvisory, as it wasn't unreleased
54 print OUT "<dt>$date <a href='DTSA/$dtsa.html'>$dtsa $package</a></dt>\n";
55 print OUT "<dd>$desc</dd>\n";
56 }
57 print OUT "</dl>\n";
58
59 open (FOOT,"footer.html") || die("Could not open footer.html: $!"); ;
60 while(<FOOT>) {
61 $line = $_ ;
62 print OUT "$line" ;
63 }
64 close FOOT;
65
66 close OUT;
67 if (defined $output) {
68 rename("$output.tmp.$$", $output) || die "rename: $!";
69 }
70

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5