diff options
author | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2019-07-31 14:52:13 +0000 |
---|---|---|
committer | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2019-07-31 14:52:13 +0000 |
commit | 42e4e617bd8de0568d4eb5d64cf75f76b3a81301 (patch) | |
tree | 350c14a39d464a1daaa3880542fbbfce637532c6 | |
parent | c79ab11b5ffab8faafa095494e593bf89699686a (diff) | |
download | cpt-42e4e617bd8de0568d4eb5d64cf75f76b3a81301.tar.gz |
kiss: Make owns follow symlinks.
FossilOrigin-Name: abea1242dd96a73c4f269fa68f3879666991e44882b2f9037b2c396a96d4e35f
-rwxr-xr-x | kiss | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -958,10 +958,15 @@ args() { [ "$1" ] || die "'kiss owns' requires an argument." 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 - pkg_owns=$(grep -lFx "$file" "$KISS_ROOT/$pkg_db/"*/manifest) + pkg_owns=$(grep -lFx "${file##$KISS_ROOT}" \ + "$KISS_ROOT/$pkg_db/"*/manifest) set -f pkg_owns=${pkg_owns%/*} |