diff options
author | Guillem Jover <guillem@debian.org> | 2016-04-06 17:33:26 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2016-05-02 04:03:19 +0200 |
commit | 3baee8a7d507d7d24ba9a8762399c54129efc1d7 (patch) | |
tree | c0e6bc10f99c3efffebf350ab4cd219fefca070c /scripts/Dpkg/Build/Types.pm | |
parent | dd064b2138478d9a53beefa7a873425d1738e4cb (diff) | |
download | dpkg-3baee8a7d507d7d24ba9a8762399c54129efc1d7.tar.gz |
Dpkg::Build::Types: Clarify build type functions
Distinguish build_has_any from build_has_all. Rename build_has_not into
build_has_none.
Fix scripts to use the correct bits check function.
Diffstat (limited to 'scripts/Dpkg/Build/Types.pm')
-rw-r--r-- | scripts/Dpkg/Build/Types.pm | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/scripts/Dpkg/Build/Types.pm b/scripts/Dpkg/Build/Types.pm index 85b44245c..9f19c77e8 100644 --- a/scripts/Dpkg/Build/Types.pm +++ b/scripts/Dpkg/Build/Types.pm @@ -28,8 +28,8 @@ our @EXPORT = qw( BUILD_BINARY BUILD_FULL build_has_any - build_has - build_has_not + build_has_all + build_has_none build_is set_build_type ); @@ -118,32 +118,32 @@ sub build_has_any return $current_type & $bits; } -=item build_has($bits) +=item build_has_all($bits) Return a boolean indicating whether the current build type has all the specified $bits. =cut -sub build_has +sub build_has_all { my ($bits) = @_; return ($current_type & $bits) == $bits; } -=item build_has_not($bits) +=item build_has_none($bits) -Return a boolean indicating whether the current build type does not have the +Return a boolean indicating whether the current build type has none of the specified $bits. =cut -sub build_has_not +sub build_has_none { my ($bits) = @_; - return ($current_type & $bits) != $bits; + return !($current_type & $bits); } =item build_is($bits) @@ -172,7 +172,7 @@ sub set_build_type my ($build_type, $build_option) = @_; usageerr(g_('cannot combine %s and %s'), $current_option, $build_option) - if build_has_not(BUILD_DEFAULT) and $current_type != $build_type; + if build_has_none(BUILD_DEFAULT) and $current_type != $build_type; $current_type = $build_type; $current_option = $build_option; |