3 # Create HTML pages describing the results of dependency-integrity checks
4 # over the Debian archive.
6 # Copyright (C) 1998 Richard Braakman
8 # This program is free software. It is distributed under the terms of
9 # the GNU General Public License as published by the Free Software
10 # Foundation; either version 2 of the License, or (at your option) any
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, you can find it on the World Wide
20 # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
21 # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
26 # comes from './config'
27 use vars qw( $LOG_DIR );
29 # lintian binary will define these
30 use vars qw($LINTIAN_DIST $HTML_TMP_DIR $LINTIAN_ARCHIVEDIR $LINTIAN_ROOT);
32 my @archs = ('i386', 'alpha', 'm68k', 'powerpc', 'sparc', 'arm', 'hurd-i386');
34 my @logfiles = map { "$LOG_DIR/Depcheck-" . $_ } @archs;
35 system("savelog @logfiles >/dev/null") == 0
36 or die("cannot rotate logfiles");
38 # this stuff is most likely broken
39 my $BINARY = "$LINTIAN_ARCHIVEDIR/dists/$LINTIAN_DIST/main";
41 my $libdir = defined $LINTIAN_ROOT ? "$LINTIAN_ROOT/" : "";
42 my $DEPCHECKDIR = "${libdir}depcheck";
43 my $DEPCHECK = "$DEPCHECKDIR/dependencies.py";
45 $ENV{'PYTHONPATH'} = $DEPCHECKDIR;
47 system("$DEPCHECK $BINARY/binary-i386/Packages >$LOG_DIR/Depcheck-i386") == 0
48 or die("depcheck failed for i386 architecture");
50 for my $arch (@archs) {
51 next if $arch eq 'i386';
53 system("$DEPCHECK $BINARY/binary-$arch/Packages $LOG_DIR/Depcheck-i386 >$LOG_DIR/Depcheck-$arch") == 0
54 or die("depcheck failed for $arch architecture");
60 open(BUGS, '<', "$LINTIAN_ROOT/depcheck/buglist") or die("buglist");
65 while ($bugline =~ s/^(\d+)\s//) {
66 push(@b, &make_bugref($1));
68 $bugs{$bugline} = join(", ", @b);
72 open(HTML, '>', "$HTML_TMP_DIR/depcheck.html") or die("depcheck.html");
75 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 2.0//EN">
78 <TITLE>Debian: Dependency integrity check for the main distribution</TITLE>
81 <H1>Dependency checks</H1>
82 This page summarizes the results of a scan that checks the following
83 two bits of Debian policy:<P>
85 <LI>From section 2.1.2: The main section<P>
87 The packages in "main" must not require a package outside of
88 "main" for compilation or execution (thus, the package may not
89 declare a "Depends" or "Recommends" relationship on a non-main package).
91 <LI>From section 2.2: Priorities<P>
93 Packages may not depend on packages with lower priority values.
94 If this should happen, one of the priority values will have to be
99 The scan also looks for packages in the "base" section that depend on
100 packages not in the "base" section, and for packages that depend on
101 packages in "oldlibs" that are not themselves in "oldlibs".<P>
103 The scan checks the Recommends, Depends, and Pre-Depends headers in
107 for my $arch (@archs) {
113 for my $bug (keys %bugs) {
114 unless ($bug_used{$bug}) {
115 print STDERR "Unused bugnumber: $bug\n";
125 print HTML "<A NAME=$arch>\n";
126 print HTML "<H2>Dependency check for the $arch architecture</H2>\n\n";
128 print HTML "<P>This list was generated from the $arch Packages file,<BR>\n"
129 . "dated: " . &filetime("$BINARY/binary-$arch/Packages") . ".\n";
131 if ($arch ne 'i386') {
132 print HTML "<P>It excludes the checks which were already " .
133 "reported for the i386 architecture.\n";
138 open(REPORT, '<', "$LOG_DIR/Depcheck-$arch") or die("Depcheck-$arch");
152 $bug = $bugs{$brokendep};
154 $bug_used{$brokendep} = 1;
155 $brokendep = quotehtml($brokendep) . ' [' . $bug . ']';
157 $brokendep = quotehtml($brokendep);
159 print(HTML " <LI>$brokendep\n");
164 print(HTML "</UL>\n\n");
167 print(HTML "<H3>$_</H3>\n");
168 print(HTML "<UL>\n");
174 print(HTML "</UL>\n");
180 my $bugdir = substr($bugnum, 0, 2);
182 return "<A HREF=\"http://www.debian.org/Bugs/db/$bugdir/$bugnum.html\">"
195 my $time = (stat(shift))[9]; # mtime
196 return scalar(gmtime($time));