about summary refs log tree commit diff
path: root/xgensum
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2018-10-13 18:19:46 +0200
committerLeah Neukirchen <leah@vuxu.org>2018-10-13 18:19:46 +0200
commit569a6f5d843912a645c3ebb17983468e9b1da1b3 (patch)
treec05b2b75d31d3f3fbf52dd6e1b3a8835b83a1827 /xgensum
parentb1e4fdbc64fdc84dffcb60d564b7baa66c1b1a4a (diff)
downloadxtools-569a6f5d843912a645c3ebb17983468e9b1da1b3.tar.gz
xtools-569a6f5d843912a645c3ebb17983468e9b1da1b3.tar.xz
xtools-569a6f5d843912a645c3ebb17983468e9b1da1b3.zip
xgensum: use xdistdir to find the template (as fallback)
By @Piraty.

Closes #98.
Diffstat (limited to 'xgensum')
-rwxr-xr-xxgensum5
1 files changed, 4 insertions, 1 deletions
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"