lib/libem.bash: do not load modules twice while loading build dependencies

This commit is contained in:
2015-03-20 12:43:39 +01:00
parent ad664353cd
commit d148fbbdf7

View File

@@ -28,7 +28,7 @@ declare -xr BUILD_TMPDIR="${BUILD_BASEDIR}/tmp"
declare -xr BUILD_DOWNLOADSDIR="${BUILD_BASEDIR}/Downloads"
declare -xr BUILD_VERSIONSFILE="${BUILD_CONFIGDIR}/versions.conf"
source "${BUILD_CONFIGDIR}/Pmodules.conf"
#source "${BUILD_CONFIGDIR}/Pmodules.conf"
declare -x PREFIX=''
declare -x DOCDIR=''
@@ -91,10 +91,26 @@ ENV=VALUE
exit 1
}
##############################################################################
#
# test whether a the string passed in $1 is a valid release name
#
# $1: string to be tested
#
is_release () {
[[ ${releases} =~ :$1: ]]
}
##############################################################################
#
# test whether a module is loaded or not
#
# $1: module name
#
em.is_loaded() {
[[ :${LOADEDMODULES}: =~ :$1: ]]
}
function em.set_release() {
is_release "$1" || die 1 "$P: unknown release type: $1"
[[ "$1" == "deprecated" ]] && die 0 "$P: is deprecated, we don't rebuild it."
@@ -149,6 +165,7 @@ function _load_build_dependencies() {
echo "$m: warning: No version set, loading default ..."
fi
fi
em.is_loaded "$m" && continue
if ! module_is_available "$m"; then
debug "${m}: module not available"
local rels=( ${releases//:/ } )