about summary refs log tree commit diff
path: root/xi
blob: 8a8e2a8a1866303d2af4426a76a13cf1b7ecb06e (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh
# xi PKGS... - like xbps-install -S, but take cwd repo and sudo/su into account

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/$BRANCH/nonfree
	--repository=../hostdir/binpkgs/$BRANCH/nonfree
	--repository=../../hostdir/binpkgs/$BRANCH/nonfree
	--repository=hostdir/binpkgs/$BRANCH/multilib
	--repository=../hostdir/binpkgs/$BRANCH/multilib
	--repository=../../hostdir/binpkgs/$BRANCH/multilib
	--repository=hostdir/binpkgs/$BRANCH/multilib/nonfree
	--repository=../hostdir/binpkgs/$BRANCH/multilib/nonfree
	--repository=../../hostdir/binpkgs/$BRANCH/multilib/nonfree
	--repository=hostdir/binpkgs/$BRANCH/debug
	--repository=../hostdir/binpkgs/$BRANCH/debug
	--repository=../../hostdir/binpkgs/$BRANCH/debug
	--repository=hostdir/binpkgs
	--repository=../hostdir/binpkgs
	--repository=../../hostdir/binpkgs
	--repository=hostdir/binpkgs/nonfree
	--repository=../hostdir/binpkgs/nonfree
	--repository=../../hostdir/binpkgs/nonfree
	--repository=hostdir/binpkgs/multilib
	--repository=../hostdir/binpkgs/multilib
	--repository=../../hostdir/binpkgs/multilib
	--repository=hostdir/binpkgs/multilib/nonfree
	--repository=../hostdir/binpkgs/multilib/nonfree
	--repository=../../hostdir/binpkgs/multilib/nonfree
	--repository=hostdir/binpkgs/debug
	--repository=../hostdir/binpkgs/debug
	--repository=../../hostdir/binpkgs/debug
"

SUDO=
if command -v sudo >/dev/null &&
   sudo -l | grep -q -e ' ALL$' -e xbps-install; then
	SUDO=sudo
elif [ "$(whoami)" != root ]; then
	SUDO='su root -c '\''"$@"'\'' -- -'
fi

$SUDO xbps-install $ADDREPO -S "$@"