[Reproducible-commits] [dpkg] 08/63: dpkg-genchanges: Check first for build type to short-circuit boolean expressions

Jérémy Bobbio lunar at moszumanska.debian.org
Fri Mar 4 17:44:41 UTC 2016


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

lunar pushed a commit to branch pu/buildinfo
in repository dpkg.

commit 52e7aad6962ddbb4a247b331e3a25597fcf4ce9c
Author: Guillem Jover <guillem at debian.org>
Date:   Sun Jan 31 11:22:17 2016 +0100

    dpkg-genchanges: Check first for build type to short-circuit boolean expressions
    
    This way we reduce the checks to perform on the architectures. And it
    could allow to avoid computing the host architecture when doing source
    only builds.
---
 debian/changelog           |  2 ++
 scripts/dpkg-genchanges.pl | 10 +++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 2f99dcf..d4d364a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,6 +21,8 @@ dpkg (1.18.5) UNRELEASED; urgency=medium
   * Clarify where to find the GPL-2 license in debian/copyright.
   * Do not enable stack-protector on nios2 in Debian and derivatives (it is
     not supported by gcc yet).
+  * Check first for build type to short-circuit boolean expressions in
+    dpkg-genchanges.
   * Perl modules:
     - Add new CTRL_REPO_RELEASE control block type to Dpkg::Control.
     - Add new CTRL_COPYRIGHT_HEADER, CTRL_COPYRIGHT_FILES and
diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl
index e23e52a..e55dc5a 100755
--- a/scripts/dpkg-genchanges.pl
+++ b/scripts/dpkg-genchanges.pl
@@ -330,9 +330,9 @@ foreach my $pkg ($control->get_packages()) {
 
     if (not defined($p2f{$p})) {
 	# No files for this package... warn if it's unexpected
-	if (((debarch_eq('all', $a) and build_has(BUILD_ARCH_INDEP)) ||
-	     ((any { debarch_is($host_arch, $_) } split /\s+/, $a)
-	     and build_has(BUILD_ARCH_DEP))) and
+	if (((build_has(BUILD_ARCH_INDEP) and debarch_eq('all', $a)) or
+	     (build_has(BUILD_ARCH_DEP) and
+	      (any { debarch_is($host_arch, $_) } split /\s+/, $a))) and
 	    (@restrictions == 0 or
 	     evaluate_restriction_formula(\@restrictions, \@profiles)))
 	{
@@ -350,8 +350,8 @@ foreach my $pkg ($control->get_packages()) {
 	} elsif (m/^Priority$/) {
 	    $f2pricf{$_} = $v foreach (@f);
 	} elsif (m/^Architecture$/) {
-	    if ((any { debarch_is($host_arch, $_) } split /\s+/, $v)
-		and build_has(BUILD_ARCH_DEP)) {
+	    if (build_has(BUILD_ARCH_DEP) and
+	        (any { debarch_is($host_arch, $_) } split /\s+/, $v)) {
 		$v = $host_arch;
 	    } elsif (!debarch_eq('all', $v)) {
 		$v = '';

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