X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=functions;h=17dcbdb9fc1363c76388f17b56016e48cb286c09;hb=7257be007e096ab1f7f6e3bf6c738b9b67b849f2;hp=ea18ae26beecdc10fb92f3d4afa8ea5cbf9ecd48;hpb=3dae4c554ec18f465eb6ee5e6efdbdbe8557e13c;p=hvlinux.git diff --git a/functions b/functions index ea18ae2..17dcbdb 100644 --- a/functions +++ b/functions @@ -759,17 +759,16 @@ ipkg_display_build_infos() # gnome # xorg # pm -# -s Name of script to execute or name of definition file (default is -# to source ipkg.def) +# -s Name of script to source (default is from name of package) ipkg() { START_TIME=$(echo `date +%s`) + unset ALT_SCRIPT_NAME export IPKG_MODE="ac" export HVLABEL="" # Global variable - local SCRIPT=${DEFAULT_IPKG_SCRIPT} - while getopts "hl:m:" flag ;do + while getopts "hl:m:s:" flag ;do case ${flag} in l) # Alternate label @@ -789,13 +788,7 @@ ipkg() ;; s) # Alternate script name - SCRIPT=${OPTARG} - - # Checking if script is valid and executable - if [ ! -x ${SCRIPT} ]; then - echo "${FUNCNAME}(): cannot execute script: ${SCRIPT}" - exit ${EXIT_FAILURE} - fi + ALT_SCRIPT_NAME=${OPTARG} ;; ?) echo "${FUNCNAME}(): Invalid option: ${OPTARG}." @@ -834,7 +827,7 @@ ipkg() 1> /dev/null 2>&1; then return $EXIT_SUCCESS fi - + # Displaying label MSGSTRING="Installing ${HVLABEL}" display_checkbox_msg ${MSGSTRING} @@ -853,15 +846,10 @@ ipkg() # All output from commands in this block sent to file $PACKAGE_LOG. exec > ${PACKAGE_LOG} 2>&1 - if [ "x${SCRIPT}" = "x${DEFAULT_IPKG_SCRIPT}" ]; then - # Executing standard ac script. - source ${SCRDIR}/../functions-ac - source ${SCRDIR}/${DEFAULT_IPKG_SCRIPT} - ipkg_script - else - # Executing custom script. - ${SCRIPT} ${PACKAGE} ${CONFIGURE_OPTS} - fi + # Sourcing standard ac script. + source ${SCRDIR}/../functions-ac + source ${SCRDIR}/${DEFAULT_IPKG_SCRIPT} + ipkg_script ${ALT_SCRIPT_NAME} # Make sure we are at a known location cd ${SCRDIR}