look for the catalogue beside the installation too

An install under a custom prefix (--prefix ~/.local) could not find the
catalogue it had just cloned into <prefix>/share/myos: only the three system
paths were searched.
This commit is contained in:
Yann Autissier
2026-09-03 18:49:22 +02:00
parent 32e2624245
commit c08c379565
3 changed files with 134 additions and 1 deletions
+6 -1
View File
@@ -15,7 +15,12 @@ myos_path() {
_wd=${WORKDIR:-$PWD}
_name=${STACK_DIR_NAME:-stack}
_out=
for _d in "$_wd" "$_wd/.." "${HOME:-/nonexistent}/.local/share" /usr/local/share /usr/share; do
# <prefix>/share comes from MYOS_ROOT, so an installation under any prefix
# finds the catalogue installed beside it
_prefix=
[ -n "${MYOS_ROOT:-}" ] && _prefix=$(dirname "$(dirname "$MYOS_ROOT")")/share
for _d in "$_wd" "$_wd/.." "${HOME:-/nonexistent}/.local/share" \
${_prefix:+"$_prefix"} /usr/local/share /usr/share; do
for _c in "$_d/$_name" "$_d/myos/$_name"; do
[ -d "$_c" ] || continue
_c=$(cd "$_c" && pwd -P)