/[secure-testing]/bin/checklist
ViewVC logotype

Diff of /bin/checklist

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

sarge-checks/checklist revision 687 by stef-guest, Wed Mar 30 14:48:15 2005 UTC data/checklist revision 1243 by joeyh, Mon Jun 20 04:07:52 2005 UTC
# Line 19  if (! @ARGV) { Line 19  if (! @ARGV) {
19    
20    
21  my %data;  my %data;
22  my %needkernel=qw/2.4.27 0 2.6.8 0/;  my %needkernel=qw/2.4.27 0 2.6.11 0/;
23  my $list_unknown=0; #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
24  my $sources=$ENV{SOURCES_FILE};  my $sources=$ENV{SOURCES_FILE};
25  my $need_rebuild=0;  my $need_rebuild=0;
26    
27  my $unprop = my $unfixed = my $todos = 0;  my @urgencies=("high", "medium", "low", "unknown");
28    my %colormap=(
29            high => "#FF0000",
30            medium => "#FF9999",
31            low => "#FFFFFF",
32            unknown => "#FFFFFF"
33    );
34    
35    my $unprop = my $unprop_all = my $unfixed = my $todos = 0;
36    
37  sub record {  sub record {
38          my ($package, $condition, $item)=@_;          my ($package, $condition, $item, $urgency)=@_;
39    
40          if ($html) {          if ($html) {
41                  $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;
# Line 35  sub record { Line 43  sub record {
43                  $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;
44          }          }
45    
46          push @{$data{$package}{$condition}}, $item;          push @{$data{$package}{$condition}}, {item => $item, urgency => $urgency};
47  }  }
48    
49  foreach my $list (@ARGV) {  foreach my $list (@ARGV) {
# Line 54  foreach my $list (@ARGV) { Line 62  foreach my $list (@ARGV) {
62                  }                  }
63                  elsif (/^\s+[!-]\s+(\S+)\s+(.*?)\s*$/) {                  elsif (/^\s+[!-]\s+(\S+)\s+(.*?)\s*$/) {
64                          my $package=$1;                          my $package=$1;
65                          my $version=$2;                          my $rest=$2;
66                            my $version;
67                            my $notes;
68                            if ($rest=~/([^\(\s]+)\s+\((.*)\)/) {
69                                    $version=$1;
70                                    $notes=$2;
71                            }
72                            elsif ($rest=~/\((.*)\)/) {
73                                    $version="";
74                                    $notes=$1;
75                            }
76                            else {
77                                    $version=$rest;
78                                    $notes="";
79                            }
80                            my @notes=split(/\s*;\s+/, $notes);
81    
82                            my $urgency="unknown";
83                            foreach my $u (@urgencies) {
84                                    if (grep { $_ eq $u } @notes) {
85                                            $urgency=$u;
86                                            @notes = grep { $_ ne $u } @notes;
87                                            last;
88                                    }
89                            }
90    
91                          if ($package=~/kernel-source-([0-9.]+)/) {                          if ($package=~/kernel-source-([0-9.]+)/) {
92                                  my $kernversion=$1;                                  my $kernversion=$1;
93                                  if (exists $needkernel{$kernversion} &&                                  if (exists $needkernel{$kernversion}) {
                                                 $version!~/\(/ ) {  
94                                          $needkernel{$kernversion}=$version if !system("dpkg --compare-versions $needkernel{$kernversion} lt $version");                                          $needkernel{$kernversion}=$version if !system("dpkg --compare-versions $needkernel{$kernversion} lt $version");
95                                  }                                  }
96                          }                          }
# Line 84  foreach my $list (@ARGV) { Line 115  foreach my $list (@ARGV) {
115                                  next;                                  next;
116                          }                          }
117    
118                          if ($version=~/unfixed/ || $version=~/pending/) {                          if (grep { $_ eq 'unfixed' || $_ eq 'pending' } @notes) {
119                                  record($package, $version, $id);                                  record($package, join("; ", @notes), $id, $urgency);
120                                  $unfixed++;                                  $unfixed++;
121                          }                          }
122                          else {                          else {
# Line 100  foreach my $list (@ARGV) { Line 131  foreach my $list (@ARGV) {
131                                                  if ($html) {                                                  if ($html) {
132                                                          $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>';
133                                                  }                                                  }
134                                                  record($package, "$version needed, have $havver".(@maddy > 1 ? " [$arches]" : ""), $id);                                                  record($package, "$version needed, have $havver".(@maddy > 1 ? " [$arches]" : ""), $id, $urgency);
135                                                  $unprop++;                                                  $unprop++;
136                                                    $unprop_all++ unless @maddy > 1;
137                                          }                                          }
138                                  }                                  }
139                          }                          }
# Line 123  foreach my $package (sort keys %data) { Line 155  foreach my $package (sort keys %data) {
155                  print "<li>" if $html;                  print "<li>" if $html;
156                  print "$package $condition for ";                  print "$package $condition for ";
157                  my $items=0;                  my $items=0;
158                  foreach my $item (sort @{$data{$package}{$condition}}) {                  foreach my $i (sort @{$data{$package}{$condition}}) {
159                          print ", " if $items > 0;                          print ", " if $items > 0;
160                          print $item;  
161                            if ($html) {
162                                    my $color=$colormap{$i->{urgency}};
163                                    print "<span style=\"background:$color\">";
164                            }
165                            print $i->{item};
166                            if ($html) {
167                                    print "</span>";
168                            }
169    
170                          $items++;                          $items++;
171                  }                  }
172                  print "\n";                  print "\n";
# Line 187  if ($html) { Line 228  if ($html) {
228          print "</ul>\n";          print "</ul>\n";
229          print "<hr>\n";          print "<hr>\n";
230          print "Total holes unfixed: $unfixed<br>\n";          print "Total holes unfixed: $unfixed<br>\n";
231          print "Total holes fixed in unstable but not testing: $unprop<br>\n";          print "Total holes fixed in unstable but not testing: $unprop_all";
232          print "Total number of kernel image source packages not up to date: $need_rebuild<br>\n";          if ($unprop_all != $unprop) {
233          print "Number of TODO lines in <a href=\"http://svn.debian.org/wsvn/secure-testing/sarge-checks/?rev=0&sc=0\">records</a>: $todos<br>\n";                  print " (+".($unprop - $unprop_all)." on some arches)";
234            }
235            print "<br>\n";
236            print "Total number of kernel image packages not up to date: $need_rebuild<br>\n";
237            print "Number of TODO lines in <a href=\"http://svn.debian.org/wsvn/secure-testing/data/?rev=0&sc=0\">records</a>: $todos<br>\n";
238          print "Maintained by the <a href=\"http://secure-testing.alioth.debian.org/\">testing security team</a><br>\n";          print "Maintained by the <a href=\"http://secure-testing.alioth.debian.org/\">testing security team</a><br>\n";
239          print "Last update: ".`date`."<br>\n";          print "Last update: ".`date`."<br>\n";
240          print "</html>\n";          print "</html>\n";

Legend:
Removed from v.687  
changed lines
  Added in v.1243

  ViewVC Help
Powered by ViewVC 1.1.5