implement loadModule()
This commit is contained in:
parent
ac158af81b
commit
920be6204a
|
@ -159,6 +159,38 @@ function loadLibraries() {
|
||||||
source ${EZROOT}/libraries/repositories &> /dev/null || panic
|
source ${EZROOT}/libraries/repositories &> /dev/null || panic
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
# Loads and executes given EzBuild module
|
||||||
|
# Parameters: %module% %step%
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
function loadModule() {
|
||||||
|
local MODULE="${1}"
|
||||||
|
local FUNCTION="${EZNAME}_${2}"
|
||||||
|
if [ -e ${MODULESCUSTOMDIR}/${MODULE}.ezmod ]; then
|
||||||
|
source ${MODULESCUSTOMDIR}/${MODULE}.ezmod &> /dev/null
|
||||||
|
else
|
||||||
|
source ${EZROOT}/modules/${MODULE}.ezmod &> /dev/null
|
||||||
|
fi
|
||||||
|
if [ ${?} -eq 0 ] && hasElement ${EZNAME} ${EZMOD_COMPATIBILITY}; then
|
||||||
|
if [ -e ${MODULESCUSTOMDIR}/${MODULE}.conf ]; then
|
||||||
|
source ${EZROOT}/config/modules/${MODULE}.conf &> /dev/null
|
||||||
|
source ${MODULESCUSTOMDIR}/${MODULE}.conf &> /dev/null
|
||||||
|
elif [ -e /etc/ezbuild/modules/${MODULE}.conf ]; then
|
||||||
|
source ${EZROOT}/config/modules/${MODULE}.conf &> /dev/null
|
||||||
|
source /etc/ezbuild/modules/${MODULE}.conf &> /dev/null
|
||||||
|
fi
|
||||||
|
if [ ${?} -eq 0 ]; then
|
||||||
|
if functionExists ${FUNCTION}; then
|
||||||
|
eval ${FUNCTION}
|
||||||
|
return ${?}
|
||||||
|
else
|
||||||
|
return 255
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Saves specified message into a log file
|
# Saves specified message into a log file
|
||||||
# Parameters: %message% [%level%]
|
# Parameters: %message% [%level%]
|
||||||
|
|
Loading…
Reference in New Issue