#!/usr/bin/perl # Filename: gen_index # Purpose: Generates the index.html overview of all source repos # Authors: grml-team (grml.org), (c) Alexander Wirt # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. # Latest change: So Mai 06 22:06:09 CEST 2007 [formorer] ################################################################################ use strict; use warnings; use English; use CGI qw/:standard/; use HTML::Table; use File::Basename; my $reports = '/home/sources/reports'; my @status_files = split("\n", `find $reports -maxdepth 2 -name status.txt`); open(my $fh, '>', "$reports/index.html") or die "Could not open '$reports/index.html' for writing: $!"; print $fh start_html("Source Repository for GRML"); print $fh "

GRML Source Repository



"; my $t = new HTML::Table( -cols => 5, -border=>1, -head=> ['Release','Packages','Sources', 'Errors', 'Last updated', 'sources.list entry'], ); foreach my $releasefile (@status_files) { open (my $pfh, '<', "$releasefile") or die "Could not open statusfile '$releasefile': $!"; my ($release, $packages, $sources, $errors, $lastupdated, $baseurl); while (<$pfh>) { chomp; if (/^Updated: (.*)$/) { $lastupdated = $1; next;} if (/^Sources: (.*)$/) { $sources = $1; next; } if (/^Title: (.*)$/) { $release = $1; next; } if (/^Errors: (.*)$/) { $errors = $1; next; } if (/^Packages: (.*)$/) { $packages = $1; next; } if (/^Baseurl: (.*)$/) { $baseurl = $1; next; } } $t->addRow( "".lc($release)."", "$packages", "$sources", "$errors", "$lastupdated", "deb-src $baseurl ./", ); } print $fh $t; print $fh end_html; close($fh);