about summary refs log tree commit diff
path: root/xdistdir
blob: ba1b14d4da5064648f137c08e234015b2960f814 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
# xdistdir - figure out XBPS_DISTDIR

if [ -n "$XBPS_DISTDIR" ]; then
	echo "$XBPS_DISTDIR"
elif [ -x "$(command -v xbps-src)" ]; then
	"$(readlink -f "$(command -v xbps-src)")" show-var XBPS_DISTDIR | tail -1
elif [ -d ~/void-packages ]; then
	echo ~/void-packages
elif [ -d ~/xbps-packages ]; then
	echo ~/xbps-packages
elif [ -d ~/src/void-packages ]; then
	echo ~/src/void-packages
elif [ -d ~/src/xbps-packages ]; then
	echo ~/src/xbps-packages
else
	echo "xdistdir: no idea, giving up" 1>&2
	exit 111
fi