Package: devscripts
Version: 2.15.9
Severity: normal
Tags: patch

I'm using debuild -S to create a source package. debuild calls
dpkg-architecture, which in turn tries to call gcc and shows an error.
I shouldn't need gcc to build a source package.

The variables set by dpkg-architecture aren't used in a sourceonly build, so
the call to dpkg-architecture should be inside the block that uses its
results.

See attached patch.

-- Package-specific info:

--- /etc/devscripts.conf ---

--- ~/.devscripts ---
DSCVERIFY_KEYRINGS=~/.gnupg/pubring.gpg
DEBSIGN_KEYID=$DEBEMAIL
DEBUILD_LINTIAN_OPTS="-I --show-overrides"
DEBUILD_PRESERVE_ENVVARS=http_proxy,no_proxy
DEBCHANGE_PRESERVE=yes

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (700, 'testing'), (600, 'unstable'), (500, 'testing-updates'), 
(500, 'testing-proposed-updates'), (500, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.3.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_CA.utf8, LC_CTYPE=en_CA.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages devscripts depends on:
ii  dpkg-dev     1.18.4
ii  libc6        2.21-6
ii  perl         5.22.1-3
ii  python3      3.4.3-7
pn  python3:any  <none>

Versions of packages devscripts recommends:
ii  at                          3.1.18-2
ii  curl                        7.46.0-1
ii  dctrl-tools                 2.24-1
ii  debian-keyring              2015.11.30
ii  dput                        0.9.6.4
ii  equivs                      2.0.9+nmu1
ii  fakeroot                    1.20.2-1
ii  file                        1:5.25-2
ii  gnupg                       1.4.20-1
ii  libdistro-info-perl         0.14
ii  libencode-locale-perl       1.05-1
ii  libjson-perl                2.90-1
ii  liblwp-protocol-https-perl  6.06-2
ii  libsoap-lite-perl           1.19-1
ii  liburi-perl                 1.69-1
ii  libwww-perl                 6.15-1
ii  lintian                     2.5.39.1
ii  man-db                      2.7.5-1
ii  patch                       2.7.5-1
ii  patchutils                  0.3.4-1
ii  python3-debian              0.1.27
ii  python3-magic               1:5.25-2
ii  sensible-utils              0.0.9
ii  strace                      4.10-3
ii  unzip                       6.0-20
ii  wdiff                       1.2.2-1+b1
ii  wget                        1.17.1-1
ii  xz-utils                    5.1.1alpha+20120614-2.1

Versions of packages devscripts suggests:
ii  bsd-mailx [mailx]            8.1.2-0.20150408cvs-1
ii  build-essential              11.7
pn  cvs-buildpackage             <none>
pn  debbindiff                   <none>
pn  devscripts-el                <none>
pn  gnuplot                      <none>
ii  gpgv                         1.4.20-1
ii  libauthen-sasl-perl          2.1600-1
ii  libfile-desktopentry-perl    0.22-1
ii  libnet-smtp-ssl-perl         1.03-1
pn  libterm-size-perl            <none>
ii  libtimedate-perl             2.3000-2
pn  libyaml-syck-perl            <none>
ii  mutt                         1.5.24-1
ii  openssh-client [ssh-client]  1:7.1p1-5
ii  svn-buildpackage             0.8.5+nmu1
ii  w3m                          0.5.3-26

-- no debconf information
>From 30c8bf741fe0eee1309ff74463314a00e4b0846a Mon Sep 17 00:00:00 2001
From: Neil Mayhew <neil_may...@sil.org>
Date: Mon, 11 Jan 2016 17:15:41 -0700
Subject: [PATCH] Don't call dpkg-architecture unless it's necessary

---
 scripts/debuild.pl | 37 +++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/scripts/debuild.pl b/scripts/debuild.pl
index 5776198..bacc39e 100755
--- a/scripts/debuild.pl
+++ b/scripts/debuild.pl
@@ -957,24 +957,7 @@ if ($command_version eq 'dpkg') {
     # results $pkg and $version
     # mustsetvar maintainer is only needed for signing, so we leave that
     # to debsign or dpkg-sig
-    # Call to dpkg-architecture to set DEB_{BUILD,HOST}_* environment
-    # variables
-    my @dpkgarch = 'dpkg-architecture';
-    if ($targetarch) {
-	push @dpkgarch, "-a${targetarch}";
-    }
-    if ($targetgnusystem) {
-	push @dpkgarch, "-t${targetgnusystem}";
-    }
-    push @dpkgarch, '-f';
-
-    my $archinfo;
-    spawn(exec => [@dpkgarch],
-	  to_string => \$archinfo,
-	  wait_child => 1);
-    foreach (split /\n/, $archinfo) {
-	/^(.*)=(.*)$/ and $ENV{$1} = $2;
-    }
+    # Set architecture
 
     # We need to do the arch, pv, pva stuff to figure out
     # what the changes file will be called,
@@ -984,6 +967,24 @@ if ($command_version eq 'dpkg') {
     } elsif ($binarytarget eq 'binary-indep') {
 	$arch = 'all';
     } else {
+	# Call dpkg-architecture to set DEB_{BUILD,HOST}_* environment
+	# variables
+	my @dpkgarch = 'dpkg-architecture';
+	if ($targetarch) {
+	    push @dpkgarch, "-a${targetarch}";
+	}
+	if ($targetgnusystem) {
+	    push @dpkgarch, "-t${targetgnusystem}";
+	}
+	push @dpkgarch, '-f';
+
+	my $archinfo;
+	spawn(exec => [@dpkgarch],
+	      to_string => \$archinfo,
+	      wait_child => 1);
+	foreach (split /\n/, $archinfo) {
+	    /^(.*)=(.*)$/ and $ENV{$1} = $2;
+	}
 	$arch = $ENV{DEB_HOST_ARCH};
     }
 
-- 
2.6.4

Reply via email to