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

Contents of /bin/checklist

Parent Directory Parent Directory | Revision Log Revision Log


Revision 309 - (hide annotations) (download)
Sat Jan 22 03:55:54 2005 UTC (8 years, 3 months ago) by joeyh
Original Path: sarge-checks/checklist
File size: 2274 byte(s)
add count of TODO lines
1 joeyh 2 #!/usr/bin/perl
2     # Must run on a machine with madison.
3 joeyh 256 use URI::Escape;
4 joeyh 2
5 joeyh 230 my $html=0;
6     if ($ARGV[0] eq 'html') {
7     shift;
8     $html=1;
9     }
10    
11 joeyh 31 if (! @ARGV) {
12 joeyh 230 die "usage: $0 [html] list\n";
13 joeyh 2 }
14    
15 joeyh 230
16 joeyh 307 my %data;
17 joeyh 309 my $unprop = my $unfixed = my $todos = 0;
18 joeyh 307
19     sub record {
20     my ($package, $condition, $item)=@_;
21    
22 joeyh 231 if ($html) {
23 joeyh 307 $condition=~s{bug #(\d+)}{<a href="http://bugs.debian.org/$1">bug #$1</a>}g;
24     $item=~s#((?:CAN|CVE)-\d+-\d+)#<a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=$1">$1</a>#g;
25 joeyh 231 }
26 joeyh 307
27     push @{$data{$package}{$condition}}, $item;
28 joeyh 230 }
29    
30 joeyh 31 foreach my $list (@ARGV) {
31     if (-d $list) {
32     $list="$list/list";
33 joeyh 2 }
34 joeyh 31
35     open (IN, $list) || die "open $list: $!";
36     while (<IN>) {
37     chomp;
38     if (/^\[/) {
39 joeyh 242 ($id)=m/((?:DSA|CAN|CVE)-[^\s]+) /;
40 joeyh 2 }
41 joeyh 242 elsif (/^((?:DSA|CAN|CVE)-[^\s]+)/) {
42     $id=$1;
43 joeyh 31 }
44     elsif (/^\s+[!-]\s+(.*?)\s+(.*)$/) {
45     my $package=$1;
46     my $version=$2;
47 joeyh 241
48     my $maddy=`madison -s testing '$package'`;
49 joeyh 307 if (! length $maddy) {
50     next;
51     }
52 joeyh 241
53 joeyh 31 if ($version=~/unfixed/) {
54 joeyh 307 record($package, $version, $id);
55 joeyh 257 $unfixed++;
56 joeyh 2 }
57 joeyh 241 else {
58 joeyh 31 my @fields = split(/\s*\|\s*/, $maddy);
59 joeyh 230 my $havver=$fields[1];
60     my $cmp=system("dpkg --compare-versions '$havver' '>=' '$version'");
61 joeyh 31 if ($cmp != 0) {
62 joeyh 230 if ($html) {
63 joeyh 256 $havver='<a href="http://bjorn.haxx.se/debian/testing.pl?package='.uri_escape($package).'">'.$havver.'</a>';
64 joeyh 230 }
65 joeyh 307 record($package, "$version needed, have $havver", $id);
66 joeyh 257 $unprop++;
67 joeyh 31 }
68     }
69 joeyh 2 }
70 joeyh 309 elsif (/\s+TODO/) {
71     $todos++;
72     }
73 joeyh 2 }
74     }
75 joeyh 230
76 joeyh 307
77 joeyh 230 if ($html) {
78 joeyh 307 print "<html><title>testing security issues</title>\n";
79     print "<ul>\n";
80     }
81    
82     foreach my $package (sort keys %data) {
83     foreach my $condition (sort keys %{$data{$package}}) {
84     print "<li>" if $html;
85     print "$package $condition for ";
86     my $items=0;
87     foreach my $item (sort @{$data{$package}{$condition}}) {
88     print ", " if $items > 0;
89     print $item;
90     $items++;
91     }
92     print "\n";
93     }
94     }
95    
96     if ($html) {
97 joeyh 230 print "</ul>\n";
98 joeyh 233 print "<hr>\n";
99 joeyh 307 print "Total holes unfixed: $unfixed<br>\n";
100     print "Total holes fixed in unstable but not testing: $unprop<br>\n";
101 joeyh 309 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";
102 joeyh 244 print "Last update: ".`date`."<br>\n";
103     print "</html>\n";
104 joeyh 230 }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5