X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=functions%2Fmain;h=c0ab98ee05d9e56d600c6395d6e68ebb35f21e36;hb=16e556be676ab727a73d9a98bcd7d68fb5a29f4f;hp=ae0d16303d5b6ba962f18b0b9d868db5cc29c1a9;hpb=fd7d0d6a1ec9d227e64d48ab65849a8061fc2fe2;p=hvlinux.git diff --git a/functions/main b/functions/main index ae0d163..c0ab98e 100644 --- a/functions/main +++ b/functions/main @@ -49,6 +49,7 @@ source ./stage.def # Load functions source ../functions/fpkg +source ../functions/lpkg # Constants for return codes EXIT_SUCCESS=0 @@ -168,6 +169,20 @@ get_pkg_ver_base() echo ${1} | sed "s!^.*-\([0-9]*\.[0-9]*\).*!\1!g" } +# Extracting the 3-digit version number from a complete package name. +# Arg. #1: Complete package name with version +# (ex: linux-2.6.37.1 will output 2.6.37) +get_pkg_ver3() +{ + # Checking for correct number of arguments + if [ $# -ne 1 ]; then + echo "${FUNCNAME}(), wrong number of arguments: ${*}" + return 1 + fi + + echo ${1} | sed "s!^.*-\([0-9]*\.[0-9]*\.[0-9]*\).*!\1!g" +} + # Extracting the base version number from a complete package name. # Arg. #1: Complete package name with version (ex: gcc-3.4.4 will output 3) get_pkg_ver_major() @@ -1106,7 +1121,8 @@ print_status() if [ $# -ne 1 ]; then # If no parameters are given to the print_status function, print usage # information. - echo "Usage: ${FUNCNAME}() {success|warning|failure} [STRING] [TIME]" + echo "Usage: ${FUNCNAME}() {success|warning|failure}" + echo " got: \"${*}\"" return ${EXIT_FAILURE} fi