1 |
commit: 760f5e9756f6ba4ffc0b31aa71e7c80860b8657e |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Nov 29 16:33:08 2015 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Dec 1 14:21:30 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=760f5e97 |
7 |
|
8 |
eutils.eclass: In EAPI conditionals, replace "has" by case statements. |
9 |
|
10 |
eclass/eutils.eclass | 21 ++++++++++++++------- |
11 |
1 file changed, 14 insertions(+), 7 deletions(-) |
12 |
|
13 |
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass |
14 |
index 5c7d1aa..1163051 100644 |
15 |
--- a/eclass/eutils.eclass |
16 |
+++ b/eclass/eutils.eclass |
17 |
@@ -1614,7 +1614,8 @@ check_license() { |
18 |
die "you no longer need this as portage supports ACCEPT_LICENSE itself" |
19 |
} |
20 |
|
21 |
-if has "${EAPI:-0}" 0 1 2; then |
22 |
+case ${EAPI:-0} in |
23 |
+0|1|2) |
24 |
|
25 |
# @FUNCTION: epause |
26 |
# @USAGE: [seconds] |
27 |
@@ -1646,7 +1647,8 @@ ebeep() { |
28 |
fi |
29 |
} |
30 |
|
31 |
-else |
32 |
+;; |
33 |
+*) |
34 |
|
35 |
ebeep() { |
36 |
ewarn "QA Notice: ebeep is not defined in EAPI=${EAPI}, please file a bug at https://bugs.gentoo.org" |
37 |
@@ -1656,9 +1658,11 @@ epause() { |
38 |
ewarn "QA Notice: epause is not defined in EAPI=${EAPI}, please file a bug at https://bugs.gentoo.org" |
39 |
} |
40 |
|
41 |
-fi |
42 |
+;; |
43 |
+esac |
44 |
|
45 |
-if has "${EAPI:-0}" 0 1 2 3 4; then |
46 |
+case ${EAPI:-0} in |
47 |
+0|1|2|3|4) |
48 |
|
49 |
# @FUNCTION: usex |
50 |
# @USAGE: <USE flag> [true output] [false output] [true suffix] [false suffix] |
51 |
@@ -1669,9 +1673,11 @@ if has "${EAPI:-0}" 0 1 2 3 4; then |
52 |
# otherwise echo [false output][false suffix] (defaults to "no"). |
53 |
usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; } #382963 |
54 |
|
55 |
-fi |
56 |
+;; |
57 |
+esac |
58 |
|
59 |
-if has "${EAPI:-0}" 0 1 2 3 4 5; then |
60 |
+case ${EAPI:-0} in |
61 |
+0|1|2|3|4|5) |
62 |
|
63 |
# @VARIABLE: EPATCH_USER_SOURCE |
64 |
# @DESCRIPTION: |
65 |
@@ -1821,4 +1827,5 @@ in_iuse() { |
66 |
has "${flag}" "${liuse[@]#[+-]}" |
67 |
} |
68 |
|
69 |
-fi |
70 |
+;; |
71 |
+esac |