summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2019-11-23 12:28:22 +0100
committerUlrich Müller <ulm@gentoo.org>2019-11-26 20:23:20 +0100
commit1e7e3efb6056bd1ea27871308a854d908f8b1e1a (patch)
treea0e7caf93b82d339c09f24e5627c57ef264390ee /eclass/estack.eclass
parentestack.eclass: Properly restore shopt options. (diff)
downloadgentoo-1e7e3efb6056bd1ea27871308a854d908f8b1e1a.tar.gz
gentoo-1e7e3efb6056bd1ea27871308a854d908f8b1e1a.tar.bz2
gentoo-1e7e3efb6056bd1ea27871308a854d908f8b1e1a.zip
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@gentoo.org>
Diffstat (limited to 'eclass/estack.eclass')
-rw-r--r--eclass/estack.eclass15
1 files changed, 2 insertions, 13 deletions
diff --git a/eclass/estack.eclass b/eclass/estack.eclass
index b0177bdb358e..2aa6f366dc12 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