aboutsummaryrefslogtreecommitdiff
path: root/kiss-reporevdepends
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-05-15 21:03:44 +0300
committerCem Keylan <cem@ckyln.com>2020-05-15 21:03:44 +0300
commit7bfa97d6fa2452d0517c4f820e44033b5a50cd50 (patch)
tree0552a5e5a15335fa672bf181b8725f89d0b35bdf /kiss-reporevdepends
downloadcpt-extra-7bfa97d6fa2452d0517c4f820e44033b5a50cd50.tar.gz
initial commit20200515
Diffstat (limited to 'kiss-reporevdepends')
-rwxr-xr-xkiss-reporevdepends17
1 files changed, 17 insertions, 0 deletions
diff --git a/kiss-reporevdepends b/kiss-reporevdepends
new file mode 100755
index 0000000..59262f0
--- /dev/null
+++ b/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