[Reproducible-commits] [dpkg] 01/04: Use Dpkg::Build::Types module instead of ad-hoc code

Niko Tyni ntyni at moszumanska.debian.org
Mon May 2 21:32:44 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 86e6a2656c6e815de1dcdb848257e2ddd91d9520
Author: Niko Tyni <ntyni at debian.org>
Date:   Mon May 2 22:23:19 2016 +0300

    Use Dpkg::Build::Types module instead of ad-hoc code
    
    This is a follow-up to d122537d6df899dc1d0599e0a24ee3b27f0d9e18.
---
 scripts/dpkg-genbuildinfo.pl | 30 +++---------------------------
 1 file changed, 3 insertions(+), 27 deletions(-)

diff --git a/scripts/dpkg-genbuildinfo.pl b/scripts/dpkg-genbuildinfo.pl
index 8062434..77e6f45 100755
--- a/scripts/dpkg-genbuildinfo.pl
+++ b/scripts/dpkg-genbuildinfo.pl
@@ -33,6 +33,7 @@ use Dpkg::Gettext;
 use Dpkg::Checksums;
 use Dpkg::ErrorHandling;
 use Dpkg::Arch qw(get_build_arch);
+use Dpkg::Build::Types;
 use Dpkg::BuildFlags;
 use Dpkg::BuildProfiles qw(get_build_profiles);
 use Dpkg::Control::Info;
@@ -60,31 +61,6 @@ my $checksums = Dpkg::Checksums->new();
 my %archadded;
 my @archvalues;
 
-use constant BUILD_ARCH_DEP   => 1;
-use constant BUILD_ARCH_INDEP => 2;
-use constant BUILD_ALL        => BUILD_ARCH_DEP | BUILD_ARCH_INDEP;
-my $include = BUILD_ALL;
-
-sub build_is_default() { return ($include & BUILD_ALL) == BUILD_ALL; }
-sub build_opt {
-    if ($include == BUILD_ARCH_DEP) {
-        return '-B';
-    } elsif ($include == BUILD_ARCH_INDEP) {
-        return '-A';
-    } else {
-        croak "build_opt called with include=$include";
-    }
-}
-
-sub set_build_type
-{
-    my ($build_type, $build_option) = @_;
-
-    usageerr(g_('cannot combine %s and %s'), build_opt(), $build_option)
-        if not build_is_default and $include != $build_type;
-    $include = $build_type;
-}
-
 # There's almost the same function in dpkg-checkbuilddeps,
 # they probably should be factored out.
 sub parse_status {
@@ -304,11 +280,11 @@ append_deps(\@unprocessed_pkgs,
             run_vendor_hook('builtin-build-depends'),
             $control->get_source->{'Build-Depends'});
 
-if ($include & BUILD_ARCH_DEP) {
+if (build_has_any(BUILD_ARCH_DEP)) {
     append_deps(\@unprocessed_pkgs, $control->get_source->{'Build-Depends-Arch'});
 }
 
-if ($include & BUILD_ARCH_INDEP) {
+if (build_has_any(BUILD_ARCH_INDEP)) {
     append_deps(\@unprocessed_pkgs, $control->get_source->{'Build-Depends-Indep'});
 }
 

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