From 569a6f5d843912a645c3ebb17983468e9b1da1b3 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sat, 13 Oct 2018 18:19:46 +0200 Subject: xgensum: use xdistdir to find the template (as fallback) By @Piraty. Closes #98. --- xgensum | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xgensum b/xgensum index f31fbd2..d744b4e 100755 --- a/xgensum +++ b/xgensum @@ -13,10 +13,14 @@ case "$1" in -i*) FLAG_i=$1; shift esac +XBPS_DISTDIR=$(xdistdir) + if [ -f "$1" ]; then template="$1" elif [ -f "$1/template" ]; then template="$1/template" +elif [ -f "$XBPS_DISTDIR/srcpkgs/$1/template" ]; then + template="$XBPS_DISTDIR/srcpkgs/$1/template" else echo 'Usage: xgensum [-f] [-c] [-i] TEMPLATE' 1>&2 exit 1 @@ -24,7 +28,6 @@ fi . "$template" -XBPS_DISTDIR=$(xdistdir) XBPS_SRCDISTDIR=$($XBPS_DISTDIR/xbps-src show-var XBPS_SRCDISTDIR | tail -1) srcdir="$XBPS_SRCDISTDIR/$pkgname-$version" -- cgit 1.4.1