[Reproducible-commits] [dpkg] 20/24: dpkg-genbuildinfo: Use Dpkg::Build::Types module instead of ad-hoc code
Niko Tyni
ntyni at moszumanska.debian.org
Tue May 3 21:38:24 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 febae1da9ee7ac6ccb8cce0e3e491c84d05d8da7
Author: Niko Tyni <ntyni at debian.org>
Date: Mon May 2 22:23:19 2016 +0300
dpkg-genbuildinfo: Use Dpkg::Build::Types module instead of ad-hoc code
This is in line with upstream 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 c42d574..29b47c4 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;
@@ -61,31 +62,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 {
@@ -307,11 +283,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