summaryrefslogtreecommitdiff
path: root/scripts/Dpkg/Build/Types.pm
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2016-05-01 17:20:16 +0200
committerGuillem Jover <guillem@debian.org>2016-05-02 04:03:19 +0200
commite731c1fcca81470e08f81ded165243bc5f05f8d0 (patch)
treedfc98be9428413ade322b2bad3b6f7de5da4043d /scripts/Dpkg/Build/Types.pm
parent3baee8a7d507d7d24ba9a8762399c54129efc1d7 (diff)
downloaddpkg-e731c1fcca81470e08f81ded165243bc5f05f8d0.tar.gz
Dpkg::Build::Types: Allow disabling the checks in set_build_type()
This makes it possible to test the different code paths.
Diffstat (limited to 'scripts/Dpkg/Build/Types.pm')
-rw-r--r--scripts/Dpkg/Build/Types.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/Dpkg/Build/Types.pm b/scripts/Dpkg/Build/Types.pm
index 9f19c77e8..7f6f1bc65 100644
--- a/scripts/Dpkg/Build/Types.pm
+++ b/scripts/Dpkg/Build/Types.pm
@@ -160,19 +160,23 @@ sub build_is
return $current_type == $bits;
}
-=item set_build_type($build_type, $build_option)
+=item set_build_type($build_type, $build_option, %opts)
Set the current build type to $build_type, which was specified via the
$build_option command-line option.
+The function will check and abort on incompatible build type assignments,
+this behavior can be disabled by using the boolean option "nocheck".
+
=cut
sub set_build_type
{
- my ($build_type, $build_option) = @_;
+ my ($build_type, $build_option, %opts) = @_;
usageerr(g_('cannot combine %s and %s'), $current_option, $build_option)
- if build_has_none(BUILD_DEFAULT) and $current_type != $build_type;
+ if not $opts{nocheck} and
+ build_has_none(BUILD_DEFAULT) and $current_type != $build_type;
$current_type = $build_type;
$current_option = $build_option;