summary refs log tree commit diff
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
parent82a4415efdd8f3536885782ffe2b8e3378a04a63 (diff)
downloadxtools-0.37.tar.gz
xtools-0.37.tar.xz
xtools-0.37.zip
add xrevshlib v0.37
Closes: #37 [via git-merge-pr]
-rw-r--r--README1
-rw-r--r--_xtools3
-rwxr-xr-xxrevshlib14
3 files changed, 17 insertions, 1 deletions
diff --git a/README b/README
index 9d36263..7fe9327 100644
--- a/README
+++ b/README
@@ -34,6 +34,7 @@ https://github.com/voidlinux/xbps
   xq [-R] PKGS... - query information about XBPS package
   xrecent [REPOURL|XBPS_ARCH] - list packages in repo ordered by build date
   xrevbump MESSAGE TEMPLATES... - increase template revision and commit
+  xrevshlib PACKAGE - list packages shlib-dependent on PACKAGE or its subpkgs
   xrs PATTERN - like xbps-query -Rs, but take cwd repo into account
   xsrc PKG - list source files for XBPS template
   xsubpkg [-m] PKG - lists all subpackages of a package
diff --git a/_xtools b/_xtools
index 4c04c58..934cae0 100644
--- a/_xtools
+++ b/_xtools
@@ -1,4 +1,4 @@
-#compdef xbulk xbump xcheckrestart xdiff xdbg xdowngrade xgensum xgrep xlg xlog xlocate xls xmindep xmypkgs xnew xoptdiff xpkg xq xrecent xrevbump xsrc
+#compdef xbulk xbump xcheckrestart xdiff xdbg xdowngrade xgensum xgrep xlg xlog xlocate xls xmindep xmypkgs xnew xoptdiff xpkg xq xrecent xrevbump xrevshlib xsrc
 
 _xbps  # force autoload
 
@@ -139,6 +139,7 @@ _xtools() {
 		xq) _xq "$@";;
 		xrecent) _xrecent "$@";;
 		xrevbump) _xrevbump "$@";;
+		xrevshlib) _xtools_one_template "$@";;
 		xsrc) _xtool_one_template "$@";;
 		xsubpkg) _xsubpkg "$@";;
 	esac
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)"