From 0f66088d9282543763d92209afd4d045494b8ee3 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Wed, 17 Sep 2014 16:59:00 +0200 Subject: xq: add -R --- xq | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'xq') diff --git a/xq b/xq index 29a1b48..e3db2b9 100755 --- a/xq +++ b/xq @@ -1,5 +1,5 @@ #!/bin/sh -# xq PKGS... - query information about XBPS package +# xq [-R] PKGS... - query information about XBPS package rmcol() { sed 's/\x1b\[[0-9;]*[mG]//g' @@ -14,12 +14,18 @@ ADDREPO="--repository=hostdir/binpkgs/$BRANCH --repository=../hostdir/binpkgs/$BRANCH --repository=../../hostdir/binpkgs/$BRANCH" +R= +if [ $1 = -R ]; then + R=-R + shift +fi + for pkg; do xbps-query $ADDREPO -S "$pkg" | rmcol | totop short_desc | totop pkgver - xbps-query $ADDREPO -x "$pkg" | sed 's/^/ /;1s/^/depends:\n/' - REVDEP=$(xbps-query -X "$pkg" | sed 's/^/ /' ) + xbps-query $ADDREPO $R -x "$pkg" | sed 's/^/ /;1s/^/depends:\n/' + REVDEP=$(xbps-query $R -X "$pkg" | sed 's/^/ /' ) if [ "$REVDEP" ]; then printf "%s\n" "required-by:" "$REVDEP" fi -- cgit 1.4.1