diff --git a/Pmodules/modbuild b/Pmodules/modbuild index d79b2a7..5578d8f 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" 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}" ) ) diff --git a/build b/build index e334467..12f64ea 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' @@ -166,6 +168,9 @@ pmodules::install() { while (( $# > 0 )); do case $1 in + --debug ) + set -x + ;; --config ) config_file="$2" shift 1 @@ -313,7 +318,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[@]}" 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