From 58e094786e4bdece2957d9f5c29a7445d08ae225 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Wed, 4 Mar 2015 11:47:14 +0100 Subject: xdistdir: detect git checkouts. --- xdistdir | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'xdistdir') diff --git a/xdistdir b/xdistdir index ba1b14d..01e4c02 100755 --- a/xdistdir +++ b/xdistdir @@ -1,8 +1,11 @@ #!/bin/sh # xdistdir - figure out XBPS_DISTDIR -if [ -n "$XBPS_DISTDIR" ]; then - echo "$XBPS_DISTDIR" +git_xbps_src="./$(git rev-parse --show-cdup 2>/dev/null)/xbps-src" +if [ -x "$git_xbps_src" ]; then + "$(readlink -f "$git_xbps_src")" show-var XBPS_DISTDIR | tail -1 +elif [ -n "$XBPS_DISTDIR" ]; then + printf '%s\n' "$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 -- cgit 1.4.1