From: Ulrich Müller Date: Sat, 23 Nov 2019 11:28:22 +0000 (+0100) Subject: estack.eclass: Drop isdigit function. X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=1e7e3efb6056bd1ea27871308a854d908f8b1e1a;p=gentoo.git 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 --- 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: [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