about summary refs log tree commit diff
diff options
context:
space:
mode:
-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)