Merge branch 'master' of gitlab.psi.ch:Pmodules/src

This commit is contained in:
2017-08-08 14:19:31 +02:00
4 changed files with 30 additions and 6 deletions
+2
View File
@@ -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"
+19 -2
View File
@@ -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] [<module-pattern>...]
#
@@ -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}" ) )
+8 -3
View File
@@ -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[@]}"
+1 -1
View File
@@ -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