From f54a91166e69c7bd5acc11e93c4e699440a5a842 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 13 Aug 2024 17:31:18 +0200 Subject: [PATCH 1/2] build-system: bugfix: building multiple versions and/or variants --- Pmodules/modbuild.in | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Pmodules/modbuild.in b/Pmodules/modbuild.in index 9c1f1d5..7db3abe 100644 --- a/Pmodules/modbuild.in +++ b/Pmodules/modbuild.in @@ -136,7 +136,7 @@ DOCUMENTATION: declare -ra ARGS=( "$@" ) # versions to be build, '.*' or none means all -declare versions_to_build='' +declare -a versions_to_build=() declare opt_build_target='all' declare opt_dry_run='no' declare opt_enable_cleanup_build='yes' @@ -306,9 +306,9 @@ parse_args() { BUILDBLOCK_DIR=$(dirname "${BUILD_SCRIPT}") elif [[ "${arg}" == */* ]]; then module_name="${arg%/*}" - versions_to_build+=" ${arg#*/}" + versions_to_build+=( "${arg#*/}" ) else - versions_to_build+=" $1" + versions_to_build+=( "$1" ) fi ;; esac @@ -320,8 +320,8 @@ parse_args() { "Build script argument missing?" # if no version is specified on the cmd-line, build all versions - #(( ${#versions_to_build[@]} > 0)) || versions_to_build+=( '.*' ) - [[ -z ${versions_to_build} ]] && versions_to_build='.*' + (( ${#versions_to_build[@]} > 0)) || versions_to_build+=( '.*' ) + # set system if not set on the cmd-line opt_system="${opt_system:-$(std::get_os_release)}" @@ -1490,7 +1490,8 @@ if [[ -z ${module_name} ]]; then module_name=${fname[${#fname[@]}-2]} fi -for version in ${versions_to_build}; do +declare version='' +for version in "${versions_to_build[@]}"; do build_modules "${module_name}" "${version}" "${opt_with_modules[@]}" done From 63b971432af3ce0f01fd2bae1520a68d2d623b39 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 13 Aug 2024 17:33:01 +0200 Subject: [PATCH 2/2] build-system: bugfix: building multiple versions and/or variants --- Pmodules/libpbuild.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pmodules/libpbuild.bash b/Pmodules/libpbuild.bash index f847042..7403d11 100644 --- a/Pmodules/libpbuild.bash +++ b/Pmodules/libpbuild.bash @@ -1711,7 +1711,7 @@ _build_module() { # check whether this module is supported check_supported_systems check_supported_compilers - [[ -z "${PREFIX}" ]] && set_full_module_name_and_prefix + [[ "${is_subpkg}" != 'yes' ]] && set_full_module_name_and_prefix # ok, finally we can start ... std::info \