From 20b4edc9723723879963f835e0612d4d62da656f Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 8 Aug 2017 01:01:00 +0200 Subject: [PATCH 1/4] Pmodules/modbuild - create ${PMODULES_DISTFILESDIR} if not already exists --- Pmodules/modbuild | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Pmodules/modbuild b/Pmodules/modbuild index 831ad7c..1f69a5e 100755 --- a/Pmodules/modbuild +++ b/Pmodules/modbuild @@ -293,6 +293,8 @@ fi declare -x PMODULES_TMPDIR declare -x PMODULES_DISTFILESDIR +mkdir -p "${PMODULES_DISTFILESDIR}" + declare -r BUILD_SCRIPTSDIR="${BUILD_BASEDIR}/scripts" declare -r BUILD_VERSIONSFILE="${BUILD_BASEDIR}/config/versions.conf" From 79f58c69618d825020748bbb0a50dd9d11252e90 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 8 Aug 2017 01:02:17 +0200 Subject: [PATCH 2/4] build - bit more output of 'usage()' - option '--debug' added to sub-command 'install' --- build | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build b/build index c5b1357..b903565 100755 --- a/build +++ b/build @@ -13,8 +13,10 @@ declare -r BOOTSTRAP_DIR=$(std::get_abspath "${BOOTSTRAP_DIR}") declare -r SRC_DIR="${BOOTSTRAP_DIR}/Pmodules" usage() { - echo "build [OPTIONS] SUB-COMMAND" - std:die 1 "" + echo " +build [OPTIONS] configure|compile|install +" + std::die 1 "" } declare -rx DEFAULT_PMODULES_ROOT='/opt/psi' @@ -167,6 +169,9 @@ pmodules::install() { while (( $# > 0 )); do case $1 in + --debug ) + set -x + ;; --config ) config_file="$2" shift 1 @@ -311,7 +316,7 @@ while (( $# > 0 )); do shift 1 done -[[ -n "${subcmd}" ]] || std::die 1 "Missing sub-command." +[[ -n "${subcmd}" ]] || std::die 1 "Missing sub-command.\n\nUse 'build --help' to get some help..." pmodules::${subcmd} "${subcmd_args[@]}" From e1993f7091d718b89afa57e5108390d1f71579c6 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 8 Aug 2017 01:06:39 +0200 Subject: [PATCH 3/4] config/versions.con - set Pmodules version to 0.99.13 --- config/versions.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/versions.conf b/config/versions.conf index 850f073..e3b3191 100644 --- a/config/versions.conf +++ b/config/versions.conf @@ -3,5 +3,5 @@ coreutils 8.23 getopt 1.1.6 gettext 0.19.4 Modules 3.2.10 -Pmodules 0.99.12 +Pmodules 0.99.13 Tcl 8.6.6 From cade57f7cdd3e794b6a33a5f21a63126d1c05421 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 8 Aug 2017 01:11:43 +0200 Subject: [PATCH 4/4] Pmodules/modulecmd.bash.in - sub-commands 'avail' and 'search' are now case insensitive and accept a shell pattern as argument --- Pmodules/modulecmd.bash.in | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index d05e1c6..33406f9 100755 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -964,6 +964,23 @@ get_available_modules() { echo "${mods[@]}" } +get_available_modules2() { + local -r dir=$1 + local -r module=$2 + local -r use_releases=${3:-${UsedReleases}} + local -a mods=() + { + cd "${dir}" + while read mod; do + local release=$( get_release "${dir}/${mod}" ) + + if [[ :${use_releases}: =~ :${release}: ]]; then + mods+=( "${mod}" ${release} ) + fi + done < <(find * \( -type f -o -type l \) -not -name ".*" -ipath "${module}*") + } + echo "${mods[@]}" +} # # avail [-hlt] [...] # @@ -1130,7 +1147,7 @@ subcommand_avail() { IFS=${saved_IFS} for string in "${pattern[@]}"; do for dir in "${modulepath[@]}"; do - mods=( $( get_available_modules "${dir}" "${string}" "${opt_use_releases}" ) ) + mods=( $( get_available_modules2 "${dir}" "${string}" "${opt_use_releases}" ) ) [[ ${#mods[@]} == 0 ]] && continue ${output_function} @@ -1648,7 +1665,7 @@ subcommand_search() { # get and print all available modules in $mpath # with respect to the requested releases # tmpfile: module/version release group group-dependencies... - local mods=( $( get_available_modules \ + local mods=( $( get_available_modules2 \ "${mpath}" \ "${module}" \ "${opt_use_releases}" ) )