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 --- README | 2 +- xq | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README b/README index ef26b53..2e5d860 100644 --- a/README +++ b/README @@ -17,7 +17,7 @@ https://github.com/voidlinux/xbps xnew PKG - create XBPS template template xnuxnu PKG - upstream version checker for XBPS templates xoptdiff [-q] [PKGS...] - show template options which differ from binary package - xq PKGS... - query information about XBPS package + xq [-R] PKGS... - query information about XBPS package xsrc PKG - list source files for XBPS template Tools working on the void-packages tree use xdistdir to find it, 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