Ajout option pour effacer un fichier avant de le re-telecharger
[hvlinux.git] / functions / main
index ae0d163..c0ab98e 100644 (file)
@@ -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