Author: joeyh Date: 2005-01-05 00:05:06 +0100 (Wed, 05 Jan 2005) New Revision: 231 Modified: sarge-checks/checklist Log: improvements Modified: sarge-checks/checklist ==================================================================--- sarge-checks/checklist 2005-01-04 22:53:54 UTC (rev 230) +++ sarge-checks/checklist 2005-01-04 23:05:06 UTC (rev 231) @@ -16,10 +16,13 @@ print "<ul>\n"; } -sub printid { - my $id=shift; - $id=~s#((?:CAN|CVE)-\d+-\d+)#<a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=$1">$1</a>#g if $html; - return $id; +sub formatout { + my $out=shift; + if ($html) { + $out=~s#((?:CAN|CVE)-\d+-\d+)#<a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=$1">$1</a>#g; + $out=~s{bug #(\d+)}{<a href="http://bugs.debian.org/$1">bug #$1</a>}g; + } + return $out; } foreach my $list (@ARGV) { @@ -40,11 +43,8 @@ my $package=$1; my $version=$2; if ($version=~/unfixed/) { - if ($html) { - print "<li>"; - $version=~s!bug #(\d+)!<a href="http://bugs.debian.org/$1">bug #$1</a>!g; - } - print "$package $version for ".printid($id)."\n"; + print "<li>" if $html; + print formatout("$package $version for $id\n"); next; } my $maddy=`madison -s testing ''$package''`; @@ -55,9 +55,9 @@ if ($cmp != 0) { if ($html) { print "<li>"; - $havver=''<a href="http://bjorn.haxx.se/debian/testing.pl?package=''.$package.''">''.$havever.''</a>''; + $havver=''<a href="http://bjorn.haxx.se/debian/testing.pl?package=''.$package.''">''.$havver.''</a>''; } - print "$package $version needed, have $havver for ".printid($id)."\n"; + print formatout("$package $version needed, have $havver for $id\n"); } } }