[SCM] dpkg's main repository branch, master, updated. 1.15.2-20-g48a2039

2009-06-14 Thread Guillem Jover
The following commit has been merged in the master branch:
commit 8e3f26ad2d330da7269e77a097b8eefb3f148e02
Author: Guillem Jover guil...@debian.org
Date:   Sun Jun 14 21:41:24 2009 +0200

dpkg-scanpackages: Properly detect spurious overrides

The detection was being done too late as no overriden information is
kept if the packages is not on the archive.

diff --git a/debian/changelog b/debian/changelog
index 6526f56..f377ec0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ dpkg (1.15.3) UNRELEASED; urgency=low
   [ Guillem Jover ]
   * Unset TAR_OPTIONS when extracting .deb archives. Closes: #530860
   * Use default compressor values in dpkg-source from Dpkg::Source::Compressor.
+  * Fix dpkg-scanpackages to properly detect spurious overrides.
 
   [ Raphael Hertzog ]
   * Unset TAR_OPTIONS when creating/extracting tar archives for source
diff --git a/scripts/dpkg-scanpackages.pl b/scripts/dpkg-scanpackages.pl
index d2189d5..dadf5bd 100755
--- a/scripts/dpkg-scanpackages.pl
+++ b/scripts/dpkg-scanpackages.pl
@@ -14,6 +14,7 @@ use Dpkg::Version qw(compare_versions);
 textdomain(dpkg-dev);
 
 my (@samemaint, @changedmaint);
+my @spuriousover;
 my %packages;
 my %overridden;
 
@@ -85,7 +86,10 @@ sub load_override
 
my ($p, $priority, $section, $maintainer) = split(/\s+/, $_, 4);
 
-   next unless defined($packages{$p});
+   if (not defined($packages{$p})) {
+   push(@spuriousover, $p);
+   next;
+   }
 
for my $package (@{$packages{$p}}) {
if ($maintainer) {
@@ -268,8 +272,6 @@ for my $p (sort keys %packages) {
 }
 close(STDOUT) or syserr(_g(Couldn't close stdout));
 
-my @spuriousover= grep(!defined($packages{$_}),sort keys %overridden);
-
 writelist(_g(** Packages in archive but missing from override file: **),
   @missingover);
 if (@changedmaint) {

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



[SCM] dpkg's main repository branch, master, updated. 1.15.2-20-g48a2039

2009-06-14 Thread Guillem Jover
The following commit has been merged in the master branch:
commit f2d0f89f806829b39629e01016a774f25ef93a01
Author: Guillem Jover guil...@debian.org
Date:   Sun Jun 14 21:43:28 2009 +0200

dpkg-scanpackages: Fix spurious overrides output

Split each package name and indent to the right.

diff --git a/scripts/dpkg-scanpackages.pl b/scripts/dpkg-scanpackages.pl
index dadf5bd..1f626c2 100755
--- a/scripts/dpkg-scanpackages.pl
+++ b/scripts/dpkg-scanpackages.pl
@@ -288,8 +288,8 @@ if (@samemaint) {
 }
 if (@spuriousover) {
 print(STDERR
-  _g( -- Packages in override file but not in archive: --).\n,
-  @spuriousover,
+  _g( -- Packages in override file but not in archive: --). \n  ,
+  join(' ', @spuriousover),
   \n) || die $!;
 }
 

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



[SCM] dpkg's main repository branch, master, updated. 1.15.2-20-g48a2039

2009-06-14 Thread Guillem Jover
The following commit has been merged in the master branch:
commit 7df211874ca2223d8d3e6554ad611ad6ac26e530
Author: Guillem Jover guil...@debian.org
Date:   Mon Jun 15 01:18:02 2009 +0200

dpkg-scanpackages: Move missing override warning near the spurious one

They are related so better to have them closer.

diff --git a/scripts/dpkg-scanpackages.pl b/scripts/dpkg-scanpackages.pl
index fc9d86e..7aa5345 100755
--- a/scripts/dpkg-scanpackages.pl
+++ b/scripts/dpkg-scanpackages.pl
@@ -256,10 +256,6 @@ for my $p (sort keys %packages) {
 }
 close(STDOUT) or syserr(_g(Couldn't close stdout));
 
-if (@missingover) {
-warning(_g(Packages in archive but missing from override file:));
-warning(  %s, join(' ', @missingover));
-}
 if (@changedmaint) {
 warning(_g(Packages in override file with incorrect old maintainer 
value:));
 warning($_) foreach (@changedmaint);
@@ -268,6 +264,10 @@ if (@samemaint) {
 warning(_g(Packages specifying same maintainer as override file:));
 warning($_) foreach (@samemaint);
 }
+if (@missingover) {
+warning(_g(Packages in archive but missing from override file:));
+warning(  %s, join(' ', @missingover));
+}
 if (@spuriousover) {
 warning(_g(Packages in override file but not in archive:));
 warning(  %s, join(' ', @spuriousover));

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



[SCM] dpkg's main repository branch, master, updated. 1.15.2-20-g48a2039

2009-06-14 Thread Guillem Jover
The following commit has been merged in the master branch:
commit d07ecdda8a1af8aeec8bba68fec5b25365e3ae5b
Author: Guillem Jover guil...@debian.org
Date:   Sun Jun 14 20:32:41 2009 +0200

Dpkg::ErrorHandling: Support changing the file handle for info()

Sometimes we need not clutter STDOUT when outputting data there.

diff --git a/scripts/Dpkg/ErrorHandling.pm b/scripts/Dpkg/ErrorHandling.pm
index 6996692..cc6b8fe 100644
--- a/scripts/Dpkg/ErrorHandling.pm
+++ b/scripts/Dpkg/ErrorHandling.pm
@@ -9,6 +9,7 @@ our @EXPORT = qw(report_options info warning error errormsg
 our @EXPORT_OK = qw(report unknown);
 
 my $quiet_warnings = 0;
+my $info_fh = \*STDOUT;
 
 sub report_options
 {
@@ -17,6 +18,9 @@ sub report_options
 if (exists $options{quiet_warnings}) {
 $quiet_warnings = $options{quiet_warnings};
 }
+if (exists $options{info_fh}) {
+$info_fh = $options{info_fh};
+}
 }
 
 sub report(@)
@@ -29,7 +33,7 @@ sub report(@)
 
 sub info($;@)
 {
-print report(_g(info), @_) if (!$quiet_warnings);
+print $info_fh report(_g(info), @_) if (!$quiet_warnings);
 }
 
 sub warning($;@)

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



[SCM] dpkg's main repository branch, master, updated. 1.15.2-20-g48a2039

2009-06-14 Thread Guillem Jover
The following commit has been merged in the master branch:
commit b299dad5ad3eb8bbcf75b0891f87744399e75574
Author: Guillem Jover guil...@debian.org
Date:   Sun Jun 14 19:57:05 2009 +0200

Dpkg::ErrorHandling: Add new report_options()

Set report options via this new function instead of directly exporting
private variables.

diff --git a/scripts/Dpkg/ErrorHandling.pm b/scripts/Dpkg/ErrorHandling.pm
index 877663e..6996692 100644
--- a/scripts/Dpkg/ErrorHandling.pm
+++ b/scripts/Dpkg/ErrorHandling.pm
@@ -4,11 +4,20 @@ use Dpkg;
 use Dpkg::Gettext;
 
 use base qw(Exporter);
-our @EXPORT = qw(info warning error errormsg
+our @EXPORT = qw(report_options info warning error errormsg
  syserr internerr subprocerr usageerr syntaxerr);
-our @EXPORT_OK = qw(report unknown $quiet_warnings);
+our @EXPORT_OK = qw(report unknown);
 
-our $quiet_warnings = 0;
+my $quiet_warnings = 0;
+
+sub report_options
+{
+my (%options) = @_;
+
+if (exists $options{quiet_warnings}) {
+$quiet_warnings = $options{quiet_warnings};
+}
+}
 
 sub report(@)
 {
diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl
index b461a3a..03cf0b5 100755
--- a/scripts/dpkg-source.pl
+++ b/scripts/dpkg-source.pl
@@ -6,7 +6,7 @@ use warnings;
 
 use Dpkg;
 use Dpkg::Gettext;
-use Dpkg::ErrorHandling qw(:DEFAULT unknown $quiet_warnings);
+use Dpkg::ErrorHandling qw(:DEFAULT unknown);
 use Dpkg::Arch qw(debarch_eq);
 use Dpkg::Deps qw(@src_dep_fields %dep_field_type);
 use Dpkg::Fields qw(:list capit);
@@ -115,7 +115,7 @@ while (@ARGV  $ARGV[0] =~ m/^-/) {
 # Deprecated option
 warning(_g(-E and -W are deprecated, they are without effect));
 } elsif (m/^-q$/) {
-$quiet_warnings = 1;
+report_options(quiet_warnings = 1);
 $options{'quiet'} = 1;
 } elsif (m/^--$/) {
 last;
diff --git a/scripts/t/100_Dpkg_Version.t b/scripts/t/100_Dpkg_Version.t
index c98565f..5d3beed 100644
--- a/scripts/t/100_Dpkg_Version.t
+++ b/scripts/t/100_Dpkg_Version.t
@@ -1,13 +1,13 @@
 # -*- mode: cperl;-*-
 
 use Test::More;
-use Dpkg::ErrorHandling qw($quiet_warnings);
-
-$quiet_warnings = 1;
+use Dpkg::ErrorHandling;
 
 use strict;
 use warnings;
 
+report_options(quiet_warnings = 1);
+
 my @tests = DATA;
 my @ops = (, , lt,
   =, le,
diff --git a/scripts/t/300_Dpkg_BuildOptions.t 
b/scripts/t/300_Dpkg_BuildOptions.t
index dc43acd..ca1838d 100644
--- a/scripts/t/300_Dpkg_BuildOptions.t
+++ b/scripts/t/300_Dpkg_BuildOptions.t
@@ -1,6 +1,7 @@
 # -*- mode: cperl;-*-
 
 use Test::More tests = 6;
+use Dpkg::ErrorHandling;
 
 use strict;
 use warnings;
@@ -11,7 +12,7 @@ use_ok('Dpkg::BuildOptions');
 no warnings;
 # Disable warnings related to invalid values fed during
 # the tests
-$Dpkg::ErrorHandling::quiet_warnings = 1;
+report_options(quiet_warnings = 1);
 }
 
 $ENV{DEB_BUILD_OPTIONS} = 'noopt foonostripbar parallel=3 bazNOCHECK';

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



[SCM] dpkg's main repository branch, master, updated. 1.15.2-20-g48a2039

2009-06-14 Thread Guillem Jover
The following commit has been merged in the master branch:
commit 288aa90e881c1aaa8ddacdeeed8a5631142ffe67
Author: Guillem Jover guil...@debian.org
Date:   Sun Jun 14 19:02:55 2009 +0200

Dpkg::ErrorHandling: Remove unused warnerror() and $warnable_error

Do not pass over -W and -E from dpkg-buildpackage to dpkg-source anymore
and warn directly about its deprecated status.

diff --git a/scripts/Dpkg/ErrorHandling.pm b/scripts/Dpkg/ErrorHandling.pm
index 968ced1..877663e 100644
--- a/scripts/Dpkg/ErrorHandling.pm
+++ b/scripts/Dpkg/ErrorHandling.pm
@@ -4,11 +4,10 @@ use Dpkg;
 use Dpkg::Gettext;
 
 use base qw(Exporter);
-our @EXPORT = qw(info warning warnerror error errormsg
+our @EXPORT = qw(info warning error errormsg
  syserr internerr subprocerr usageerr syntaxerr);
-our @EXPORT_OK = qw(report unknown $warnable_error $quiet_warnings);
+our @EXPORT_OK = qw(report unknown $quiet_warnings);
 
-our $warnable_error = 1;
 our $quiet_warnings = 0;
 
 sub report(@)
@@ -29,15 +28,6 @@ sub warning($;@)
 warn report(_g(warning), @_) if (!$quiet_warnings);
 }
 
-sub warnerror(@)
-{
-if ($warnable_error) {
-   warning(@_);
-} else {
-   error(@_);
-}
-}
-
 sub syserr($;@)
 {
 my $msg = shift;
diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index ba751b3..bdab775 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -9,7 +9,7 @@ use POSIX;
 
 use Dpkg;
 use Dpkg::Gettext;
-use Dpkg::ErrorHandling qw(:DEFAULT $warnable_error);
+use Dpkg::ErrorHandling;
 use Dpkg::BuildOptions;
 use Dpkg::Compression;
 use Dpkg::Version qw(check_version);
@@ -71,8 +71,6 @@ Options:
   -ncdo not clean source tree (implies -b).
   -tcclean source tree when finished.
   -apadd pause before starting signature process.
-  -E turn certain warnings into errors.   } passed to
-  -W when -E is turned on, -W turns it off.   } dpkg-source
   -i[regex]ignore diffs of files matching regex.} only passed
   -I[pattern]  filter out files when building tarballs. } to dpkg-source
   --admindir=directory
@@ -186,12 +184,9 @@ while (@ARGV) {
$changedby = $1;
 } elsif (/^-C(.*)$/) {
$desc = $1;
-} elsif (/^-W$/) {
-   $warnable_error = 1;
-   push @passopts, '-W';
-} elsif (/^-E$/) {
-   $warnable_error = 0;
-   push @passopts, '-E';
+} elsif (m/^-[EW]$/) {
+   # Deprecated option
+   warning(_g(-E and -W are deprecated, they are without effect));
 } elsif (/^-R(.*)$/) {
@debian_rules = split /\s+/, $1;
 } else {

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



[SCM] dpkg's main repository branch, master, updated. 1.15.2-20-g48a2039

2009-06-14 Thread Guillem Jover
The following commit has been merged in the master branch:
commit 1c18298e7510ffb2dab453293528ecd219d6a2b2
Author: Guillem Jover guil...@debian.org
Date:   Sun Jun 14 20:34:22 2009 +0200

dpkg-scanpackages: Use info instead of ad-hoc printing

Redirect it to STDERR to not pollute STDOUT where the Packages file is
being outputted.

diff --git a/scripts/dpkg-scanpackages.pl b/scripts/dpkg-scanpackages.pl
index 7aa5345..207271f 100755
--- a/scripts/dpkg-scanpackages.pl
+++ b/scripts/dpkg-scanpackages.pl
@@ -13,6 +13,9 @@ use Dpkg::Version qw(compare_versions);
 
 textdomain(dpkg-dev);
 
+# Do not pollute STDOUT with info messages
+report_options(info_fh = \*STDERR);
+
 my (@samemaint, @changedmaint);
 my @spuriousover;
 my %packages;
@@ -273,4 +276,5 @@ if (@spuriousover) {
 warning(  %s, join(' ', @spuriousover));
 }
 
-printf(STDERR _g( Wrote %s entries to output Packages file.).\n, 
$records_written) || die $!;
+info(_g(Wrote %s entries to output Packages file.), $records_written);
+

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



[SCM] dpkg's main repository branch, master, updated. 1.15.2-20-g48a2039

2009-06-14 Thread Guillem Jover
The following commit has been merged in the master branch:
commit 48a20395d3406b655844057315868748dceada2d
Author: Guillem Jover guil...@debian.org
Date:   Mon Jun 15 02:19:12 2009 +0200

dpkg-scanpackages: Mark string for translation

diff --git a/scripts/dpkg-scanpackages.pl b/scripts/dpkg-scanpackages.pl
index 207271f..9c83356 100755
--- a/scripts/dpkg-scanpackages.pl
+++ b/scripts/dpkg-scanpackages.pl
@@ -102,7 +102,8 @@ sub load_override
my $debmaint = $$package{Maintainer};
if (!grep($debmaint eq $_, split(m:\s*//\s*:, $oldmaint))) {
push(@changedmaint,
-  $p (package says $$package{Maintainer}, not 
$oldmaint));
+sprintf(_g(  %s (package says %s, not %s)),
+$p, $$package{Maintainer}, $oldmaint));
} else {
$$package{Maintainer} = $newmaint;
}

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org