3 # Purpose: Generates the index.html overview of all source repos
4 # Authors: grml-team (grml.org), (c) Alexander Wirt
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2.
7 # Latest change: So Mai 06 22:06:09 CEST 2007 [formorer]
8 ################################################################################
14 use CGI qw/:standard/;
19 my $reports = '/home/sources/reports';
20 my @status_files = split("\n", `find $reports -maxdepth 2 -name status.txt`);
23 open(my $fh, '>', "$reports/index.html")
24 or die "Could not open '$reports/index.html' for writing: $!";
26 print $fh start_html("Source Repository for GRML");
27 print $fh "<center><h1><a href='http://grml.org/'>GRML</a> Source Repository</h1><br><br>";
28 my $t = new HTML::Table(
31 -head=> ['Release','Packages','Sources',
32 'Errors', 'Last updated', 'sources.list entry'],
35 foreach my $releasefile (@status_files) {
36 open (my $pfh, '<', "$releasefile")
37 or die "Could not open statusfile '$releasefile': $!";
38 my ($release, $packages, $sources, $errors, $lastupdated, $baseurl);
41 if (/^Updated: (.*)$/) { $lastupdated = $1; next;}
42 if (/^Sources: (.*)$/) { $sources = $1; next; }
43 if (/^Title: (.*)$/) { $release = $1; next; }
44 if (/^Errors: (.*)$/) { $errors = $1; next; }
45 if (/^Packages: (.*)$/) { $packages = $1; next; }
46 if (/^Baseurl: (.*)$/) { $baseurl = $1; next; }
48 $t->addRow( "<a href='$baseurl'>".lc($release)."</a>",
53 "deb-src $baseurl ./",