diff options
author | merakor <cem@ckyln.com> | 2020-05-06 19:02:40 +0000 |
---|---|---|
committer | merakor <cem@ckyln.com> | 2020-05-06 19:02:40 +0000 |
commit | 5c1d2af06537339e5d8bef02529202db5c55b3e4 (patch) | |
tree | 1c2b624dcade5080375e6e463112683aae6c9714 | |
parent | 6907edfc4025c93bae4542039f9484cfa21b6aee (diff) | |
download | cpt-5c1d2af06537339e5d8bef02529202db5c55b3e4.tar.gz |
contrib: add kiss-reporevdepends
FossilOrigin-Name: a813819e2cd2f8e220f32729296a1b8ca46165c879382662b4173f5421ee8978
-rwxr-xr-x | contrib/kiss-reporevdepends | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/kiss-reporevdepends b/contrib/kiss-reporevdepends new file mode 100755 index 0000000..1a83c33 --- /dev/null +++ b/contrib/kiss-reporevdepends @@ -0,0 +1,20 @@ +#!/bin/sh +# Display packages on the repository which depend on package +# shellcheck disable=2086 + +[ "$1" ] || { + printf 'usage: %s <pkg>\n' "${0##*/}" + exit 1 +} + +pkg="$1" +IFS=:; set -- $KISS_PATH; unset IFS + +for repo do + # Change directory to the upper directory of the repository + # so it outputs packages in this nice looking format. + # repository/package: + cd "$repo/.." ||: + # This grep only checks for the full word + grep "^$pkg\$\|^$pkg\s" -- "${repo##*/}"/*/depends 2>/dev/null ||: +done |