From 9558522bba93ad799d310e84823aa30ee48d7b8d Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 5 Apr 2023 16:23:58 +0200 Subject: [PATCH] pick changes from version 1.0 --- Pmodules/libmodules.tcl | 1 + Pmodules/libpbuild.bash | 20 ++++++++++---------- Pmodules/modbuild.in | 11 +++++++++++ build | 2 +- recipes/010-bash | 2 +- recipes/020-tcl | 2 +- recipes/040-modules | 2 +- 7 files changed, 26 insertions(+), 14 deletions(-) diff --git a/Pmodules/libmodules.tcl b/Pmodules/libmodules.tcl index 65621dc..37b9f9a 100644 --- a/Pmodules/libmodules.tcl +++ b/Pmodules/libmodules.tcl @@ -192,6 +192,7 @@ proc _pmodules_setenv { PREFIX name version } { set setenv_dirs [dict create \ "${PREFIX}/include" "${NAME}_INCLUDE_DIR" \ "${PREFIX}/lib" "${NAME}_LIBRARY_DIR" \ + "${PREFIX}/lib64" "${NAME}_LIBRARY_DIR" \ ] set prepend_dirs [dict create \ "${PREFIX}/bin" { "PATH" } \ diff --git a/Pmodules/libpbuild.bash b/Pmodules/libpbuild.bash index 39c6bea..56ec503 100644 --- a/Pmodules/libpbuild.bash +++ b/Pmodules/libpbuild.bash @@ -552,10 +552,7 @@ pbuild::prep() { break fi done - (( ${#SOURCE_URLS[@]} == 0 )) && \ - std::die 3 \ - "%s " "${module_name}/${module_version}:" \ - "Download source not set!" + (( ${#SOURCE_URLS[@]} == 0 )) && return 0 ${mkdir} -p "${PMODULES_DISTFILESDIR}" local i=0 local source_fname @@ -1183,6 +1180,9 @@ _build_module() { "${PMODULES_MODULEFILES_DIR}" \ "${names[@]}" \ "${module_name}") + if [[ -L "${modulefile_dir}" ]]; then + modulefile_dir=$(readlink -m "${modulefile_dir}") + fi modulefile_name="${modulefile_dir}/${module_version}" PREFIX="${ol_inst_root}/${GROUP}/${module_name}/${module_version}" @@ -1382,7 +1382,7 @@ _build_module() { std::info "%s "\ "${module_name}/${module_version}:" \ "removing modulefile from overlay '${ol}' ..." - ${rm} "${fname}" + ${rm} -f "${fname}" fi fname="${dir}/.release-${module_version}" if [[ -e "${fname}" ]]; then @@ -1390,7 +1390,7 @@ _build_module() { "%s " \ "${module_name}/${module_version}:" \ "removing release file from overlay '${ol}' ..." - ${rm} "${fname}" + ${rm} -f "${fname}" fi done } @@ -1451,7 +1451,7 @@ _build_module() { "%s " \ "${module_name}/${module_version}:" \ "Cleaning up '${SRC_DIR}'..." - rm -rf "${SRC_DIR##*/}" + ${rm} -rf "${SRC_DIR##*/}" }; return 0 } @@ -1553,7 +1553,7 @@ _build_module() { "%s " \ "${module_name}/${module_version}:" \ "removing modulefile '${modulefile_name}' ..." - [[ "${dry_run}" == 'no' ]] && ${rm} -v "${modulefile_name}" + [[ "${dry_run}" == 'no' ]] && ${rm} -vf "${modulefile_name}" fi local release_file="${modulefile_dir}/.release-${module_version}" if [[ -e "${release_file}" ]]; then @@ -1561,7 +1561,7 @@ _build_module() { "%s " \ "${module_name}/${module_version}:" \ "removing release file '${release_file}' ..." - [[ "${dry_run}" == 'no' ]] && rm -v "${release_file}" + [[ "${dry_run}" == 'no' ]] && ${rm} -vf "${release_file}" fi ${rmdir} -p "${modulefile_dir}" 2>/dev/null || : } @@ -1595,7 +1595,7 @@ _build_module() { # :FIXME: add comments what and why we are doing this. # local -r logfile="${BUILDBLOCK_DIR}/pbuild.log" - rm -f "${logfile}" + ${rm} -f "${logfile}" if [[ "${verbose}" == 'yes' ]]; then exec > >(${tee} -a "${logfile}") else diff --git a/Pmodules/modbuild.in b/Pmodules/modbuild.in index a8cc14f..8bdc1a3 100755 --- a/Pmodules/modbuild.in +++ b/Pmodules/modbuild.in @@ -451,6 +451,17 @@ build_modules_legacy() { local name="${tokens[0]%/*}" version="${tokens[0]#*/}" release="${tokens[1]}" + case ${release} in + unstable|stable|deprecated|remove|removed) + : + ;; + * ) + std::info "%s " \ + "${name}/${version}:" \ + "invalid release stage '${release}'!" + std::die 10 "Aborting..." + ;; + esac with_modules=( "${tokens[@]:2}" ) pbuild.build_module_legacy \ "${name}" "${version}" \ diff --git a/build b/build index 26995b6..a5b591b 100755 --- a/build +++ b/build @@ -5,7 +5,7 @@ declare -rx VERSION='1.1.11' declare -rx BASH5_VERSION='5.2.15' declare -rx TCL_VERSION='8.6.13' declare -rx TCLLIB_VERSION='1.21' -declare -rx MODULES_VERSION='3.2.10.1' +declare -rx MODULES_VERSION='3.2.10.2' # for macOS only declare -rx GETOPT_VERSION='1.1.6' diff --git a/recipes/010-bash b/recipes/010-bash index 4956448..6d1a12b 100755 --- a/recipes/010-bash +++ b/recipes/010-bash @@ -3,7 +3,7 @@ # https://www.gnu.org/software/bash/ # P=bash -V=${BASH5_VERSION:-5.1.16} +V=${BASH5_VERSION:-5.2.15} FNAME="$P-$V.tar.gz" DOWNLOAD_URL="https://ftp.gnu.org/gnu/$P/${FNAME}" diff --git a/recipes/020-tcl b/recipes/020-tcl index 0e380e0..4a56c98 100755 --- a/recipes/020-tcl +++ b/recipes/020-tcl @@ -3,7 +3,7 @@ # https://www.tcl.tk # P=tcl -V=${TCL_VERSION:-8.6.12} +V=${TCL_VERSION:-8.6.13} FNAME="$P$V-src.tar.gz" DOWNLOAD_URL="https://prdownloads.sourceforge.net/tcl/${FNAME}" diff --git a/recipes/040-modules b/recipes/040-modules index 5c8dca5..eb92ee8 100755 --- a/recipes/040-modules +++ b/recipes/040-modules @@ -3,7 +3,7 @@ # https://core.tcl-lang.org # P=modules -V=${MODULES_VERSION:-3.2.10.1} +V=${MODULES_VERSION:-3.2.10.2} FNAME="$P-$V.tar.gz" DOWNLOAD_URL="https://amas.web.psi.ch/Downloads/$P/$P-$V.tar.bz2"