summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Davis <jrcd83@gmail.com>2012-01-16 00:30:23 +0100
committerJustin Davis <jrcd83@gmail.com>2012-01-16 00:30:23 +0100
commit2cc568ce2ec38979dde494cd1afd73eeb3673a77 (patch)
tree782da93b9f96f9d12dd126f66c33d54abd77ca0b
parent44f4b5d167f9efef47786e60d1153ad2c58b4319 (diff)
downloadgenpkg-2cc568ce2ec38979dde494cd1afd73eeb3673a77.tar.gz
genpkg-2cc568ce2ec38979dde494cd1afd73eeb3673a77.tar.xz
Fix hard-coded directories in makepkgbuild.
-rwxr-xr-xbin/makepkgbuild12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/makepkgbuild b/bin/makepkgbuild
index 846e3e8..7f9d4bd 100755
--- a/bin/makepkgbuild
+++ b/bin/makepkgbuild
@@ -43,20 +43,20 @@ END
[ -r PKGMETA ] || die 1 "PKGMETA could not be read."
-tdir=~/.genpkg/lib/templ
-[ -d "$tdir" ] || die 1 "template dir ($tdir) not found."
+[ "$TDIR" ] || die 1 "TDIR env. var is unset."
+[ -d "$TDIR" ] || die 1 "template dir ($TDIR) not found."
tcmd=$(awk 'BEGIN { FS="\n"; RS="" } $1 == "template" { print $2 }' PKGMETA)
[ "$tcmd" ] || die 1 "PKGMETA is missing 'template' entry."
set -- $tcmd
-cmd="$tdir/$1"
+cmd="$TDIR/$1"
[ -f "$cmd" -a -x "$cmd" ] \
- || die 2 "template command ($1) not in template dir ($tdir)"
+ || die 2 "template command ($1) not in template dir ($TDIR)"
# Generate the PKGBUILD using basic pbfields script plus custom template.
-"$tdir/pbfields" < PKGMETA > PKGBUILD || die 1 "pbfields returned error ${?}."
-"$tdir"/$tcmd < PKGMETA >> PKGBUILD || die 1 "template pipeline ($tcmd) failed"
+"$TDIR/pbfields" < PKGMETA > PKGBUILD || die 1 "pbfields returned error ${?}."
+"$TDIR"/$tcmd < PKGMETA >> PKGBUILD || die 1 "template pipeline ($tcmd) failed"
# Prepand/append text to the package, check, or build functions.
for func in package check build