[devscripts] 01/02: debuild: Fix calls to dpkg-architecture

James McCoy jamessan at debian.org
Mon Oct 13 01:38:54 UTC 2014


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

jamessan pushed a commit to branch master
in repository devscripts.

commit 4333137fe7c5695e82614177ec7c849fd4e11d1f
Author: James McCoy <jamessan at debian.org>
Date:   Sun Oct 12 21:17:16 2014 -0400

    debuild: Fix calls to dpkg-architecture
    
    When the user didn't supply -a/-t, then we shouldn't pass blank values
    to dpkg-architecture.  Use Dpkg::IPC to call dpkg-architecture for
    better error handling and to avoid using the shell.
    
    Closes: #764963
    Signed-off-by: James McCoy <jamessan at debian.org>
---
 debian/changelog   |  7 +++++++
 scripts/debuild.pl | 17 +++++++++++++----
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 9061248..c5105c3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+devscripts (2.14.9) UNRELEASED; urgency=medium
+
+  * debuild: Only pass -a/-t to dpkg-architecture when the user has specified
+    values for them.  (Closes: #764963)
+
+ -- James McCoy <jamessan at debian.org>  Sun, 12 Oct 2014 21:11:34 -0400
+
 devscripts (2.14.8) unstable; urgency=medium
 
   [ James McCoy ]
diff --git a/scripts/debuild.pl b/scripts/debuild.pl
index fc5fc4e..ffe909c 100755
--- a/scripts/debuild.pl
+++ b/scripts/debuild.pl
@@ -55,6 +55,7 @@ use filetest 'access';
 use Cwd;
 BEGIN { push @INC, '/usr/share/devscripts'; }
 use Devscripts::Compression;
+use Dpkg::IPC;
 use IO::Handle;  # for flushing
 use vars qw(*BUILD *OLDOUT *OLDERR);  # prevent a warning
 
@@ -967,7 +968,17 @@ if ($command_version eq 'dpkg') {
     # to debsign or dpkg-sig
     # Call to dpkg-architecture to set DEB_{BUILD,HOST}_* environment
     # variables
-    foreach (split /\n/, `dpkg-architecture -a${targetarch} -t${targetgnusystem} -f`) {
+    my @dpkgarch = 'dpkg-architecture';
+    if ($targetarch && $targetgnusystem) {
+	push @dpkgarch, "-a${targetarch}", "-t${targetgnusystem}";
+    }
+    push @dpkgarch, '-f';
+
+    my $archinfo;
+    spawn(exec => [@dpkgarch],
+	  to_string => \$archinfo,
+	  wait_child => 1);
+    foreach (split /\n/, $archinfo) {
 	/^(.*)=(.*)$/ and $ENV{$1} = $2;
     }
 
@@ -977,9 +988,7 @@ if ($command_version eq 'dpkg') {
     if ($sourceonly) {
 	$arch = 'source';
     } else {
-	$arch=`dpkg-architecture -a${targetarch} -t${targetgnusystem} -qDEB_HOST_ARCH`;
-	chomp $arch;
-	fatal "couldn't determine host architecture!?" if ! $arch;
+	$arch = $ENV{DEB_HOST_ARCH};
     }
 
     # Handle dpkg source format "3.0 (git)" packages (no tarballs)

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