about summary refs log tree commit diff
path: root/xq
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 /xq
parent1737411a0067967d2449a1fa85717b298e284380 (diff)
downloadxtools-0f66088d9282543763d92209afd4d045494b8ee3.tar.gz
xtools-0f66088d9282543763d92209afd4d045494b8ee3.tar.xz
xtools-0f66088d9282543763d92209afd4d045494b8ee3.zip
xq: add -R
Diffstat (limited to 'xq')
-rwxr-xr-xxq12
1 files changed, 9 insertions, 3 deletions
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