diff --git a/Pmodules/libpbuild.bash b/Pmodules/libpbuild.bash index 9113a18..5e0261e 100644 --- a/Pmodules/libpbuild.bash +++ b/Pmodules/libpbuild.bash @@ -537,7 +537,7 @@ pbuild::prep() { local -r strip="$3" local -r unpacker="$4" { - mkdir -p "${dir}" + ${mkdir} -p "${dir}" pbuild::unpack "${fname}" "${dir}" "${strip}" "${unpacker}" } || { ${rm} -f "${fname}" @@ -1444,12 +1444,13 @@ _build_module() { # cd "${dir}" if typeset -F "$t" 2>/dev/null; then - "$t" || \ - std::die 10 "Aborting..." + "$t" || std::die 10 "Aborting..." + else + std::die 10 "Function is not defined -- $t" fi done - touch "${BUILD_DIR}/.${target}" - } # compile_and_install():build_target() + ${touch} "${BUILD_DIR}/.${target}" + } # build_target() [[ ${dry_run} == yes ]] && std::die 0 "" diff --git a/Pmodules/libstd.bash b/Pmodules/libstd.bash index bc60340..ed1096c 100644 --- a/Pmodules/libstd.bash +++ b/Pmodules/libstd.bash @@ -68,6 +68,7 @@ sevenz=$(std::def_cmd 'sevenz'); declare -r sevenz sort=$(std::def_cmd 'sort'); declare -r sort tar=$(std::def_cmd 'tar'); declare -r tar tee=$(std::def_cmd 'tee'); declare -r tee +touch=$(std::def_cmd 'touch'); declare -r touch tput=$(std::def_cmd 'tput'); declare -r tput uname=$(std::def_cmd 'uname'); declare -r uname yq=$(std::def_cmd 'yq'); declare -r yq diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index 060ce54..853ac5f 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -15,8 +15,8 @@ set -o nounset shopt -s nullglob # get absolute path of script -mydir=$(cd "$(/usr/bin/dirname "$0")" && pwd -L) -prefix=$(/usr/bin/dirname "${mydir}"); +mydir=$(cd "$(/usr/bin/dirname -- "${BASH_SOURCE[0]}")" && pwd -L) +prefix=$(/usr/bin/dirname -- "${mydir}"); path_orig="${PATH}" PATH="${prefix}/bin:${prefix}/libexec:/bin:/usr/bin:/sbin:/usr/sbin"