lintian: r299 - in trunk: checks debian frontend lib
Author: jeroen
Date: 2004-06-29 17:21:09 +0200 (Tue, 29 Jun 2004)
New Revision: 299
Modified:
trunk/checks/common_data.pm
trunk/debian/changelog
trunk/frontend/lintian
trunk/lib/Lab.pm
Log:
* checks/common-data.pm:
+ [JvW] Add libgl(u)-dev to list of virtual packages (Closes: #255595)
Modified: trunk/checks/common_data.pm
===================================================================
--- trunk/checks/common_data.pm 2004-06-26 23:34:36 UTC (rev 298)
+++ trunk/checks/common_data.pm 2004-06-29 15:21:09 UTC (rev 299)
@@ -68,6 +68,8 @@
'libjpegg6a', 'gmp2', 'libgtop0', 'libghttp0', 'libpgsql', 'tk4.2',
'tcl7.6', 'libpng0g', 'xbase');
+# Used only (at least lintian 1.23.1) for giving a warning about a
+# virtual-only dependency
%known_virtual_packages = map { $_ => 1 }
('x-terminal-emulator', 'x-window-manager', 'xserver', 'awk', 'c-compiler',
'c-shell', 'dotfile-module', 'emacsen', 'fortran77-compiler',
@@ -90,6 +92,7 @@
'debconf-2.0',
'aspell-dictionary',
'radius-server',
+ 'libgl-dev', 'libglu-dev'
);
%known_libstdcs = map { $_ => 1 }
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2004-06-26 23:34:36 UTC (rev 298)
+++ trunk/debian/changelog 2004-06-29 15:21:09 UTC (rev 299)
@@ -18,6 +18,8 @@
* checks/changelog-files{,.desc}:
+ [HE] New check latest-debian-changelog-entry-without-new-date, comparing
the dates of the last 2 changelog entries. (Closes: #111215)
+ * checks/common-data.pm:
+ + [JvW] Add libgl(u)-dev to list of virtual packages (Closes: #255595)
* checks/control-file{,.desc}:
+ [HE] Introduced new check script. New checks:
- build-info-in-binary-control-file-section, triggered
@@ -114,7 +116,7 @@
+ [FL] Fix sort of copy & paste error which caused the whole
script to behave ill
- -- Debian Lintian Maintainers <lintian-maint@debian.org> Tue, 18 May 2004 00:03:28 +0200
+ -- Debian Lintian Maintainers <lintian-maint@debian.org> Tue, 29 Jun 2004 16:30:24 +0200
lintian (1.23.0) unstable; urgency=low
Modified: trunk/frontend/lintian
===================================================================
--- trunk/frontend/lintian 2004-06-26 23:34:36 UTC (rev 298)
+++ trunk/frontend/lintian 2004-06-29 15:21:09 UTC (rev 299)
@@ -1,3 +1,8 @@
+remove: unpack level -> altijd 1
+setup-lab , remove-lab
+LAB_FORMAT
+lab_mode -> altijd temp
+
#!/usr/bin/perl -w
# {{{ Legal stuff
# Lintian -- Debian package checker
@@ -3,4 +8,5 @@
#
# Copyright (C) 1998 Christian Schwarz and Richard Braakman
+# 2004 Jeroen van Wolffelaar
#
# This program is free software. It is distributed under the terms of
@@ -26,16 +32,13 @@
use Getopt::Long;
use FileHandle;
+use File::Temp ( tempdir );
# }}}
# {{{ Global Variables
my $lintian_info_cmd = 'lintian-info'; #Command to run for ?
my $LINTIAN_VERSION = "<VERSION>"; #External Version number
my $BANNER = "Lintian v$LINTIAN_VERSION"; #Version Banner - text form
-my $LAB_FORMAT = 7; #Lab format Version Number
- #increased whenever incompatible
- #changes are done to the lab
- #so that all packages are re-unpacked
# Variables used to record commandline options
# Commented out variables have "defined" checks somewhere to determine if
@@ -49,13 +52,11 @@
my $check_everything = 0; #flag for -a|--all switch
my $lintian_info = 0; #flag for -i|--info switch
our $display_infotags = 0; #flag for -I|--display-info switch
-my $unpack_level = undef; #flag for -l|--unpack-level switch
our $no_override = 0; #flag for -o|--no-override switch
our $show_overrides = 0; #flag for --show-overrides switch
my $check_md5sums = 0; #flag for -m|--md5sums switch
my $allow_root = 0; #flag for --allow-root swtich
my $packages_file = 0; #string for the -p option
-my $OPT_LINTIAN_LAB = ""; #string for the --lab option
my $OPT_LINTIAN_ARCHIVEDIR = "";#string for the --archivedir option
my $OPT_LINTIAN_DIST = ""; #string for the --dist option
my $OPT_LINTIAN_ARCH = ""; #string for the --arch option
@@ -69,11 +70,9 @@
my $action;
my $checks;
my $dont_check;
-my $unpack_info;
my $cwd;
my $cleanup_filename;
my $exit_code;
-my $lab_mode = 'static';
my %collection_info;
my %already_scheduled;
@@ -83,10 +82,8 @@
my %check_info;
# reset configuration variables
-my $LINTIAN_LAB = undef;
my $LINTIAN_ARCHIVEDIR = undef;
my $LINTIAN_DIST = undef;
-my $LINTIAN_UNPACK_LEVEL = undef;
my $LINTIAN_ARCH = undef;
my $LINTIAN_SECTION = undef;
# }}}
@@ -121,13 +118,9 @@
print <<"EOT-EOT-EOT";
Syntax: lintian [action] [options] [--] [packages] ...
Actions:
- -S, --setup-lab set up static lab
- -R, --remove-lab remove static lab
-c, --check check packages (default action)
-C X, --check-part X check only certain aspects
-X X, --dont-check-part X don\'t check certain aspects
- -u, --unpack only unpack packages in the lab
- -r, --remove remove package from the lab
General options:
-h, --help display short help text
-v, --verbose verbose messages
@@ -137,15 +130,12 @@
Behaviour options:
-i, --info give detailed info about tags
-I, --display-info display "I:" tags (normally suppressed)
- -l X, --unpack-level X set default unpack level to X
-o, --no-override ignore overrides
--show-overrides output tags that have been overriden
- -U X, --unpack-info X specify which info should be collected
-m, --md5sums check md5sums when processing a .changes file
--allow-root suppress lintian\'s warning when run as root
Configuration options:
--cfg CONFIGFILE read CONFIGFILE for configuration
- --lab LABDIR use LABDIR as permanent laboratory
--archivedir ARCHIVEDIR location of Debian archive to scan for packages
--dist DIST scan packages in this distribution (e.g. sid)
--section RELEASE scan packages in this section (e.g. main)
@@ -215,14 +205,6 @@
}
-# Process for -U|--unpack-info flag
-sub record_unpack_info {
- if ($unpack_info) {
- die("multiple -U or --unpack-info options not allowed");
- }
- $unpack_info = $_[1];
-}
-
# Record what type of data is specified
# Options: -b|--binary, -s|--source, --udeb
sub record_pkgmode {
@@ -233,13 +215,9 @@
# Hash used to process commandline options
my %opthash = ( # ------------------ actions
- "setup-lab|S" => \&record_action,
- "remove-lab|R" => \&record_action,
"check|c" => \&record_action,
"check-part|C=s" => \&record_check_part,
"dont-check-part|X=s" => \&record_dont_check_part,
- "unpack|u" => \&record_action,
- "remove|r" => \&record_action,
# ------------------ general options
"help|h" => \&syntax,
@@ -252,16 +230,13 @@
# ------------------ behaviour options
"info|i" => \$lintian_info,
"display-info|I" => \$display_infotags,
- "unpack-level|l=i" => \$unpack_level,
"no-override|o" => \$no_override,
"show-overrides" => \$show_overrides,
- "unpack-info|U=s" => \&record_unpack_info,
"md5sums|m" => \$check_md5sums,
"allow-root" => \$allow_root,
# ------------------ configuration options
"cfg=s" => \$LINTIAN_CFG,
- "lab=s" => \$OPT_LINTIAN_LAB,
"archivedir=s" => \$OPT_LINTIAN_ARCHIVEDIR,
"dist=s" => \$OPT_LINTIAN_DIST,
"section=s" => \$OPT_LINTIAN_SECTION,
@@ -348,14 +323,10 @@
s,\$HOME/,$ENV{'HOME'}/,go;
s,\~/,$ENV{'HOME'}/,go;
- if (m/^\s*LINTIAN_LAB\s*=\s*(.*\S)\s*$/i) {
- $LINTIAN_LAB = $1;
- } elsif (m/^\s*LINTIAN_ARCHIVEDIR\s*=\s*(.*\S)\s*$/i) {
+ if (m/^\s*LINTIAN_ARCHIVEDIR\s*=\s*(.*\S)\s*$/i) {
$LINTIAN_ARCHIVEDIR = $1;
} elsif (m/^\s*LINTIAN_DIST\s*=\s*(.*\S)\s*$/i) {
$LINTIAN_DIST = $1;
- } elsif (m/^\s*LINTIAN_UNPACK_LEVEL\s*=\s*(.*\S)\s*$/i) {
- $LINTIAN_UNPACK_LEVEL = $1;
} elsif (/^\s*LINTIAN_SECTION\s*=\s*(.*\S)\s*$/i) {
$LINTIAN_SECTION = $1;
} elsif (m/^\s*LINTIAN_ARCH\s*=\s*(.*\S)\s*$/i) {
@@ -368,15 +339,12 @@
}
# environment variables overwrite settings in conf file:
-$LINTIAN_LAB = $ENV{'LINTIAN_LAB'} if $ENV{'LINTIAN_LAB'};
$LINTIAN_ARCHIVEDIR = $ENV{'LINTIAN_ARCHIVEDIR'} if $ENV{'LINTIAN_ARCHIVEDIR'};
$LINTIAN_DIST = $ENV{'LINTIAN_DIST'} if $ENV{'LINTIAN_DIST'};
-$LINTIAN_UNPACK_LEVEL = $ENV{'LINTIAN_UNPACK_LEVEL'} if $ENV{'LINTIAN_UNPACK_LEVEL'};
$LINTIAN_SECTION = $ENV{'LINTIAN_SECTION'} if $ENV{'LINTIAN_SECTION'};
$LINTIAN_ARCH = $ENV{'LINTIAN_ARCH'} if $ENV{'LINTIAN_ARCH'};
# command-line options override everything
-$LINTIAN_LAB = $OPT_LINTIAN_LAB if $OPT_LINTIAN_LAB;
$LINTIAN_ARCHIVEDIR = $OPT_LINTIAN_ARCHIVEDIR if $OPT_LINTIAN_ARCHIVEDIR;
$LINTIAN_DIST = $OPT_LINTIAN_DIST if $OPT_LINTIAN_DIST;
$LINTIAN_SECTION = $OPT_LINTIAN_SECTION if $OPT_LINTIAN_SECTION;
@@ -404,21 +372,6 @@
$ENV{'LINTIAN_CFG'} = "";
}
-if ($LINTIAN_LAB) {
- # LINTIAN_LAB defined => advanced mode (static lab)
- $lab_mode = 'static';
-} else {
- # LINTIAN_LAB not defined => basic mode (temporary lab)
- $lab_mode = 'temporary';
-
- if ($ENV{'TMPDIR'}) {
- $LINTIAN_LAB = "$ENV{'TMPDIR'}/lintian-lab.$$";
- } else {
- $LINTIAN_LAB = "/tmp/lintian-lab.$$";
- }
-}
-$ENV{'LINTIAN_LAB'} = $LINTIAN_LAB;
-
if ($LINTIAN_ARCHIVEDIR) {
$ENV{'LINTIAN_ARCHIVEDIR'} = $LINTIAN_ARCHIVEDIR;
} else {
@@ -448,27 +401,6 @@
$ENV{'LINTIAN_DEBUG'} = $debug;
-# determine requested unpack level
-if (defined($unpack_level)) {
- # specified through command line
-} elsif (defined($LINTIAN_UNPACK_LEVEL)) {
- # specified via configuration file or env variable
- $unpack_level = $LINTIAN_UNPACK_LEVEL;
-} else {
- # determine by action
- if (($action eq 'unpack') or ($action eq 'check')) {
- $unpack_level = 1;
- } else {
- $unpack_level = 0;
- }
-}
-unless (($unpack_level == 0) or ($unpack_level == 1) or ($unpack_level == 2)) {
- fail("bad unpack level $unpack_level specified");
-}
-
-$LINTIAN_UNPACK_LEVEL = $unpack_level;
-$ENV{'LINTIAN_UNPACK_LEVEL'} = $LINTIAN_UNPACK_LEVEL;
-
# }}}
# {{{ Loading lintian's own libraries (now LINTIAN_ROOT is known)
@@ -494,10 +426,8 @@
print "N: $BANNER\n";
print "N: Lintian root directory: $LINTIAN_ROOT\n";
print "N: Configuration file: $LINTIAN_CFG\n";
- print "N: Laboratory: $LINTIAN_LAB\n";
print "N: Archive directory: $LINTIAN_ARCHIVEDIR\n";
print "N: Distribution: $LINTIAN_DIST\n";
- print "N: Default unpack level: $LINTIAN_UNPACK_LEVEL\n";
print "N: Architecture: $LINTIAN_ARCH\n";
print "N: ----\n";
}
@@ -511,51 +441,7 @@
# {{{ Create/Maintain Lab and add any specified Debian Archives (*.debs)
-# sanity check:
-if (($action ne 'setup-lab') and ($lab_mode eq 'static')) {
-
- # LINTIAN_LAB has to exist in this mode
- fail("lintian lab has not been set up correctly (run lintian --setup-lab)")
- unless Lab::is_lab($LINTIAN_LAB);
-}
-
-#######################################
-# Process -S option
-if ($action eq 'setup-lab') {
- if ($#ARGV+1 > 0) {
- print STDERR "warning: ignoring additional command line arguments\n";
- }
-
- if ($lab_mode eq 'temporary') {
- fail("no laboratory specified (need to define LINTIAN_LAB)");
- }
-
- Lab::setup($LINTIAN_LAB, $lab_mode);
-
- # No idea what this is needed here, but it used to be in the code, so I'll
- # leave it untouched for the moment
- Lab::populate_with_dist($LINTIAN_LAB, $LINTIAN_DIST) if $LINTIAN_DIST;
-
- exit 0;
-
-#######################################
-# Process -R option
-} elsif ($action eq 'remove-lab') {
- if ($#ARGV+1 > 0) {
- print STDERR "warning: ignoring additional command line arguments\n";
- }
-
- if ($lab_mode eq 'temporary') {
- fail("no laboratory specified (need to define LINTIAN_LAB)");
- }
-
- Lab::delete($LINTIAN_LAB, $lab_mode);
-
- exit 0;
-
-#######################################
-# Check for non deb specific actions
-} elsif (not (($action eq 'unpack') or ($action eq 'check')
+if ($action ne 'check')
or ($action eq 'remove'))) {
fail("bad action $action specified");
}
@@ -947,18 +833,7 @@
# }}}
-# {{{ Again some lone code the author just dumped where his cursor just happened to be
-if ($unpack_info) {
- # determine which info has been requested
- for my $i (split(/,/,$unpack_info)) {
- unless ($collection_info{$i}) {
- fail("unknown info specified: $i");
- }
- $unpack_infos{$i} = 1;
- }
-}
-
-# create check_abbrev hash
+# {{{ create check_abbrev hash
for my $c (keys %check_info) {
$check_abbrev{$check_info{$c}->{'abbrev'}} = $c;
}
@@ -1078,7 +953,6 @@
printf "N: Processing %d packages...\n",$#packages+1 if $verbose;
if ($debug) {
print "N: Selected action: $action\n";
- print "N: Requested unpack level: $unpack_level\n";
printf "N: Requested data to collect: %s\n",join(',',keys %unpack_infos);
printf "N: Selected checks: %s\n",join(',',keys %checks);
}
@@ -1370,7 +1244,6 @@
exit $exit_code;
# {{{ Some subroutines
-
sub unpack_pkg {
my ($type,$base,$file,$cur_level,$new_level) = @_;
Modified: trunk/lib/Lab.pm
===================================================================
--- trunk/lib/Lab.pm 2004-06-26 23:34:36 UTC (rev 298)
+++ trunk/lib/Lab.pm 2004-06-29 15:21:09 UTC (rev 299)
@@ -1,7 +1,7 @@
# Lab -- Perl laboratory functions for lintian
# $Id$
-# Copyright (C) 1998-2004 Various authors
+# Copyright (C) 2004 Jeroen van Wolffelaar
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -23,6 +23,7 @@
use strict;
use Pipeline;
+use File::Temp ( tempdir );
my $LINTIAN_ROOT = $::LINTIAN_ROOT;
@@ -31,68 +32,32 @@
my $verbose = $::verbose;
my $debug = $::debug;
-sub is_lab {
- my $labdir = shift;
+my $tempdir = undef;
- return -d "$labdir/binary"
- && -d "$labdir/udeb"
- && -d "$labdir/source"
- && -d "$labdir/info";
-}
+sub unpack {
-sub setup {
- my $LINTIAN_LAB = shift;
- my $lab_mode = shift;
+ unless (defined $tempdir) {
+ $tempdir = tempdir("lintian.XXXXXX",
+ TMPDIR => 1, CLEANUP => 1) or
+ die("Couldn't create temporary directory for examining
+ package(s)");
+ }
- print "N: Setting up lab in $LINTIAN_LAB ...\n" if $verbose;
+ my ($type, $package) = @_;
- # create lab directory
- if (not -d "$LINTIAN_LAB" or ($lab_mode eq 'temporary')) {
- # (Note, that the mode 0777 is reduced by the current umask.)
- mkdir($LINTIAN_LAB,0777) or fail("cannot create lab directory $LINTIAN_LAB");
- }
-
- # create base directories
- if (not -d "$LINTIAN_LAB/binary") {
- mkdir("$LINTIAN_LAB/binary",0777) or fail("cannot create lab directory $LINTIAN_LAB/binary");
- }
- if (not -d "$LINTIAN_LAB/source") {
- mkdir("$LINTIAN_LAB/source",0777) or fail("cannot create lab directory $LINTIAN_LAB/source");
- }
- if (not -d "$LINTIAN_LAB/udeb") {
- mkdir("$LINTIAN_LAB/udeb",0777) or fail("cannot create lab directory $LINTIAN_LAB/udeb");
- }
- if (not -d "$LINTIAN_LAB/info") {
- mkdir("$LINTIAN_LAB/info",0777) or fail("cannot create lab directory $LINTIAN_LAB/info");
- }
- # just create empty files
- _touch("$LINTIAN_LAB/info/binary-packages")
- or fail("cannot create binary package list");
- _touch("$LINTIAN_LAB/info/source-packages")
- or fail("cannot create source package list");
- _touch("$LINTIAN_LAB/info/udeb-packages")
- or fail("cannot create udeb package list");
+ if ($type eq 'b' || $type eq 'u') {
+ spawn("$LINTIAN_ROOT/unpack/unpack-binpkg-l1", $tempdir, $file) == 0
+ or die("Failed unpacking $file to level 1");
+ spawn("$LINTIAN_ROOT/unpack/unpack-binpkg-l2", $tempdir, $file) == 0
+ or die("Failed unpacking $file to level 2");
+ } else {
+ spawn("$LINTIAN_ROOT/unpack/unpack-srcpkg-l1", $tempdir, $file) == 0
+ or die("Failed unpacking $file to level 1");
+ spawn("$LINTIAN_ROOT/unpack/unpack-srcpkg-l2", $tempdir, $file) == 0
+ or die("Failed unpacking $file to level 2");
+ }
}
-sub populate_with_dist {
- my $LINTIAN_LAB = shift;
- my $LINTIAN_DIST = shift;
-
- print STDERR "spawning list-binpkg, list-udebpkg and list-srcpkg since LINTIAN_DIST=$LINTIAN_DIST\n" if ($debug >= 2);
-
- my $v = $verbose ? '-v' : '';
-
- spawn("$LINTIAN_ROOT/unpack/list-binpkg",
- "$LINTIAN_LAB/info/binary-packages", $v) == 0
- or fail("cannot create binary package list");
- spawn("$LINTIAN_ROOT/unpack/list-srcpkg",
- "$LINTIAN_LAB/info/source-packages", $v) == 0
- or fail("cannot create source package list");
- spawn("$LINTIAN_ROOT/unpack/list-udebpkg",
- "$LINTIAN_LAB/info/udeb-packages", $v) == 0
- or fail("cannot create udeb package list");
-}
-
# Remove is apparantly some reserved name...
sub delete {
my $LINTIAN_LAB = shift;
@@ -145,16 +110,6 @@
}
}
-# create an empty file
-# --okay, okay, this is not exactly what `touch' does :-)
-sub _touch {
- open(T,">$_[0]") or return 0;
- close(T) or return 0;
-
- return 1;
-}
-
-
1;
# vim: ts=4 sw=4 noet
Reply to: