From cb9fe25776c2e6fde3e10cdaf8bce6cc9abeef48 Mon Sep 17 00:00:00 2001 From: Pratham Date: Fri, 7 Oct 2022 17:12:14 +0200 Subject: [PATCH] kiss-owns: fix usage with KISS_ROOT (#86) Co-authored-by: git-bruh Reviewed-on: https://codeberg.org/kiss-community/kiss/pulls/86 --- contrib/kiss-owns | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/kiss-owns b/contrib/kiss-owns index aa37efd..2531949 100755 --- a/contrib/kiss-owns +++ b/contrib/kiss-owns @@ -4,7 +4,8 @@ # Follow symlinks to any paths. 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 # the match to our search. pkg_owns=$(grep -lFx \ - "$PWD/${1##*/}" \ + "${PWD#"$KISS_ROOT"}/${1##*/}" \ "$KISS_ROOT/var/db/kiss/installed/"*/manifest)