about summary refs log tree commit diff
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
parent851321b76336ac9ab85b30c447b6ea7c622991a2 (diff)
downloadxtools-c9b8b5f3c255385a752b01f449834c12911a0a04.tar.gz
xtools-c9b8b5f3c255385a752b01f449834c12911a0a04.tar.xz
xtools-c9b8b5f3c255385a752b01f449834c12911a0a04.zip
add xdbg
-rw-r--r--README1
-rwxr-xr-xxdbg25
2 files changed, 26 insertions, 0 deletions
diff --git a/README b/README
index 09056ba..7f1756f 100644
--- a/README
+++ b/README
@@ -8,6 +8,7 @@ https://github.com/voidlinux/xbps
   xbump PKGNAME [git commit options] - git commit a version bump
   xcheckrestart [-v] - list programs using outdated libraries
   xclash - detect file conflicts between XBPS packages
+  xdbg PKGS... - list debugging packages for PKGS and recursive dependencies
   xdiff [-u|-l] [DIR] - merge/diff/list XBPS .new-* files
   xdistdir - figure out XBPS_DISTDIR
   xdowngrade PKGS.xbps... - install XBPS package directly from .xbps file
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)