about summary refs log tree commit diff
path: root/xq
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2014-07-30 15:54:20 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2014-07-30 15:54:20 +0200
commit8b1ac0bf2c0434749f5e7d87d9840c2030228174 (patch)
treeceb4842a64185cb6e0652a21131cf6a477fe61d9 /xq
downloadxtools-8b1ac0bf2c0434749f5e7d87d9840c2030228174.tar.gz
xtools-8b1ac0bf2c0434749f5e7d87d9840c2030228174.tar.xz
xtools-8b1ac0bf2c0434749f5e7d87d9840c2030228174.zip
initial import of xtools
Diffstat (limited to 'xq')
-rwxr-xr-xxq17
1 files changed, 17 insertions, 0 deletions
diff --git a/xq b/xq
new file mode 100755
index 0000000..34f26c7
--- /dev/null
+++ b/xq
@@ -0,0 +1,17 @@
+#!/bin/sh
+# xq PKGS... - query information about XBPS package
+
+BRANCH=$(git symbolic-ref -q --short HEAD 2>/dev/null)
+ADDREPO="--repository=hostdir/binpkgs/$BRANCH
+	--repository=../hostdir/binpkgs/$BRANCH
+	--repository=../../hostdir/binpkgs/$BRANCH"
+
+for pkg; do
+	xbps-query $ADDREPO -S "$pkg"
+	xbps-query $ADDREPO -x "$pkg" | sed 's/^/	/;1s/^/depends:\n/'
+	REVDEP=$(xbps-query -X "$pkg" | sed 's/^/	/' )
+	if [ "$REVDEP" ]; then
+		printf "%s\n" "required-by:" "$REVDEP"
+	fi
+done
+