-Desactive certains drivers dans Mesa a cause d'un bug avec le HP Mini
[hvlinux.git] / functions / main
index c3c14e5..6916952 100644 (file)
@@ -23,6 +23,10 @@ hvtrap_int()
     exit 1
 }
 
+# Load list of packages and versions.
+# They may be overridden in sysinfos.
+source ../config/packages-list
+
 # Load default values
 source ../config/sysinfos.default
 
@@ -46,9 +50,6 @@ source ./stage.def
 # Load functions
 source ../functions/fpkg
 
-# Load list of packages and versions
-source ../config/packages-list
-
 # Constants for return codes
 EXIT_SUCCESS=0
 EXIT_WARNING=1
@@ -167,6 +168,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()