commit 5f6396165ba2cc6958a2ce409c2725993fca9d09 parent b6d86ccb4b6dfd1ae4aed02f3930c6a72f4608b2 Author: Cem Keylan <cem@ckyln.com> Date: Wed, 6 May 2020 22:02:40 +0300 contrib: add kiss-reporevdepends Diffstat:
A | contrib/kiss-reporevdepends | | | 20 | ++++++++++++++++++++ |
1 file changed, 20 insertions(+), 0 deletions(-)
diff --git a/contrib/kiss-reporevdepends 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