diff options
Diffstat (limited to 'contrib/kiss-owns')
-rwxr-xr-x | contrib/kiss-owns | 6 |
1 files 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 <file>" ; 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) |