Gentoo Archives: gentoo-dev

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [PATCH v2] eapi7-ver.eclass: Support EAPIs 0 to 6.
Date: Tue, 08 May 2018 19:39:28
Message-Id: 23281.64740.534730.453494@a1i15.kph.uni-mainz.de
In Reply to: [gentoo-dev] [PATCH] eapi7-ver.eclass: Support EAPIs 0 to 6. by "Ulrich Müller"
1 ---
2 Sorry, I had sent the wrong patch.
3
4 eclass/eapi7-ver.eclass | 15 +++++++--------
5 1 file changed, 7 insertions(+), 8 deletions(-)
6
7 diff --git a/eclass/eapi7-ver.eclass b/eclass/eapi7-ver.eclass
8 index 6117124a90a5..43b6a4122506 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,8 @@
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 + *) die "${ECLASS}: EAPI=${EAPI} includes all functions from this eclass" ;;
29 esac
30
31 # @FUNCTION: _ver_parse_range
32 @@ -139,7 +135,10 @@ ver_cut() {
33 if [[ ${start} -gt 0 ]]; then
34 start=$(( start*2 - 1 ))
35 fi
36 - echo "${comp[*]:start:end*2-start}"
37 + # Work around a bug in bash-3.2, where "${comp[*]:start:end*2-start}"
38 + # inserts spurious 0x7f characters for empty array elements
39 + local out=( "${comp[@]:start:end*2-start}" )
40 + echo "${out[*]}"
41 }
42
43 # @FUNCTION: ver_rs
44 --
45 2.17.0

Replies