summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-06-21 23:52:50 +0000
committerMike Frysinger <vapier@gentoo.org>2013-06-21 23:52:50 +0000
commite405a7f2ecade195414cf3f28e091478dff45569 (patch)
treef120ef7b1250c98a53e48366b0ccb7f0a1a26c2c /eclass
parentbump (diff)
downloadgentoo-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.eclass14
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.