1 |
--- |
2 |
v3, including suggestions from Duncan and Hello71. |
3 |
|
4 |
eclass/eapi7-ver.eclass | 16 +++++++--------- |
5 |
1 file changed, 7 insertions(+), 9 deletions(-) |
6 |
|
7 |
diff --git a/eclass/eapi7-ver.eclass b/eclass/eapi7-ver.eclass |
8 |
index 6117124a90a5..e34025e201c7 100644 |
9 |
--- a/eclass/eapi7-ver.eclass |
10 |
+++ b/eclass/eapi7-ver.eclass |
11 |
@@ -1,4 +1,4 @@ |
12 |
-# Copyright 1999-2017 Gentoo Foundation |
13 |
+# Copyright 1999-2018 Gentoo Foundation |
14 |
# Distributed under the terms of the GNU General Public License v2 |
15 |
|
16 |
# @ECLASS: eapi7-ver.eclass |
17 |
@@ -58,12 +58,9 @@ |
18 |
# the version string, it is truncated silently. |
19 |
|
20 |
case ${EAPI:-0} in |
21 |
- 0|1|2|3|4|5) |
22 |
- die "${ECLASS}: EAPI=${EAPI:-0} not supported";; |
23 |
- 6) |
24 |
- ;; |
25 |
- *) |
26 |
- die "${ECLASS}: EAPI=${EAPI} includes all functions from this eclass";; |
27 |
+ 0|1|2|3|4|5|6) ;; |
28 |
+ 7) die "${ECLASS}: EAPI=${EAPI} includes all functions from this eclass" ;; |
29 |
+ *) die "${ECLASS}: EAPI=${EAPI} unknown" ;; |
30 |
esac |
31 |
|
32 |
# @FUNCTION: _ver_parse_range |
33 |
@@ -135,11 +132,12 @@ ver_cut() { |
34 |
local max=$((${#comp[@]}/2)) |
35 |
_ver_parse_range "${range}" "${max}" |
36 |
|
37 |
- local IFS= |
38 |
if [[ ${start} -gt 0 ]]; then |
39 |
start=$(( start*2 - 1 )) |
40 |
fi |
41 |
- echo "${comp[*]:start:end*2-start}" |
42 |
+ # Work around a bug in bash-3.2, where "${comp[*]:start:end*2-start}" |
43 |
+ # inserts spurious 0x7f characters for empty array elements |
44 |
+ printf "%s" "${comp[@]:start:end*2-start}" $'\n' |
45 |
} |
46 |
|
47 |
# @FUNCTION: ver_rs |
48 |
-- |
49 |
2.17.0 |