[dpkg] 08/27: dpkg-buildpackage: Fix logic to decide whether to call the build targets

Mattia Rizzolo mattia at debian.org
Mon Oct 23 18:10:27 UTC 2017


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

mattia pushed a commit to branch master
in repository dpkg.

commit a3a9527efb1345ac71014dd59da911db05e99ea0
Author: Guillem Jover <guillem at debian.org>
Date:   Tue Oct 17 21:20:53 2017 +0200

    dpkg-buildpackage: Fix logic to decide whether to call the build targets
    
    The build targets never require root, so checking them will always return
    false. We need to key on the binary target instead.
    
    This broke tons of packages that are violating Debian policy MUSTs.
    
    Thanks-to: James Clarke <jrtc27 at debian.org>
    Closes: #878899
---
 debian/changelog             | 3 +++
 scripts/dpkg-buildpackage.pl | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b0d8ca6..fd9c8a8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,8 @@
 dpkg (1.19.1) UNRELEASED; urgency=medium
 
+  * Fix logic in dpkg-buildpackage to decide whether to run build targets,
+    which broke tons of packages that are violating Debian policy MUSTs.
+    Thanks to James Clarke <jrtc27 at debian.org>. Closes: #878899
   * Packaging:
     - Install update-alternatives policykit-1 file.
     - Add Breaks to libdpkg-perl against pkg-kde-tools (<< 0.15.28~), as
diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index affcca8..e7408c2 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -580,7 +580,7 @@ my $build_types = get_build_options_from_type();
 if (build_has_any(BUILD_BINARY)) {
     # If we are building rootless, there is no need to call the build target
     # independently as non-root.
-    run_cmd(@debian_rules, $buildtarget) if rules_requires_root($buildtarget);
+    run_cmd(@debian_rules, $buildtarget) if rules_requires_root($binarytarget);
     run_hook('binary', 1);
     run_rules_cond_root($binarytarget);
 }
@@ -860,7 +860,7 @@ sub build_target_fallback {
 
     # If we are building rootless, there is no need to call the build target
     # independently as non-root.
-    return if not rules_requires_root($buildtarget);
+    return if not rules_requires_root($binarytarget);
 
     return if $buildtarget eq 'build';
     return if scalar @debian_rules != 1;

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