mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-07-13 00:20:51 +02:00
libpbuild: improve test whether a module exist or not
This commit is contained in:
+3
-14
@@ -1142,8 +1142,9 @@ pbuild::make_all() {
|
||||
check_supported_os
|
||||
check_supported_compilers
|
||||
set_full_module_name_and_prefix
|
||||
if module_exists "${module_name}/${module_version}" \
|
||||
&& [[ ${forece_rebuild} != 'yes' ]]; then
|
||||
if [[ -e "${modulefile_name}" ]] \
|
||||
&& [[ -d ${PREFIX} ]] \
|
||||
&& [[ ${force_rebuild} != 'yes' ]]; then
|
||||
if [[ "${module_release}" == 'removed' ]]; then
|
||||
remove_module
|
||||
else
|
||||
@@ -1260,18 +1261,6 @@ pbuild.init_env() {
|
||||
configure_with='undef'
|
||||
}
|
||||
|
||||
#..............................................................
|
||||
#
|
||||
# Test whether a module with the given name already exists.
|
||||
#
|
||||
# Arguments:
|
||||
# $1: module name/version
|
||||
#
|
||||
module_exists() {
|
||||
[[ -n $("${MODULECMD}" bash avail -m "$1" \
|
||||
2>&1 1>/dev/null) ]]
|
||||
}
|
||||
|
||||
pbuild.build_module() {
|
||||
module_name="$1"
|
||||
module_version="$2"
|
||||
|
||||
Reference in New Issue
Block a user