summary refs log tree commit diff
path: root/xdbg
blob: 40079b2f6dc3a2224f8f9a240efaa4889756bb46 (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
26
27
28
29
30
31
32
#!/bin/bash
# xdbg PKGS... - list debugging packages for PKGS and recursive dependencies

BRANCH=$(git symbolic-ref -q --short HEAD 2>/dev/null)
XBPS_DISTDIR="$(xdistdir)" || XBPS_DISTDIR=.
ADDREPO="
	--repository=$XBPS_DISTDIR/hostdir/binpkgs/$BRANCH
	--repository=$XBPS_DISTDIR/hostdir/binpkgs/$BRANCH/nonfree
	--repository=$XBPS_DISTDIR/hostdir/binpkgs/$BRANCH/multilib
	--repository=$XBPS_DISTDIR/hostdir/binpkgs/$BRANCH/multilib/nonfree
	--repository=$XBPS_DISTDIR/hostdir/binpkgs/$BRANCH/debug
	--repository=$XBPS_DISTDIR/hostdir/binpkgs
	--repository=$XBPS_DISTDIR/hostdir/binpkgs/nonfree
	--repository=$XBPS_DISTDIR/hostdir/binpkgs/multilib
	--repository=$XBPS_DISTDIR/hostdir/binpkgs/multilib/nonfree
	--repository=$XBPS_DISTDIR/hostdir/binpkgs/debug
"

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)