about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPiraty <piraty1@inbox.ru>2020-10-27 14:39:48 +0100
committerLeah Neukirchen <leah@vuxu.org>2020-10-27 14:55:29 +0100
commitc2ae716b2347fec55332798fe991132e27ab6163 (patch)
tree015b4abf22a52c9dbb3cf4135997bed68c01a601
parentb57be870448b58d44bcd07b0ade631f96548aacc (diff)
downloadxtools-c2ae716b2347fec55332798fe991132e27ab6163.tar.gz
xtools-c2ae716b2347fec55332798fe991132e27ab6163.tar.xz
xtools-c2ae716b2347fec55332798fe991132e27ab6163.zip
xi: take XBPS_HOSTDIR into account
-rwxr-xr-xxi27
1 files changed, 16 insertions, 11 deletions
diff --git a/xi b/xi
index a603c04..0541b3c 100755
--- a/xi
+++ b/xi
@@ -2,18 +2,23 @@
 # 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)
-XBPS_DISTDIR="$(xdistdir 2>/dev/null)" || XBPS_DISTDIR=.
+if [ -n "$XBPS_HOSTDIR" ]; then
+	XBPS_BINPKGS="$XBPS_HOSTDIR/binpkgs"
+else
+	XBPS_DISTDIR="$(xdistdir 2>/dev/null)" || XBPS_DISTDIR=.
+	XBPS_BINPKGS="$XBPS_DISTDIR/hostdir/binpkgs"
+fi
 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
+	--repository=$XBPS_BINPKGS/$BRANCH
+	--repository=$XBPS_BINPKGS/$BRANCH/nonfree
+	--repository=$XBPS_BINPKGS/$BRANCH/multilib
+	--repository=$XBPS_BINPKGS/$BRANCH/multilib/nonfree
+	--repository=$XBPS_BINPKGS/$BRANCH/debug
+	--repository=$XBPS_BINPKGS
+	--repository=$XBPS_BINPKGS/nonfree
+	--repository=$XBPS_BINPKGS/multilib
+	--repository=$XBPS_BINPKGS/multilib/nonfree
+	--repository=$XBPS_BINPKGS/debug
 "
 
 SUDO=