From 837bf74522284385d203e5077043c9121cf22163 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 19 Apr 2021 15:45:06 +0200 Subject: [PATCH] libpbuild: improve test whether a module exist or not --- Pmodules/libpbuild.bash | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/Pmodules/libpbuild.bash b/Pmodules/libpbuild.bash index 336b9f6..cc7b03e 100644 --- a/Pmodules/libpbuild.bash +++ b/Pmodules/libpbuild.bash @@ -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"