| 19 |
|
|
| 20 |
|
|
| 21 |
my %data; |
my %data; |
| 22 |
|
my @urgencies=("high", "medium", "low", "unknown"); |
| 23 |
my %needkernel=qw/2.4.27 0 2.6.11 0/; |
my %needkernel=qw/2.4.27 0 2.6.11 0/; |
| 24 |
my $list_unknown=1; #set to 1 to display kernel images with unknown source version |
my $list_unknown=1; #set to 1 to display kernel images with unknown source version |
| 25 |
my $sources=$ENV{SOURCES_FILE}; |
my $sources=$ENV{SOURCES_FILE}; |
| 28 |
my $unprop = my $unprop_all = my $unfixed = my $todos = 0; |
my $unprop = my $unprop_all = my $unfixed = my $todos = 0; |
| 29 |
|
|
| 30 |
sub record { |
sub record { |
| 31 |
my ($package, $condition, $item)=@_; |
my ($package, $condition, $item, $urgency)=@_; |
| 32 |
|
|
| 33 |
if ($html) { |
if ($html) { |
| 34 |
$condition=~s{bug #(\d+)}{<a href="http://bugs.debian.org/$1">bug #$1</a>}g; |
$condition=~s{bug #(\d+)}{<a href="http://bugs.debian.org/$1">bug #$1</a>}g; |
| 36 |
$item=~s#((?:CAN|CVE)-\d+-\d+)#<a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=$1">$1</a>#g; |
$item=~s#((?:CAN|CVE)-\d+-\d+)#<a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=$1">$1</a>#g; |
| 37 |
} |
} |
| 38 |
|
|
| 39 |
push @{$data{$package}{$condition}}, $item; |
push @{$data{$package}{$condition}}, {item => $item, urgency => $urgency}; |
| 40 |
} |
} |
| 41 |
|
|
| 42 |
foreach my $list (@ARGV) { |
foreach my $list (@ARGV) { |
| 55 |
} |
} |
| 56 |
elsif (/^\s+[!-]\s+(\S+)\s+(.*?)\s*$/) { |
elsif (/^\s+[!-]\s+(\S+)\s+(.*?)\s*$/) { |
| 57 |
my $package=$1; |
my $package=$1; |
| 58 |
my $version=$2; |
my $rest=$2; |
| 59 |
|
my $version; |
| 60 |
|
my $notes; |
| 61 |
|
if ($rest=~/([^\(\s]+)\s+\((.*)\)/) { |
| 62 |
|
$version=$1; |
| 63 |
|
$notes=$2; |
| 64 |
|
} |
| 65 |
|
elsif ($rest=~/\((.*)\)/) { |
| 66 |
|
$version=""; |
| 67 |
|
$notes=$1; |
| 68 |
|
} |
| 69 |
|
else { |
| 70 |
|
$version=$rest; |
| 71 |
|
$notes=""; |
| 72 |
|
} |
| 73 |
|
my @notes=split(/\s*;\s+/, $notes); |
| 74 |
|
|
| 75 |
|
my $urgency="unknown"; |
| 76 |
|
foreach my $u (@urgencies) { |
| 77 |
|
if (grep { $_ eq $u } @notes) { |
| 78 |
|
$urgency=$u; |
| 79 |
|
@notes = grep { $_ ne $u } @notes; |
| 80 |
|
last; |
| 81 |
|
} |
| 82 |
|
} |
| 83 |
|
|
| 84 |
if ($package=~/kernel-source-([0-9.]+)/) { |
if ($package=~/kernel-source-([0-9.]+)/) { |
| 85 |
my $kernversion=$1; |
my $kernversion=$1; |
| 86 |
if (exists $needkernel{$kernversion} && |
if (exists $needkernel{$kernversion}) { |
|
$version!~/\(/ ) { |
|
| 87 |
$needkernel{$kernversion}=$version if !system("dpkg --compare-versions $needkernel{$kernversion} lt $version"); |
$needkernel{$kernversion}=$version if !system("dpkg --compare-versions $needkernel{$kernversion} lt $version"); |
| 88 |
} |
} |
| 89 |
} |
} |
| 108 |
next; |
next; |
| 109 |
} |
} |
| 110 |
|
|
| 111 |
if ($version=~/unfixed/ || $version=~/pending/) { |
if (grep { $_ eq 'unfixed' || $_ eq 'pending' } @notes) { |
| 112 |
record($package, $version, $id); |
record($package, join("; ", @notes), $id, $urgency); |
| 113 |
$unfixed++; |
$unfixed++; |
| 114 |
} |
} |
| 115 |
else { |
else { |
| 124 |
if ($html) { |
if ($html) { |
| 125 |
$havver='<a href="http://bjorn.haxx.se/debian/testing.pl?package='.uri_escape($package).'">'.$havver.'</a>'; |
$havver='<a href="http://bjorn.haxx.se/debian/testing.pl?package='.uri_escape($package).'">'.$havver.'</a>'; |
| 126 |
} |
} |
| 127 |
record($package, "$version needed, have $havver".(@maddy > 1 ? " [$arches]" : ""), $id); |
record($package, "$version needed, have $havver".(@maddy > 1 ? " [$arches]" : ""), $id, $urgency); |
| 128 |
$unprop++; |
$unprop++; |
| 129 |
$unprop_all++ unless @maddy > 1; |
$unprop_all++ unless @maddy > 1; |
| 130 |
} |
} |
| 148 |
print "<li>" if $html; |
print "<li>" if $html; |
| 149 |
print "$package $condition for "; |
print "$package $condition for "; |
| 150 |
my $items=0; |
my $items=0; |
| 151 |
foreach my $item (sort @{$data{$package}{$condition}}) { |
foreach my $i (sort @{$data{$package}{$condition}}) { |
| 152 |
print ", " if $items > 0; |
print ", " if $items > 0; |
| 153 |
print $item; |
|
| 154 |
|
if ($html) { |
| 155 |
|
# TODO: replace with html for shades of red. |
| 156 |
|
if ($i->{urgency} eq 'high') { |
| 157 |
|
print "!!!"; |
| 158 |
|
} |
| 159 |
|
elsif ($i->{urgency} eq 'medium') { |
| 160 |
|
print "!"; |
| 161 |
|
} |
| 162 |
|
} |
| 163 |
|
print $i->{item}; |
| 164 |
|
|
| 165 |
$items++; |
$items++; |
| 166 |
} |
} |
| 167 |
print "\n"; |
print "\n"; |