mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-07-04 04:40:50 +02:00
modulecmd/libpmodules: bugfixes in scaning group depths
This commit is contained in:
@@ -43,7 +43,7 @@ compute_group_depth () {
|
||||
test -d "${dir}" || return 1
|
||||
local group=${dir%/*}
|
||||
local group=${group##*/}
|
||||
local -i result=$(${find} "${dir}" -depth \( -type f -o -type l \) \
|
||||
result=$(${find} "${dir}" -depth \( -type f -o -type l \) \
|
||||
-printf "%d" -quit 2>/dev/null)
|
||||
(( result-=2 ))
|
||||
# if a group doesn't contain a modulefile, depth is negativ
|
||||
@@ -59,12 +59,14 @@ compute_group_depth () {
|
||||
#
|
||||
scan_groups () {
|
||||
local ol
|
||||
local depth
|
||||
for ol in "$@"; do
|
||||
local mod_root="${OverlayInfo[${ol}:mod_root]}"
|
||||
local -i depth
|
||||
local dir
|
||||
for dir in ${mod_root}/*/${PMODULES_MODULEFILES_DIR}; do
|
||||
if [[ -n "${GroupDepths[${group}]}" ]]; then
|
||||
local group="${dir%/*}"
|
||||
group="${group##*/}"
|
||||
if [[ ! -v GroupDepths[${group}] ]]; then
|
||||
compute_group_depth depth "${dir}"
|
||||
GroupDepths[$group]=${depth}
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user