1 |
commit: b4bdbde037b8e65eaa694f1d59aab7772149386a |
2 |
Author: Justin Lecher <jlec <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 25 20:16:56 2016 +0000 |
4 |
Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 28 16:29:28 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=b4bdbde0 |
7 |
|
8 |
cmake-utils.eclass: Use bash internal testing instead of has() |
9 |
|
10 |
eclass/cmake-utils.eclass | 18 +++++++++--------- |
11 |
1 file changed, 9 insertions(+), 9 deletions(-) |
12 |
|
13 |
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass |
14 |
index 9e8e71e..292d0ae 100644 |
15 |
--- a/eclass/cmake-utils.eclass |
16 |
+++ b/eclass/cmake-utils.eclass |
17 |
@@ -127,7 +127,7 @@ case ${WANT_CMAKE} in |
18 |
always) |
19 |
;; |
20 |
*) |
21 |
- has "${EAPI:-0}" 2 3 4 5 || die "WANT_CMAKE is banned in EAPI 6 and later" |
22 |
+ [[ ${EAPI} == [2345] ]] || die "WANT_CMAKE is banned in EAPI 6 and later" |
23 |
IUSE+=" ${WANT_CMAKE}" |
24 |
CMAKEDEPEND+="${WANT_CMAKE}? ( " |
25 |
;; |
26 |
@@ -164,7 +164,7 @@ _cmake_use_me_now() { |
27 |
local arg=$2 |
28 |
[[ ! -z $3 ]] && arg=$3 |
29 |
|
30 |
- has "${EAPI:-0}" 2 3 4 5 || die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1${arg}=\"\$(usex $2)\" instead" |
31 |
+ [[ ${EAPI} == [2345] ]] || die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1${arg}=\"\$(usex $2)\" instead" |
32 |
|
33 |
local uper capitalised x |
34 |
[[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]" |
35 |
@@ -186,7 +186,7 @@ _cmake_use_me_now_inverted() { |
36 |
local arg=$2 |
37 |
[[ ! -z $3 ]] && arg=$3 |
38 |
|
39 |
- if ! has "${EAPI:-0}" 2 3 4 5 && [[ "${FUNCNAME[1]}" != cmake-utils_use_find_package ]] ; then |
40 |
+ if [[ ${EAPI} != [2345] ]] && [[ "${FUNCNAME[1]}" != cmake-utils_use_find_package ]] ; then |
41 |
die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1${arg}=\"\$(usex $2)\" insteadss" |
42 |
fi |
43 |
|
44 |
@@ -283,7 +283,7 @@ cmake_comment_add_subdirectory() { |
45 |
# Comment out an add_subdirectory call in CMakeLists.txt in the current directory |
46 |
# Banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead. |
47 |
comment_add_subdirectory() { |
48 |
- has "${EAPI:-0}" 2 3 4 5 || die "comment_add_subdirectory is banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead" |
49 |
+ [[ ${EAPI} == [2345] ]] || die "comment_add_subdirectory is banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead" |
50 |
|
51 |
cmake_comment_add_subdirectory "$@" |
52 |
} |
53 |
@@ -315,7 +315,7 @@ cmake-utils_use_enable() { _cmake_use_me_now ENABLE_ "$@" ; } |
54 |
# if foo is enabled and -DCMAKE_DISABLE_FIND_PACKAGE_LibFoo=ON if it is disabled. |
55 |
# This can be used to make find_package optional. |
56 |
cmake-utils_use_find_package() { |
57 |
- if ! has "${EAPI:-0}" 2 3 4 5 && [[ "$#" != 2 ]] ; then |
58 |
+ if [[ ${EAPI} != [2345] ]] && [[ "$#" != 2 ]] ; then |
59 |
die "Usage: cmake-utils_use_find_package <USE flag> <package name>" |
60 |
fi |
61 |
|
62 |
@@ -456,7 +456,7 @@ enable_cmake-utils_src_prepare() { |
63 |
|
64 |
pushd "${S}" > /dev/null || die |
65 |
|
66 |
- if ! has "${EAPI:-0}" 2 3 4 5 ; then |
67 |
+ if [[ ${EAPI} != [2345] ]]; then |
68 |
default_src_prepare |
69 |
_cmake_cleanup_cmake |
70 |
else |
71 |
@@ -488,7 +488,7 @@ enable_cmake-utils_src_prepare() { |
72 |
enable_cmake-utils_src_configure() { |
73 |
debug-print-function ${FUNCNAME} "$@" |
74 |
|
75 |
- has "${EAPI:-0}" 2 3 4 5 && _cmake_cleanup_cmake |
76 |
+ [[ ${EAPI} == [2345] ]] && _cmake_cleanup_cmake |
77 |
|
78 |
_cmake_check_build_dir |
79 |
|
80 |
@@ -564,7 +564,7 @@ enable_cmake-utils_src_configure() { |
81 |
fi |
82 |
fi |
83 |
|
84 |
- has "${EAPI:-0}" 0 1 2 && ! use prefix && local EPREFIX= |
85 |
+ [[ ${EAPI} == 2 ]] && ! use prefix && local EPREFIX= |
86 |
|
87 |
if [[ ${EPREFIX} ]]; then |
88 |
cat >> "${build_rules}" <<- _EOF_ || die |
89 |
@@ -604,7 +604,7 @@ enable_cmake-utils_src_configure() { |
90 |
local mycmakeargstype=$(declare -p mycmakeargs 2>&-) |
91 |
if [[ "${mycmakeargstype}" != "declare -a mycmakeargs="* ]]; then |
92 |
if [[ -n "${mycmakeargstype}" ]] ; then |
93 |
- if has "${EAPI:-0}" 2 3 4 5 ; then |
94 |
+ if [[ ${EAPI} == [2345] ]]; then |
95 |
eqawarn "Declaring mycmakeargs as a variable is deprecated. Please use an array instead." |
96 |
else |
97 |
die "Declaring mycmakeargs as a variable is banned in EAPI=${EAPI}. Please use an array instead." |