about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2014-09-17 16:59:00 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2014-10-10 16:44:40 +0200
commit0f66088d9282543763d92209afd4d045494b8ee3 (patch)
treee2de96dd436b0a62d5d6c22e113ca710a7410f2c
parent1737411a0067967d2449a1fa85717b298e284380 (diff)
downloadxtools-0f66088d9282543763d92209afd4d045494b8ee3.tar.gz
xtools-0f66088d9282543763d92209afd4d045494b8ee3.tar.xz
xtools-0f66088d9282543763d92209afd4d045494b8ee3.zip
xq: add -R
-rw-r--r--README2
-rwxr-xr-xxq12
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