diff options
author | Cem Keylan <cem@ckyln.com> | 2020-05-28 16:45:43 +0300 |
---|---|---|
committer | Cem Keylan <cem@ckyln.com> | 2020-05-28 16:45:43 +0300 |
commit | 1dabf5a8d511db458dd529588e57a8ed8185787a (patch) | |
tree | c5905caa9b93fa4c63ee5e8e8dbdccd53d5aca53 /repo/kiss-reporevdepends | |
parent | 7bfa97d6fa2452d0517c4f820e44033b5a50cd50 (diff) | |
download | cpt-extra-1dabf5a8d511db458dd529588e57a8ed8185787a.tar.gz |
added new utilities, changed repository structure20200528
Diffstat (limited to 'repo/kiss-reporevdepends')
-rwxr-xr-x | repo/kiss-reporevdepends | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/repo/kiss-reporevdepends b/repo/kiss-reporevdepends new file mode 100755 index 0000000..59262f0 --- /dev/null +++ b/repo/kiss-reporevdepends @@ -0,0 +1,17 @@ +#!/bin/sh +# Display packages on the repository which depend on package +# shellcheck disable=2086 + +case "$1" in ''|--help|-h) printf 'usage: %s <pkg>\n' "${0##*/}"; exit 0; esac + +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 |