[SCM] Debian package checker branch, master, updated. 2.2.2-4-g8bd1f4b
The following commit has been merged in the master branch:
commit 8bd1f4b50cac543260539e167cbe891728567ae4
Author: Russ Allbery <rra@debian.org>
Date: Tue Feb 3 19:37:46 2009 -0800
Preserve source_version from the previous binary package list
* unpack/list-binpkg:
+ [RA] Preserve the source_version field from the previous list when
adding new packages, remove some dead code, and restructure for
improved readability. Thanks to Jordà Polo for the analysis.
(Closes: #507849)
diff --git a/debian/changelog b/debian/changelog
index adf5239..bf60609 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,12 @@ lintian (2.2.3) UNRELEASED; urgency=low
a wishlist bug against the package would be appropriate, which
seems too strong.
+ * unpack/list-binpkg:
+ + [RA] Preserve the source_version field from the previous list when
+ adding new packages, remove some dead code, and restructure for
+ improved readability. Thanks to Jordà Polo for the analysis.
+ (Closes: #507849)
+
-- Russ Allbery <rra@debian.org> Mon, 02 Feb 2009 09:41:37 -0800
lintian (2.2.2) unstable; urgency=low
diff --git a/unpack/list-binpkg b/unpack/list-binpkg
index 7f519b6..0152a00 100755
--- a/unpack/list-binpkg
+++ b/unpack/list-binpkg
@@ -34,7 +34,6 @@ if ($#ARGV == -1) {
my $verbose = 0;
my $output_file = undef;
-my $pkgdata = undef; # WTF?
while (my $arg = shift) {
if ($arg =~ s,^-,,o) {
@@ -139,12 +138,7 @@ while (!eof(IN)) {
}
if (($status eq 'new') or ($status eq 'changed')) {
- if (defined $pkgdata) {
- # avoid collecting the info twice
- $data = $pkgdata;
- } else {
- $data = &safe_get_deb_info($deb_file);
- }
+ $data = &safe_get_deb_info($deb_file);
next if not defined $data;
$pkg = $data->{'package'};
}
@@ -155,10 +149,13 @@ while (!eof(IN)) {
next;
}
- my $source_version = $data->{'version'};
- if ($data->{'source'} =~ /^([-+\.\w]+)\s+\((.+)\)$/) {
- $data->{'source'} = $1;
- $source_version = $2;
+ unless (exists $data->{'source-version'}) {
+ if ($data->{'source'} =~ /^([-+\.\w]+)\s+\((.+)\)$/) {
+ $data->{'source'} = $1;
+ $data->{'source_version'} = $2;
+ } else {
+ $data->{'source_version'} = $data->{'version'};
+ }
}
# write entry to output file
@@ -166,7 +163,7 @@ while (!eof(IN)) {
$pkg,
$data->{'version'},
$data->{'source'},
- $source_version,
+ $data->{'source_version'},
$deb_file,
$timestamp,
),"\n";
--
Debian package checker
Reply to: