commit: 1e7e3efb6056bd1ea27871308a854d908f8b1e1a
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 23 11:28:22 2019 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Nov 26 19:23:20 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e7e3efb
estack.eclass: Drop isdigit function.
It isn't (and never was) used by anything else in the tree. Inline its
only usage in evar_pop() and drop the function.
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
eclass/estack.eclass | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/eclass/estack.eclass b/eclass/estack.eclass
index b0177bdb358..2aa6f366dc1 100644
--- a/eclass/estack.eclass
+++ b/eclass/estack.eclass
@@ -115,7 +115,8 @@ evar_pop() {
local cnt=${1:-bad}
case $# in
0) cnt=1 ;;
- 1) isdigit "${cnt}" || die "${FUNCNAME}: first arg must be a number:
$*" ;;
+ 1) [[ -z ${cnt//[0-9]} ]] \
+ || die "${FUNCNAME}: first arg must be a number: $*" ;;
*) die "${FUNCNAME}: only accepts one arg: $*" ;;
esac
@@ -197,17 +198,5 @@ eumask_pop() {
umask ${s} || die "${FUNCNAME}: sanity: could not restore umask: ${s}"
}
-# @FUNCTION: isdigit
-# @USAGE: <number> [more numbers]
-# @DESCRIPTION:
-# Return true if all arguments are numbers.
-isdigit() {
- local d
- for d ; do
- [[ ${d:-bad} == *[!0-9]* ]] && return 1
- done
- return 0
-}
-
_ESTACK_ECLASS=1
fi #_ESTACK_ECLASS