diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2015-09-23 15:14:18 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2015-09-23 15:14:18 +0200 |
commit | 4fc6fbf76f1b9ed06c281b314925f694f7ece72a (patch) | |
tree | 3edb05da4b418d31b32f6b1d87794bbb2d7bf614 /xi | |
parent | 4ed63d17a32b2f8c3939f0465adb00b1f07c018a (diff) | |
download | xtools-4fc6fbf76f1b9ed06c281b314925f694f7ece72a.tar.gz xtools-4fc6fbf76f1b9ed06c281b314925f694f7ece72a.tar.xz xtools-4fc6fbf76f1b9ed06c281b314925f694f7ece72a.zip |
add xi
Diffstat (limited to 'xi')
-rwxr-xr-x | xi | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/xi b/xi new file mode 100755 index 0000000..63a6db3 --- /dev/null +++ b/xi @@ -0,0 +1,20 @@ +#!/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 + --repository=../hostdir/binpkgs + --repository=../../hostdir/binpkgs" + +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 -S "$@" |