Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Tue, 26 Nov 2019 19:24:03
Message-Id: 1574796200.1e7e3efb6056bd1ea27871308a854d908f8b1e1a.ulm@gentoo
1 commit: 1e7e3efb6056bd1ea27871308a854d908f8b1e1a
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 23 11:28:22 2019 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 26 19:23:20 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e7e3efb
7
8 estack.eclass: Drop isdigit function.
9
10 It isn't (and never was) used by anything else in the tree. Inline its
11 only usage in evar_pop() and drop the function.
12
13 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
14
15 eclass/estack.eclass | 15 ++-------------
16 1 file changed, 2 insertions(+), 13 deletions(-)
17
18 diff --git a/eclass/estack.eclass b/eclass/estack.eclass
19 index b0177bdb358..2aa6f366dc1 100644
20 --- a/eclass/estack.eclass
21 +++ b/eclass/estack.eclass
22 @@ -115,7 +115,8 @@ evar_pop() {
23 local cnt=${1:-bad}
24 case $# in
25 0) cnt=1 ;;
26 - 1) isdigit "${cnt}" || die "${FUNCNAME}: first arg must be a number: $*" ;;
27 + 1) [[ -z ${cnt//[0-9]} ]] \
28 + || die "${FUNCNAME}: first arg must be a number: $*" ;;
29 *) die "${FUNCNAME}: only accepts one arg: $*" ;;
30 esac
31
32 @@ -197,17 +198,5 @@ eumask_pop() {
33 umask ${s} || die "${FUNCNAME}: sanity: could not restore umask: ${s}"
34 }
35
36 -# @FUNCTION: isdigit
37 -# @USAGE: <number> [more numbers]
38 -# @DESCRIPTION:
39 -# Return true if all arguments are numbers.
40 -isdigit() {
41 - local d
42 - for d ; do
43 - [[ ${d:-bad} == *[!0-9]* ]] && return 1
44 - done
45 - return 0
46 -}
47 -
48 _ESTACK_ECLASS=1
49 fi #_ESTACK_ECLASS