From 9f2403dffae514dca431828014a2dc9c9de4e61f Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 14 Dec 2007 14:12:38 +0000 Subject: Remove Gentoo copyright from all files that I know I have written --- sh.Linux/init.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'sh.Linux/init.sh') diff --git a/sh.Linux/init.sh b/sh.Linux/init.sh index 524e7538..dc9ee5d6 100755 --- a/sh.Linux/init.sh +++ b/sh.Linux/init.sh @@ -109,6 +109,24 @@ get_KV() { return $? } +KV_to_int() { + [ -z $1 ] && return 1 + + local x=${1%%-*} + local KV_MAJOR=${x%%.*} + x=${x#*.} + local KV_MINOR=${x%%.*} + x=${x#*.} + local KV_MICRO=${x%%.*} + local KV_int=$((${KV_MAJOR} * 65536 + ${KV_MINOR} * 256 + ${KV_MICRO} )) + + # We make version 2.2.0 the minimum version we will handle as + # a sanity check ... if its less, we fail ... + [ "${KV_int}" -lt 131584 ] && return 1 + + echo "${KV_int}" +} + . /etc/init.d/functions.sh . "${RC_LIBDIR}"/sh/init-functions.sh . "${RC_LIBDIR}"/sh/rc-functions.sh -- cgit v1.2.3