X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=functions%2Fmain;h=25e1bcb2c38418034765cc2273fe946196f72fa3;hb=bd4976a460cc6af4da09164c6f1d1581480a9771;hp=ec42a712b83ec1e0f0adaf2e15b6c4fd5240b422;hpb=cbf0a4d83bf6c2f960f050a271c0f2891e4dd435;p=hvlinux.git diff --git a/functions/main b/functions/main index ec42a71..25e1bcb 100644 --- a/functions/main +++ b/functions/main @@ -157,9 +157,9 @@ get_pkg_ver() echo ${1} | sed "s!.*-\([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.4) -get_pkg_ver_base() +# Extracting the first digit version number from a complete package name. +# Arg. #1: Complete package name with version (ex: gcc-3.4.4 will output 3) +get_pkg_ver1() { # Checking for correct number of arguments if [ $# -ne 1 ]; then @@ -167,13 +167,12 @@ get_pkg_ver_base() return 1 fi - echo ${1} | sed "s!^.*-\([0-9]*\.[0-9]*\).*!\1!g" + echo ${1} | sed "s!^.*-\([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() +# Extracting the first 2 digits version number from a complete package name. +# Arg. #1: Complete package name with version (ex: gcc-3.4.4 will output 3.4) +get_pkg_ver2() { # Checking for correct number of arguments if [ $# -ne 1 ]; then @@ -181,12 +180,13 @@ get_pkg_ver3() return 1 fi - echo ${1} | sed "s!^.*-\([0-9]*\.[0-9]*\.[0-9]*\).*!\1!g" + echo ${1} | sed "s!^.*-\([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() +# Extracting the first 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 @@ -194,7 +194,7 @@ get_pkg_ver_major() return 1 fi - echo ${1} | sed "s!^.*-\([0-9]*\)\..*!\1!g" + echo ${1} | sed "s!^.*-\([0-9]*\.[0-9]*\.[0-9]*\).*!\1!g" } # Extracting the name from a complete package name.