diff options
author | Mike Frysinger <vapier@gentoo.org> | 2013-06-21 23:52:50 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2013-06-21 23:52:50 +0000 |
commit | e405a7f2ecade195414cf3f28e091478dff45569 (patch) | |
tree | f120ef7b1250c98a53e48366b0ccb7f0a1a26c2c /eclass | |
parent | bump (diff) | |
download | gentoo-2-e405a7f2ecade195414cf3f28e091478dff45569.tar.gz gentoo-2-e405a7f2ecade195414cf3f28e091478dff45569.tar.bz2 gentoo-2-e405a7f2ecade195414cf3f28e091478dff45569.zip |
isdigit: new func for testing if args are all numbers
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/eutils.eclass | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 39cf78c43151..31a501897908 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.421 2013/05/22 05:10:29 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.422 2013/06/21 23:52:50 vapier Exp $ # @ECLASS: eutils.eclass # @MAINTAINER: @@ -218,6 +218,18 @@ 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 +} + # @VARIABLE: EPATCH_SOURCE # @DESCRIPTION: # Default directory to search for patches. |