X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=functions%2Fmain;h=6916952cbec5e8ad7d3d74aecdbf184549879382;hb=ce815aec9d5bd5a16a5fd769419e449976669aaa;hp=d677cc7b4c5492ce38c8078e19482b07182de87c;hpb=6be74141099e569e059115b9659f1a8c98306ac7;p=hvlinux.git diff --git a/functions/main b/functions/main index d677cc7..6916952 100644 --- a/functions/main +++ b/functions/main @@ -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() @@ -752,6 +767,7 @@ ipkg_display_build_infos() echo " AR: ${AR}" echo " AS: ${AS}" echo " PATH: ${PATH}" + echo " HVMAKE: ${HVMAKE}" GCCCPUOPT=$(gcc ${MARCH_FLAGS} -E -v - &1 | \ sed -n 's/.* -v - //p') @@ -762,7 +778,7 @@ ipkg_display_build_infos() # Arg. #1: Package name and version (ex: gcc-4.5.1) # Remaining arguments: Additional configure options # Options: -# -h Display this help and returns +# -j Disable parallel make for this package # -l Unique identification label in 'install.log' # (default is package name and version) # -m Installation mode: @@ -781,8 +797,14 @@ ipkg() export IPKG_MODE="ac" # Default mode if not specified export HVLABEL="" # Global variable - while getopts "l:m:s:" flag ;do + local HVMAKE_ORIG=${HVMAKE} + + while getopts "jl:m:s:" flag ;do case ${flag} in + j) + # Disable parallel make onlyfor this package + HVMAKE="make" + ;; l) # Alternate label HVLABEL=${OPTARG} @@ -864,6 +886,9 @@ ipkg() source ${SCRDIR}/${DEFAULT_IPKG_SCRIPT} ipkg_script ${ALT_SCRIPT_NAME} + # Restore original value in case it was modified + HVMAKE=${HVMAKE_ORIG} + # Make sure we are at a known location cd ${SCRDIR}