From 4a4255350812f1ecebb6f6e22d9300ad5eb0ce2e Mon Sep 17 00:00:00 2001 From: merakor Date: Thu, 14 May 2020 14:08:17 +0000 Subject: kiss-owns: only read the link for the directory, not the file itself FossilOrigin-Name: adfa8d18eac96ea9c5d58b7b0778c25dcf0e3f146dddf5b6071bccc775e7eef0 --- contrib/kiss-owns | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/kiss-owns b/contrib/kiss-owns index e3512d6..c048c86 100755 --- a/contrib/kiss-owns +++ b/contrib/kiss-owns @@ -5,7 +5,9 @@ case "$1" in ''|--help|-h) printf '%s\n' "usage: kiss-owns " ; exit 0 ; es # Strip 'KISS_ROOT' from the file path if passed and # follow symlinks. -file=$(readlink -f "$KISS_ROOT/${1##$KISS_ROOT}") +file="${1#$KISS_ROOT}" +dirname=$(kiss-readlink "$KISS_ROOT/{$file%/*}") +file="$dirname/${file##*/}" # Check if the file exists and exit if it is not. [ -f "$file" ] || { @@ -17,7 +19,7 @@ file=$(readlink -f "$KISS_ROOT/${1##$KISS_ROOT}") # Print the full path to the manifest file which contains # the match to our search. -pkg_owns=$(grep -lFx "${file##$KISS_ROOT}" \ +pkg_owns=$(grep -lFx "${file#$KISS_ROOT}" \ "$KISS_ROOT/var/db/kiss/installed/"*/manifest) -- cgit v1.2.3