[SCM] Debian package checker branch, master, updated. 2.5.4-125-g2030978

2012-01-31 Thread Niels Thykier
The following commit has been merged in the master branch:
commit 20309781366fbe0bfc73a566bb5d07a5ef5a2b97
Author: Niels Thykier ni...@thykier.net
Date:   Tue Jan 31 21:48:33 2012 +0100

html_reports: Index only source packages in packages_$i.html

This reduces the amount of packages in each packages_$i.html a
bit.

Signed-off-by: Niels Thykier ni...@thykier.net

diff --git a/debian/changelog b/debian/changelog
index eeafd60..0568368 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -243,6 +243,7 @@ lintian (2.5.5) UNRELEASED; urgency=low
   Lintian::Profile.
 + [NT] Pass a profile to the templates (as $profile) instead of the
   old %all hash.
++ [NT] List only source packages on the packages_X.html pages.
   * reporting/templates/tags-all.tmpl:
 + [NT] Use $profile instead of the %all hash.
 
diff --git a/reporting/html_reports b/reporting/html_reports
index 36f8269..6661387 100755
--- a/reporting/html_reports
+++ b/reporting/html_reports
@@ -333,7 +333,7 @@ undef $source_info;
 # a summary page of errors and warnings for each maintainer, output a full
 # page that includes info, experimental, and overriden tags, and assemble the
 # maintainer index and the QA package list as we go.
-my (%qa, %maintainers, %packages);
+my (%qa, %maintainers, %sources);
 my @maintainers;
 {
 my %unique;
@@ -355,7 +355,9 @@ for my $maintainer (@maintainers) {
 my $tags = $by_maint{$maintainer}{$source}{$version};
 for my $tag (@$tags) {
 $count{$tag-{code}}++;
-$packages{$tag-{package}} = $tag-{xref};
+}
+if (@$tags) {
+$sources{$source} = $tags-[0]-{xref};
 }
 }
 $qa{$source} = \%count;
@@ -506,7 +508,7 @@ $list{'0-9, A-F'} = [];
 $list{'G-L'}  = [];
 $list{'M-R'}  = [];
 $list{'S-Z'}  = [];
-for my $package (sort keys %packages) {
+for my $package (sort keys %sources) {
 my $first = uc substr($package, 0, 1);
 if($first le 'F') { push(@{ $list{'0-9, A-F'} }, $package) }
 elsif ($first le 'L') { push(@{ $list{'G-L'} },  $package) }
@@ -514,7 +516,7 @@ for my $package (sort keys %packages) {
 else  { push(@{ $list{'S-Z'} },  $package) }
 }
 %data = (
-packages  = \%packages,
+sources = \%sources,
 );
 my $i = 1;
 for my $section (sort keys %list) {
diff --git a/reporting/templates/packages.tmpl 
b/reporting/templates/packages.tmpl
index 31c6ef2..db67979 100644
--- a/reporting/templates/packages.tmpl
+++ b/reporting/templates/packages.tmpl
@@ -2,7 +2,7 @@
   h1Package Index: {$section}/h1
 
   p
-This is a list of all source or binary packages that have at least one
+This is a list of all source packages that have at least one
 lintian tag.  This includes all tags, even experimental and info tags
 and tags that were overridden.  The list is huge, so it's broken into
 four separate pages.  This page covers package names starting with
@@ -26,7 +26,7 @@
 $OUT .= qq(  h2$first/h2\n\n  p\n);
 $letter = $first;
 }
-$OUT .= qq(a href=full/$packages{$package}$package/a\n);
+$OUT .= qq(a href=full/$sources{$package}$package/a\n);
 }
 }  /p
 { foot() }

-- 
Debian package checker


-- 
To UNSUBSCRIBE, email to debian-lint-maint-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/e1rskss-0001ja...@vasks.debian.org



[SCM] Debian package checker branch, master, updated. 2.5.4-126-gaa5f668

2012-01-31 Thread Niels Thykier
The following commit has been merged in the master branch:
commit aa5f668165f8702e9912e467a5c9a04580702d32
Author: Niels Thykier ni...@thykier.net
Date:   Wed Feb 1 00:06:17 2012 +0100

harness: Use Getopt::Long for cmd args and add --help

Migrate to Getopt::Long - this means all frontends (that parse
arguments) all use the same option parser.

Add --help/-h for consistency with the other frontends and because
otherwise you would have to give invalid arguments to get usage info.

Signed-off-by: Niels Thykier ni...@thykier.net

diff --git a/debian/changelog b/debian/changelog
index 0568368..5c52296 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -235,6 +235,7 @@ lintian (2.5.5) UNRELEASED; urgency=low
 
   * reporting/harness:
 + [NT] Removed useless TODO message from the log output.
++ [NT] Added -h/--help option to print usage information.
   * reporting/html_reports:
 + [JW] Properly handle uploader names with commas.
 + [NT] Use the severities from profiles when generating tag pages.
diff --git a/reporting/harness b/reporting/harness
index 3109bc9..3475625 100755
--- a/reporting/harness
+++ b/reporting/harness
@@ -21,18 +21,18 @@
 # MA 02110-1301, USA.
 
 use strict;
-use Getopt::Std;
+use Getopt::Long;
 
-use vars qw($opt_c $opt_f $opt_i $opt_r);
-unless (getopts('cfir')) {
+
+sub usage {
   print END;
 Lintian reporting harness
 Create and maintain Lintian reports automatically
 
-Usage: harness [ -i | -c [-f] ] [ -r ]
+Usage: harness [ -i | -f | -r | -c ]
 
 Options:
-  -cclean mode, erase everything and start from scratch
+  -cclean mode, erase everything and start from scratch (implies -f)
   -ffull mode, blithely overwrite lintian.log
   -iincremental mode, use old lintian.log data, process changes only
   -rgenerate HTML reports only
@@ -46,9 +46,31 @@ END
   exit;
 }
 
-die 'Cannot use both incremental and full/clean.' if ($opt_i  ($opt_f || 
$opt_c));
-$opt_f = 1 if $opt_c;
-die 'Cannot use other modes with reports only.' if ($opt_r  ($opt_i || 
$opt_f || $opt_c));
+my %opt = ();
+
+my %opthash = (
+'i' = \$opt{'incremental-mode'},
+'c' = \$opt{'clean-mode'},
+'f' = \$opt{'full-mode'},
+'r' = \$opt{'reports-only'},
+'help|h' = \usage,
+);
+
+# init commandline parser
+Getopt::Long::config('bundling', 'no_getopt_compat', 'no_auto_abbrev');
+
+# process commandline options
+GetOptions(%opthash)
+or die(error parsing options\n);
+
+# clean implies full - do this as early as possible, so we can just
+# check $opt{'full-mode'} rather than a full
+#   ($opt{'clean-mode'} || $opt{'full-mode'})
+$opt{'full-mode'} = 1 if $opt{'clean-mode'};
+
+die Cannot use both incremental and full/clean.\n if 
$opt{'incremental-mode'}  $opt{'full-mode'};
+die Cannot use other modes with reports only.\n
+if $opt{'reports-only'}  ($opt{'full-mode'} || $opt{'incremental-mode'});
 
 # read configuration
 require './config';
@@ -105,21 +127,21 @@ if ($LINTIAN_GPG_CHECK) {
 my $LAB = Lintian::Lab-new ($LINTIAN_LAB);
 
 # purge the old packages
-$LAB-remove if $opt_c;
+$LAB-remove if $opt{'clean-mode'};
 
 $LAB-create ({ 'mode' = 02775}) unless $LAB-exists;
 
-unless ($opt_f || $opt_c) {
-  unless ($opt_r) {
+if (!$opt{'reports-only'}  !$opt{'full-mode'}  !$opt{'incremental-mode'}) {
+# Nothing explicitly chosen, default to -i if the log is present,
+# otherwise -f.
 if (-f $lintian_log) {
-  $opt_i = 1;
+$opt{'incremental-mode'} = 1;
 } else {
-  $opt_f = 1;
+$opt{'full-mode'} = 1;
 }
-  }
 }
 
-unless ($opt_r) {
+unless ($opt{'reports-only'}) {
 $LAB-open;
 my @manifests = local_mirror_manifests ($LINTIAN_ARCHIVEDIR, [_trim_split 
($LINTIAN_DIST)],
 [_trim_split ($LINTIAN_AREA)], 
[_trim_split ($LINTIAN_ARCH)]);
@@ -193,7 +215,7 @@ unless ($opt_r) {
 # Flushes the changed manifest to the file system - croaks on error
 $LAB-close;
 
-if ($opt_i) {
+if ($opt{'incremental-mode'}) {
 # Extra work for the incremental run
 
 die Old Lintian log file $lintian_log not found!\n unless -f 
$lintian_log;

-- 
Debian package checker


-- 
To UNSUBSCRIBE, email to debian-lint-maint-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/e1rsmqc-0005d8...@vasks.debian.org



[SCM] Debian package checker branch, master, updated. 2.5.4-127-g8120b29

2012-01-31 Thread Niels Thykier
The following commit has been merged in the master branch:
commit 8120b29f173100802984b6a69ab1c62edf50d9cd
Author: Niels Thykier ni...@thykier.net
Date:   Wed Feb 1 01:04:43 2012 +0100

harness: Added --dry-run option

Signed-off-by: Niels Thykier ni...@thykier.net

diff --git a/debian/changelog b/debian/changelog
index 5c52296..c59b729 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -236,6 +236,7 @@ lintian (2.5.5) UNRELEASED; urgency=low
   * reporting/harness:
 + [NT] Removed useless TODO message from the log output.
 + [NT] Added -h/--help option to print usage information.
++ [NT] Added --dry-run option.
   * reporting/html_reports:
 + [JW] Properly handle uploader names with commas.
 + [NT] Use the severities from profiles when generating tag pages.
diff --git a/reporting/harness b/reporting/harness
index 3475625..c365fd5 100755
--- a/reporting/harness
+++ b/reporting/harness
@@ -32,10 +32,13 @@ Create and maintain Lintian reports automatically
 Usage: harness [ -i | -f | -r | -c ]
 
 Options:
-  -cclean mode, erase everything and start from scratch (implies -f)
-  -ffull mode, blithely overwrite lintian.log
-  -iincremental mode, use old lintian.log data, process changes only
-  -rgenerate HTML reports only
+  -c clean mode, erase everything and start from scratch (implies -f)
+  -f full mode, blithely overwrite lintian.log
+  -i incremental mode, use old lintian.log data, process changes only
+  -r generate HTML reports only
+  --dry-run  pretend to do the actions without actually doing them.  The
+ normal harness output will go to stdout rather than the
+ harness.log.
 
 Incremental mode is the default if you have a lintian.log;
 otherwise, it's full.
@@ -53,6 +56,7 @@ my %opthash = (
 'c' = \$opt{'clean-mode'},
 'f' = \$opt{'full-mode'},
 'r' = \$opt{'reports-only'},
+'dry-run' = \$opt{'dry-run'},
 'help|h' = \usage,
 );
 
@@ -102,34 +106,57 @@ require Lintian::Processable::Package;
 # turn file buffering off
 $| = 1;
 
-# rotate log files
-system(savelog $log_file $changes_file $list_file $html_reports_log 
/dev/null) == 0
-or Die('cannot rotate log files');
+unless ($opt{'dry-run'}) {
+# rotate log files
+system(savelog $log_file $changes_file $list_file $html_reports_log 
/dev/null) == 0
+or Die('cannot rotate log files');
 
-# create new log file
-open(LOG, '', $log_file)
-or Die(cannot open log file $log_file for writing: $!);
+# create new log file
+open(LOG, '', $log_file)
+or Die(cannot open log file $log_file for writing: $!);
+} else {
+$log_file = \*STDOUT{IO};
+Log('Running in dry-run mode');
+}
 
-system(mkdir -p -m 775 $LINTIAN_BIN_DIR) == 0 || die $!;
-$ENV{'PATH'} = $LINTIAN_BIN_DIR . ':' . $ENV{'PATH'};
+unless ($opt{'dry-run'}) {
+system(mkdir -p -m 775 $LINTIAN_BIN_DIR) == 0 || die $!;
 
-if ($LINTIAN_GPG_CHECK) {
-  if (-l $LINTIAN_BIN_DIR . '/gpg') {
-unlink($LINTIAN_BIN_DIR . '/gpg');
-  } else {
-rename($LINTIAN_BIN_DIR . '/gpg', $LINTIAN_BIN_DIR . '/gpg.bkp');
-  }
-} else {
-  symlink '/bin/true', $LINTIAN_BIN_DIR . '/gpg'
-unless(-f $LINTIAN_BIN_DIR . '/gpg');
+if ($LINTIAN_GPG_CHECK) {
+if (-l $LINTIAN_BIN_DIR . '/gpg') {
+unlink($LINTIAN_BIN_DIR . '/gpg');
+} else {
+rename($LINTIAN_BIN_DIR . '/gpg', $LINTIAN_BIN_DIR . '/gpg.bkp');
+}
+} else {
+symlink '/bin/true', $LINTIAN_BIN_DIR . '/gpg'
+unless(-f $LINTIAN_BIN_DIR . '/gpg');
+}
 }
 
+$ENV{'PATH'} = $LINTIAN_BIN_DIR . ':' . $ENV{'PATH'};
+
+
 my $LAB = Lintian::Lab-new ($LINTIAN_LAB);
 
-# purge the old packages
-$LAB-remove if $opt{'clean-mode'};
+unless ($opt{'dry-run'}) {
+# purge the old packages
+$LAB-remove if $opt{'clean-mode'};
 
-$LAB-create ({ 'mode' = 02775}) unless $LAB-exists;
+$LAB-create ({ 'mode' = 02775}) unless $LAB-exists;
+} else {
+if (! $LAB-exists || $opt{'clean-mode'}) {
+# We either do not have a lab or we were asked to clean
+# the existing one.  We solve this by creating a temp
+# lab (which will be empty).  This means that A) the lab
+# will appear to be empty (as expected by clean-mode) and
+# B) that we do not have to do a dry-run check on every
+# read-only lab operation (we still have to guard write
+# operations).
+$LAB = Lintian::Lab-new;
+$LAB-create;
+}
+}
 
 if (!$opt{'reports-only'}  !$opt{'full-mode'}  !$opt{'incremental-mode'}) {
 # Nothing explicitly chosen, default to -i if the log is present,
@@ -165,7 +192,7 @@ unless ($opt{'reports-only'}) {
 if ($entry) {
 my $arch = '';
 $arch =  [$pkg_arch] if $pkg_arch;
-if ($entry-remove) {
+if ($opt{'dry-run'} || $entry-remove) {
 Log (Removed $type $pkg_name 

Bug#658210: lintian: update-alternatives --install/--remove should only be used in pairs

2012-01-31 Thread Andreas Beckmann
Package: lintian
Version: 2.5.4
Severity: wishlist

Hi,

update-alternatives should only be used in pairs.
Usually postinst will register an alternative with
update-alternatives --install ...
There should be a corresponding
update-alternatives --remove ...
in prerm (postrm would be ok, too, but leaves a short period of
breakage where the alternative is dangling).

There are currently about 15 packages in sid that forget to remove the
alternative on package removal.

It would be nice if lintian could check for having matching pairs of
this command. A package may register multiple alternatives - and all
should be removed. Removing obsolete alternatives in preinst/postinst
should not be accounted for.

There are some packages that do a bit of magic using alternatives,
e.g. glx-alternatives [source, contrib], nvidia-alternative [binary,
non-free] and may produce false positives in such a check.


Andreas



-- 
To UNSUBSCRIBE, email to debian-lint-maint-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/20120201012413.3166.54311.report...@cake.ae.cs.uni-frankfurt.de