mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-12-25 16:40:07 -07:00
kiss: Make owns follow symlinks.
This commit is contained in:
parent
69471ec52b
commit
68cf91a9d2
9
kiss
9
kiss
@ -958,10 +958,15 @@ args() {
|
|||||||
[ "$1" ] || die "'kiss owns' requires an argument."
|
[ "$1" ] || die "'kiss owns' requires an argument."
|
||||||
|
|
||||||
for file; do
|
for file; do
|
||||||
[ -f "$KISS_ROOT/$file" ] || die "File '$file' doesn't exist."
|
# Strip 'KISS_ROOT' from the file path if passed and
|
||||||
|
# follow symlinks.
|
||||||
|
file=$(realpath "$KISS_ROOT/${file##$KISS_ROOT}")
|
||||||
|
|
||||||
|
[ -f "$file" ] || die "File '$file' doesn't exist."
|
||||||
|
|
||||||
set +f
|
set +f
|
||||||
pkg_owns=$(grep -lFx "$file" "$KISS_ROOT/$pkg_db/"*/manifest)
|
pkg_owns=$(grep -lFx "${file##$KISS_ROOT}" \
|
||||||
|
"$KISS_ROOT/$pkg_db/"*/manifest)
|
||||||
set -f
|
set -f
|
||||||
|
|
||||||
pkg_owns=${pkg_owns%/*}
|
pkg_owns=${pkg_owns%/*}
|
||||||
|
Loading…
Reference in New Issue
Block a user