[devscripts] 01/01: dget: Verify/propagate errors when processing a dsc

James McCoy jamessan at debian.org
Wed Jan 11 04:21:28 UTC 2017


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

jamessan pushed a commit to branch master
in repository devscripts.

commit 67a38dae69c12bf4bfb769dfd0d3970b99f02041
Author: James McCoy <jamessan at debian.org>
Date:   Tue Jan 10 22:10:17 2017 -0500

    dget: Verify/propagate errors when processing a dsc
    
    Check exit status of “dpkg-source -x” fails and use exec to run
    dpkg-buildpackage, so we can properly report failures.
    
    Signed-off-by: James McCoy <jamessan at debian.org>
---
 debian/changelog | 3 +++
 scripts/dget.pl  | 7 +++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 92abad6..6fe077b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,9 @@ devscripts (2.17.0) UNRELEASED; urgency=medium
     + Support debian/clean files.  (Closes: #850662)
   * Remove bash completion for dcut, since src:dput will be providing it.
     (Closes: #850684)
+  * dget:
+    + Verify exit status of “dpkg-source -x” and propagate failure.  (Closes:
+      #850845)
 
  -- Sean Whitton <spwhitton at spwhitton.name>  Mon, 19 Dec 2016 09:51:35 +0000
 
diff --git a/scripts/dget.pl b/scripts/dget.pl
index f090df4..f478240 100755
--- a/scripts/dget.pl
+++ b/scripts/dget.pl
@@ -470,16 +470,19 @@ for my $arg (@ARGV) {
 	    push @cmd, '--no-check' unless $dget_verify;
 	    if ($opt->{'build'}) {
 		my @output = `LC_ALL=C @cmd $found_dsc`;
+		my $rc = $?;
 		print @output unless $opt->{'quiet'};
+		exit $rc >> 8 if $rc >> 8 != 0;
 		foreach (@output) {
 		    if ( /^dpkg-source: (?:info: )?extracting .* in (.*)/ ) {
 			chdir $1;
-			system 'dpkg-buildpackage', '-b', '-uc';
-			last;
+			exec 'dpkg-buildpackage', '-b', '-uc';
+			die "Unable to run dpkg-buildpackage: $!";
 		    }
 		}
 	    } elsif ($dget_unpack) {
 		system @cmd, $found_dsc;
+		exit $? >> 8 if $? >> 8 != 0;
 	    }
 	}
 

-- 
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