kiss-owns: fix usage with KISS_ROOT (#86)

Co-authored-by: git-bruh <e817509a-8ee9-4332-b0ad-3a6bdf9ab63f@aleeas.com>
Reviewed-on: https://codeberg.org/kiss-community/kiss/pulls/86
This commit is contained in:
Pratham 2022-10-07 17:12:14 +02:00
parent e9c72295d6
commit cb9fe25776

View File

@ -4,7 +4,8 @@
# Follow symlinks to any paths. # Follow symlinks to any paths.
case $1 in case $1 in
/*) /*)
cd -P "$KISS_ROOT${1%/*}" cd -P "${KISS_ROOT:-/}${1%/*}"
[ "$PWD" = / ] && KISS_ROOT=
;; ;;
*/*) */*)
@ -24,7 +25,7 @@ esac
# Print the full path to the manifest file which contains # Print the full path to the manifest file which contains
# the match to our search. # the match to our search.
pkg_owns=$(grep -lFx \ pkg_owns=$(grep -lFx \
"$PWD/${1##*/}" \ "${PWD#"$KISS_ROOT"}/${1##*/}" \
"$KISS_ROOT/var/db/kiss/installed/"*/manifest) "$KISS_ROOT/var/db/kiss/installed/"*/manifest)