about summary refs log tree commit diff
path: root/xdbg
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-09-23 15:17:21 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2015-09-23 15:17:21 +0200
commitc9b8b5f3c255385a752b01f449834c12911a0a04 (patch)
treef2e9a7ad6288ec9bea23530a261f429b5cb8b83b /xdbg
parent851321b76336ac9ab85b30c447b6ea7c622991a2 (diff)
downloadxtools-c9b8b5f3c255385a752b01f449834c12911a0a04.tar.gz
xtools-c9b8b5f3c255385a752b01f449834c12911a0a04.tar.xz
xtools-c9b8b5f3c255385a752b01f449834c12911a0a04.zip
add xdbg
Diffstat (limited to 'xdbg')
-rwxr-xr-xxdbg25
1 files changed, 25 insertions, 0 deletions
diff --git a/xdbg b/xdbg
new file mode 100755
index 0000000..793da33
--- /dev/null
+++ b/xdbg
@@ -0,0 +1,25 @@
+#!/bin/bash
+# xdbg PKGS... - list debugging packages for PKGS and recursive dependencies
+
+BRANCH=$(git symbolic-ref -q --short HEAD 2>/dev/null)
+ADDREPO="--repository=hostdir/binpkgs/$BRANCH
+	--repository=../hostdir/binpkgs/$BRANCH
+	--repository=../../hostdir/binpkgs/$BRANCH
+	--repository=hostdir/binpkgs
+	--repository=../hostdir/binpkgs
+	--repository=../../hostdir/binpkgs"
+
+alldbg() {
+	xbps-query --regex $ADDREPO -Rs '-dbg-[^-]*$' |
+		sed 's/^... //; s/-[^- ]* .*//' |
+		sort -u
+}
+
+depdbg() {
+	for pkg; do
+		printf "%s-0\n" "$pkg"
+		xbps-query --fulldeptree $ADDREPO -x "$pkg"
+	done | sed 's/-[^-]*$/-dbg/' | sort -u
+}
+
+comm -12 <(depdbg "$@") <(alldbg)