[Reproducible-commits] [dpkg] 82/105: Dpkg::Build::Types: Add new build_has_any function

Niko Tyni ntyni at moszumanska.debian.org
Mon May 2 13:49:55 UTC 2016


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

ntyni pushed a commit to branch ntyni/reproducible_builds
in repository dpkg.

commit dd064b2138478d9a53beefa7a873425d1738e4cb
Author: Guillem Jover <guillem at debian.org>
Date:   Wed Apr 6 17:33:26 2016 +0200

    Dpkg::Build::Types: Add new build_has_any function
    
    Fix regression introduced in commit d122537d6df899dc1d0599e0a24ee3b27f0d9e18.
    
    These instances need to trigger whenever there is any bit set.
---
 scripts/Dpkg/Build/Types.pm  | 19 +++++++++++++++++--
 scripts/dpkg-buildpackage.pl |  4 ++--
 scripts/dpkg-genchanges.pl   |  2 +-
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/scripts/Dpkg/Build/Types.pm b/scripts/Dpkg/Build/Types.pm
index cbefefd..85b4424 100644
--- a/scripts/Dpkg/Build/Types.pm
+++ b/scripts/Dpkg/Build/Types.pm
@@ -27,6 +27,7 @@ our @EXPORT = qw(
     BUILD_ARCH_INDEP
     BUILD_BINARY
     BUILD_FULL
+    build_has_any
     build_has
     build_has_not
     build_is
@@ -103,10 +104,24 @@ my $current_option = undef;
 
 =over 4
 
+=item build_has_any($bits)
+
+Return a boolean indicating whether the current build type has any of the
+specified $bits.
+
+=cut
+
+sub build_has_any
+{
+    my ($bits) = @_;
+
+    return $current_type & $bits;
+}
+
 =item build_has($bits)
 
-Return a boolean indicating whether the current build type has the specified
-$bits.
+Return a boolean indicating whether the current build type has all the
+specified $bits.
 
 =cut
 
diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index cbfce1a..8ad12c8 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -504,7 +504,7 @@ if (build_has(BUILD_SOURCE)) {
     chdir($dir) or syserr("chdir $dir");
 }
 
-run_hook('build', build_has(BUILD_BINARY));
+run_hook('build', build_has_any(BUILD_BINARY));
 
 if ($buildtarget ne 'build' and scalar(@debian_rules) == 1) {
     # Verify that build-{arch,indep} are supported. If not, fallback to build.
@@ -524,7 +524,7 @@ if ($buildtarget ne 'build' and scalar(@debian_rules) == 1) {
     }
 }
 
-if (build_has(BUILD_BINARY)) {
+if (build_has_any(BUILD_BINARY)) {
     withecho(@debian_rules, $buildtarget);
     run_hook('binary', 1);
     withecho(@rootcommand, @debian_rules, $binarytarget);
diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl
index 66c83f0..85778a5 100755
--- a/scripts/dpkg-genchanges.pl
+++ b/scripts/dpkg-genchanges.pl
@@ -289,7 +289,7 @@ if (build_has(BUILD_SOURCE)) {
     $origsrcmsg = g_('binary-only upload (no source code included)');
 }
 
-if (build_has(BUILD_BINARY)) {
+if (build_has_any(BUILD_BINARY)) {
     my $dist_count = 0;
 
     $dist_count = $dist->load($fileslistfile) if -e $fileslistfile;

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