summaryrefslogtreecommitdiff
path: root/scripts/Dpkg/Build/Types.pm
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2016-10-05 04:11:36 +0200
committerGuillem Jover <guillem@debian.org>2016-10-30 05:04:42 +0100
commitbc4ceb7af5ee80eb8f13852251f2b351f59ef06d (patch)
treef6d12073181ac66c9ac46ae095c6b059ea44ba4d /scripts/Dpkg/Build/Types.pm
parent05d5a6590879078c9992b9e8a8a07371413858e1 (diff)
downloaddpkg-bc4ceb7af5ee80eb8f13852251f2b351f59ef06d.tar.gz
Dpkg::Build::Type: Always map the build type to the shortest string form
We should try to map to the shortest string to make life easier.
Diffstat (limited to 'scripts/Dpkg/Build/Types.pm')
-rw-r--r--scripts/Dpkg/Build/Types.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/Dpkg/Build/Types.pm b/scripts/Dpkg/Build/Types.pm
index 9a921fa0b..45a81d3ba 100644
--- a/scripts/Dpkg/Build/Types.pm
+++ b/scripts/Dpkg/Build/Types.pm
@@ -100,13 +100,13 @@ use constant BUILD_FULL => BUILD_BINARY | BUILD_SOURCE;
my $current_type = BUILD_FULL | BUILD_DEFAULT;
my $current_option = undef;
-my @build_types = qw(source any all);
+my @build_types = qw(full source binary any all);
my %build_types = (
full => BUILD_FULL,
source => BUILD_SOURCE,
+ binary => BUILD_BINARY,
any => BUILD_ARCH_DEP,
all => BUILD_ARCH_INDEP,
- binary => BUILD_BINARY,
);
=back
@@ -224,11 +224,15 @@ Get the current build type as a set of comma-separated string options.
sub get_build_options_from_type
{
- return 'full' if build_has_all(BUILD_FULL);
+ my $local_type = $current_type;
my @parts;
foreach my $type (@build_types) {
- push @parts, $type if build_has_all($build_types{$type});
+ my $part_bits = $build_types{$type};
+ if (($local_type & $part_bits) == $part_bits) {
+ push @parts, $type;
+ $local_type &= ~$part_bits;
+ }
}
return join ',', @parts;