[devscripts] 01/02: debsnap: Fix logic when tracking if given arch had no binary

James McCoy jamessan at debian.org
Sat Oct 1 17:54:04 UTC 2016


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch master
in repository devscripts.

commit f6866b8798eef51ef0bd057788376f89cdc19362
Author: James McCoy <jamessan at debian.org>
Date:   Sat Oct 1 13:28:38 2016 -0400

    debsnap: Fix logic when tracking if given arch had no binary
    
    If a non-desired architecture had multiple binaries for a given version
    (e.g., e2fsck-static on armhf for version 1.42-1), this would confuse
    the code trying to detect when desired architectures didn't have a
    binary.
    
    Ensure that the architecture being filtered is one that we are tracking
    before modifying the tracking data, and change the counting to be how
    many binaries will be downloaded.  Therefore, any architecture with a 0
    count is missing.
    
    Signed-off-by: James McCoy <jamessan at debian.org>
---
 debian/changelog   | 8 ++++++++
 scripts/debsnap.pl | 8 +++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 36b2453..1044e56 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+devscripts (2.16.9) UNRELEASED; urgency=medium
+
+  * debsnap:
+    + Fix "no binaries for given arch" detection so it doesn't download
+      binaries for unspecified archs.  (Closes: #839533)
+
+ -- James McCoy <jamessan at debian.org>  Sat, 01 Oct 2016 13:26:57 -0400
+
 devscripts (2.16.8) unstable; urgency=medium
 
   [ Paul Wise ]
diff --git a/scripts/debsnap.pl b/scripts/debsnap.pl
index 4827246..31cdf81 100755
--- a/scripts/debsnap.pl
+++ b/scripts/debsnap.pl
@@ -301,9 +301,11 @@ elsif ($opt{binary}) {
 	my @results = @{$src_json->{result}};
 	if (@{$opt{architecture}})
 	{
-	    my %archs = map { ($_ => 1) } @{$opt{architecture}};
-	    @results = grep { $archs{$_->{architecture}}-- } @results;
-	    my @missing = grep { $archs{$_} == 1 } sort keys %archs;
+	    my %archs = map { ($_ => 0) } @{$opt{architecture}};
+	    @results = grep {
+	        exists $archs{$_->{architecture}} && ++$archs{$_->{architecture}}
+	    } @results;
+	    my @missing = grep { $archs{$_} == 0 } sort keys %archs;
 	    if (@missing) {
 		warn "$progname: No binary packages found for $package version $version->{binary_version} on " . join(', ', @missing) . "\n";
 		$warnings++;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list