about summary refs log tree commit diff
path: root/xrevshlib
diff options
context:
space:
mode:
authorToyam Cox <Vaelatern@gmail.com>2016-03-21 23:51:12 -0400
committerChristian Neukirchen <chneukirchen@gmail.com>2016-03-22 20:25:42 +0100
commit6e9db35aa2b70c8c2cd5d6be54a9ceb8f47f0244 (patch)
treefe07c34d819984a6e7f26d9d4e7aa07b90d7e056 /xrevshlib
parent82a4415efdd8f3536885782ffe2b8e3378a04a63 (diff)
downloadxtools-6e9db35aa2b70c8c2cd5d6be54a9ceb8f47f0244.tar.gz
xtools-6e9db35aa2b70c8c2cd5d6be54a9ceb8f47f0244.tar.xz
xtools-6e9db35aa2b70c8c2cd5d6be54a9ceb8f47f0244.zip
add xrevshlib v0.37
Closes: #37 [via git-merge-pr]
Diffstat (limited to 'xrevshlib')
-rwxr-xr-xxrevshlib14
1 files changed, 14 insertions, 0 deletions
diff --git a/xrevshlib b/xrevshlib
new file mode 100755
index 0000000..c533868
--- /dev/null
+++ b/xrevshlib
@@ -0,0 +1,14 @@
+#!/bin/sh
+# xrevshlib PACKAGE - list packages shlib-dependent on PACKAGE or its subpkgs
+
+pkg="${1?no package name given}"
+
+xsubpkg "$pkg" |
+	xargs -d'\n' -n1 -r xbps-query -R -p shlib-provides -S |
+	sed 's/\.so.*//' |
+	xargs -d'\n' -n1 -r xbps-query -R -p shlib-requires -s |
+	sed 's/-[^- ]*: .*//' |
+	sort -u |
+	xargs -d'\n' -n1 -r xsubpkg -m |
+	sort -u |
+	grep -Fvx "$(xsubpkg -m $pkg)"