From 4fc6fbf76f1b9ed06c281b314925f694f7ece72a Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Wed, 23 Sep 2015 15:14:18 +0200 Subject: add xi --- xi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 xi (limited to 'xi') 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 "$@" -- cgit 1.4.1