From 23c72df04dff42284afee7e7fc996f1c75e159b9 Mon Sep 17 00:00:00 2001 From: "dylan.araps@gmail.com" Date: Sun, 21 Jul 2019 22:35:34 +0000 Subject: kiss: Make owns work with multiple files. FossilOrigin-Name: b525d3c344eeb1049591ee2c2bec1df7f8980e220ca0005970280c106fb6b30b --- README.md | 2 ++ kiss | 17 ++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 018fd1c..fd2a972 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ export KISS_PATH=/packages/core:/packages/extra:/packages/xorg:/packages/public => depends: List package dependencies. => install: Install a package (Runs build if needed). => list: List packages. +=> manifest: List package files owned by package. +=> owns: Check which package owns a file. => remove: Remove a package. => search: Search for a package. => update: Check for updates. diff --git a/kiss b/kiss index a9b5ff7..8fca6f3 100755 --- a/kiss +++ b/kiss @@ -932,16 +932,19 @@ args() { o*) shift [ "$1" ] || die "'kiss owns' requires an argument." - [ -f "$KISS_ROOT/$1" ] || die "File '$1' doesn't exist." - set +f - pkg_owns=$(grep -lFx "$1" "$KISS_ROOT/$pkg_db/"*/manifest) - set -f + for file; do + [ -f "$KISS_ROOT/$file" ] || die "File '$file' doesn't exist." - pkg_owns=${pkg_owns%/*} - pkg_owns=${pkg_owns##*/} + set +f + pkg_owns=$(grep -lFx "$file" "$KISS_ROOT/$pkg_db/"*/manifest) + set -f - log "[$pkg_owns] owns '$1'" + pkg_owns=${pkg_owns%/*} + pkg_owns=${pkg_owns##*/} + + log "[$pkg_owns] owns '$file'" + done ;; # Upgrade packages. -- cgit v1.2.3