From 6e9db35aa2b70c8c2cd5d6be54a9ceb8f47f0244 Mon Sep 17 00:00:00 2001 From: Toyam Cox Date: Mon, 21 Mar 2016 23:51:12 -0400 Subject: add xrevshlib Closes: #37 [via git-merge-pr] --- README | 1 + _xtools | 3 ++- xrevshlib | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 xrevshlib 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)" -- cgit 1.4.1