summaryrefslogtreecommitdiffstats
path: root/bin/updatehtmllist
blob: d3f50f5aed2fc6a8890109d45172235ce7fc5db4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/perl
# Must be run from the website dir
use Getopt::Long;

my $output;
if (! GetOptions(
		"output=s", \$output)
    || ! @ARGV[0]) {
	die "usage: $0 [--output=file] list\n";
}

if (defined $output) {
	open (OUT, ">$output.tmp.$$") || die "output.tmp.$$: $!"; # Set the output to a file
}
else {
	open (OUT, ">&STDOUT"); # Set the output to stdout
}

open (HEAD,"header.html") || die("Could not open header.html: $!");
while(<HEAD>) {
	$line = $_ ;
	print OUT "$line" ;
}
close HEAD;	

print OUT "<table class='.list'>\n";

my $pack = 0;
my $date = "";
my $dtsa = "";
my $package = "";
my $desc = "";
open (LIST,@ARGV[0]) || die("Could not open list ".@ARGV[0].": $!");
my @list;
{
	local $/="\n\[";
	@list = reverse <LIST>;
}
close LIST;

foreach my $entry (@list) {
	next if $entry =~ /TODO: unreleased/;
	if ($entry=~/^\[?(.+)\] (DTSA-[0-9]+-[0-9]+) ([^ ].+) - (.+)$/m) {
		print OUT htmlentry($1, $2, $3, $4);
	}
	else {
		print STDERR "invalid entry:\n$entry";
	}
}

print OUT "</table>\n";


open (FOOT,"footer.html") || die("Could not open footer.html: $!"); ;
while(<FOOT>) {
	$line = $_ ;
	print OUT "$line" ;
}
close FOOT;

close OUT;
if (defined $output) {
	rename("$output.tmp.$$", $output) || die "rename: $!";
}



sub htmlentry {
	my ($date, $dtsa, $package, $desc) = @_;
	return << "EOF";
<tr><td>$date</td><td> <a href='DTSA/$dtsa.html'>$dtsa $package</a></td>\n
<td>$desc</td></tr>
EOF
}


© 2014-2024 Faster IT GmbH | imprint | privacy policy