summary refs log tree commit diff
path: root/xdbg
blob: 793da33f145734e89e4369a12a6049c3543dc4e8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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)