From fbcca02c1c4afa0473870b730075a82ceffec24c Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 8 Jun 2015 10:55:16 +0200 Subject: [PATCH 1/4] lib/lib.bash: - use 'readlink -f' in 'abspath()' --- lib/lib.bash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/lib.bash b/lib/lib.bash index 99c1d38..54ff574 100644 --- a/lib/lib.bash +++ b/lib/lib.bash @@ -77,8 +77,12 @@ die() { exit $ec } +#abspath () { +# (cd "$1" && pwd) +#} + abspath () { - (cd "$1" && pwd) + readlink -f "$1" } append_path () { From 6df1aadfa078f30dc99d1b22cf18928391f0240a Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 8 Jun 2015 10:56:45 +0200 Subject: [PATCH 2/4] lib/libpmodules.bash: cleanup --- lib/libpmodules.bash | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/libpmodules.bash b/lib/libpmodules.bash index d7333da..6f0ec16 100644 --- a/lib/libpmodules.bash +++ b/lib/libpmodules.bash @@ -6,21 +6,26 @@ PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin unset CDPATH shopt -s expand_aliases +declare -rx ARGS="$@" + declare -r BUILDSCRIPT_DIR=$( cd $(dirname "$0") && pwd ) declare -r BUILDSCRIPT="${BUILDSCRIPT_DIR}"/$(basename "$0") -declare -rx ARGS="$@" declare -rx SHLIBDIR=$( cd $(dirname "$BASH_SOURCE") && pwd ) +source "${SHLIBDIR}/lib.bash" + +declare -rx BUILD_BASEDIR=$(abspath $SHLIBDIR/..) + + + + + declare -r OS=$(uname -s) # number of parallel make jobs declare -i JOBS=3 -source "${SHLIBDIR}/lib.bash" - -declare -rx BUILD_BASEDIR=$(abspath $SHLIBDIR/..) - source "$(readlink ${BUILD_BASEDIR}/config/environment.bash)" declare -xr BUILD_CONFIGDIR="${BUILD_BASEDIR}/config" @@ -29,7 +34,7 @@ declare -xr BUILD_TMPDIR="${BUILD_BASEDIR}/tmp" declare -xr BUILD_DOWNLOADSDIR="${BUILD_BASEDIR}/Downloads" declare -xr BUILD_VERSIONSFILE="${BUILD_CONFIGDIR}/versions.conf" -#source "${BUILD_CONFIGDIR}/Pmodules.conf" +source "${BUILD_CONFIGDIR}/Pmodules.conf" declare -x PREFIX='' declare -x DOCDIR='' From 154d578ecb69b6c3a0b91c8b6b2292bff65c58f9 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 8 Jun 2015 10:57:35 +0200 Subject: [PATCH 3/4] scripts/Bootstrap/Pmodules/modulecmd.in: - bugfix in 'subcommand_use()' --- scripts/Bootstrap/Pmodules/modulecmd.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Bootstrap/Pmodules/modulecmd.in b/scripts/Bootstrap/Pmodules/modulecmd.in index 63371be..38e8220 100755 --- a/scripts/Bootstrap/Pmodules/modulecmd.in +++ b/scripts/Bootstrap/Pmodules/modulecmd.in @@ -1028,7 +1028,7 @@ subcommand_use() { # ... # elif is directory # ... - local modulfiles_dir="${PMODULES_ROOT}/${arg}/${PMODULES_MODULEFILES_DIR}" + local modulefiles_dir="${PMODULES_ROOT}/${arg}/${PMODULES_MODULEFILES_DIR}" if [[ ${arg} == -a ]] || [[ ${arg} == --append ]]; then subcommand_switches='--append' elif [[ ${arg} == -p ]] || [[ ${arg} == --prepend ]]; then From ab9edd13b06274341f7a6ab6d8c42bf3c86ae9f9 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 15 Jun 2015 14:54:02 +0200 Subject: [PATCH 4/4] scripts/Bootstrap/Pmodules/modulecmd.in: bugfixes in subcommand_unuse() --- scripts/Bootstrap/Pmodules/modulecmd.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Bootstrap/Pmodules/modulecmd.in b/scripts/Bootstrap/Pmodules/modulecmd.in index 38e8220..2b57862 100755 --- a/scripts/Bootstrap/Pmodules/modulecmd.in +++ b/scripts/Bootstrap/Pmodules/modulecmd.in @@ -1091,7 +1091,7 @@ subcommand_unuse() { # ... # elif is directory # ... - local modulfiles_dir="${PMODULES_ROOT}/${arg}/${PMODULES_MODULEFILES_DIR}" + local modulefiles_dir="${PMODULES_ROOT}/${arg}/${PMODULES_MODULEFILES_DIR}" if is_release "${arg}"; then remove_path UsedReleases "${arg}" elif [[ ! ${arg} =~ */* ]] && [[ -d ${modulefiles_dir} ]]; then @@ -1099,7 +1099,7 @@ subcommand_unuse() { die 3 "${CMD} ${0##_}: cannot remove group ${arg} from module path" fi remove_path PMODULES_USED_GROUPS "${arg}" - dirs_to_remove+=( ${modulefiles_dir}/${arg} ) + dirs_to_remove+=( ${modulefiles_dir} ) elif [[ -d ${arg} ]]; then local normalized_dir=$(cd "${arg}" && pwd) dirs_to_remove+=( ${normalized_dir} )