[Reproducible-commits] [dpkg] 48/74: dpkg-buipdpackage: Do not use build target fallback on arch:any + arch:all
Mattia Rizzolo
mattia at debian.org
Sun Jul 3 22:22:56 UTC 2016
This is an automated email from the git hooks/post-receive script.
mattia pushed a commit to annotated tag 1.18.8
in repository dpkg.
commit ad94a98cf614e1c4129f8611080232d69d210a0a
Author: Guillem Jover <guillem at debian.org>
Date: Tue May 31 00:01:53 2016 +0200
dpkg-buipdpackage: Do not use build target fallback on arch:any + arch:all
As part of the transition to make build-indep and build-arch mandatory
and to be able to remove the fallback code without needing a flag day,
we split the transition in chunks. This is the first one which is made
mandatory. More will come.
---
debian/changelog | 2 ++
man/dpkg-buildpackage.1 | 7 ++++---
scripts/dpkg-buildpackage.pl | 15 +++++++++++++++
3 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index e44c420..2745396 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -37,6 +37,8 @@ dpkg (1.18.8) UNRELEASED; urgency=medium
by setting SOURCE_DATE_EPOCH environment variable if it is not already
defined. Based on a patch by Jérémy Bobbio <lunar at debian.org>.
Closes: #759999
+ * Do not use the debian/rules build target fallback when building both
+ architecture independent and dependent packages in dpkg-buipdpackage.
* Perl modules:
- Use warnings::warnif() instead of carp() for deprecated warnings.
- Add new format_range() method and deprecate dpkg() and rfc822() methods
diff --git a/man/dpkg-buildpackage.1 b/man/dpkg-buildpackage.1
index 437a7b2..ffacae0 100644
--- a/man/dpkg-buildpackage.1
+++ b/man/dpkg-buildpackage.1
@@ -496,9 +496,10 @@ by \fBdpkg\-buildflags\fP. This is no longer the case.
\fBdpkg\-buildpackage\fP is using the \fBbuild\-arch\fP and
\fBbuild\-indep\fP targets since dpkg 1.16.2. Those targets are thus
mandatory. But to avoid breakages of existing packages, and ease
-the transition, it will fallback to using the \fBbuild\fP target
-if \fBmake \-f debian/rules \-qn\fP \fIbuild-target\fP returns 2 as
-exit code.
+the transition, if the source package does not build both architecture
+independent and dependent binary packages (since dpkg 1.18.8) it will
+fallback to use the \fBbuild\fP target if \fBmake \-f debian/rules \-qn\fP
+\fIbuild-target\fP returns 2 as exit code.
.SH BUGS
It should be possible to specify spaces and shell metacharacters
and initial arguments for
diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index 21602af..768c59a 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -722,6 +722,21 @@ sub build_target_fallback {
return if $buildtarget eq 'build';
return if scalar @debian_rules != 1;
+ # Check if we are building both arch:all and arch:any packages, in which
+ # case we now require working build-indep and build-arch targets.
+ my $pkg_arch = 0;
+ my $ctrl = Dpkg::Control::Info->new();
+
+ foreach my $bin ($ctrl->get_packages()) {
+ if ($bin->{Architecture} eq 'all') {
+ $pkg_arch |= BUILD_ARCH_INDEP;
+ } else {
+ $pkg_arch |= BUILD_ARCH_DEP;
+ }
+ }
+
+ return if $pkg_arch == BUILD_BINARY;
+
# Check if the build-{arch,indep} targets are supported. If not, fallback
# to build.
my $pid = spawn(exec => [ 'make', '-f', @debian_rules, '-qn', $buildtarget ],
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git
More information about the Reproducible-commits
mailing list