summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJustin Davis <jrcd83@gmail.com>2012-01-14 22:30:52 +0100
committerJustin Davis <jrcd83@gmail.com>2012-01-14 22:30:52 +0100
commitd24ac50ea29e76a7d4ee0946b6f076b577a133bb (patch)
treee325bc7369e88e6abfe0f0b93e9fb2830ebbbb2e /bin
parentb33ebaf52259edc14c0dc834a0ed4d0b02cc91a4 (diff)
downloadgenpkg-d24ac50ea29e76a7d4ee0946b6f076b577a133bb.tar.gz
genpkg-d24ac50ea29e76a7d4ee0946b6f076b577a133bb.tar.xz
Better error-checking in genpkg.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/genpkg23
1 files changed, 14 insertions, 9 deletions
diff --git a/bin/genpkg b/bin/genpkg
index e17b984..066db7b 100755
--- a/bin/genpkg
+++ b/bin/genpkg
@@ -38,16 +38,17 @@ do
[ -d "$pkgd/$pkg" ] || mkdir "$pkgd/$pkg"
cd "$pkgd/$pkg"
- METABIN=$libd/metas PKGVAR=$vard makepkgmeta "$pkg" >PKGMETA
- case $? in
- 0) echo "Generated $pkgd/$pkg/PKGMETA" ;;
- *) exit $?
- esac
+ if METABIN="$libd/metas" PKGVAR="$vard" makepkgmeta "$pkg" > PKGMETA
+ then
+ echo "Generated $pkgd/$pkg/PKGMETA"
+ else
+ exit $?
+ fi
- twk=$tweakd/$pkg
+ twk="$tweakd/$pkg"
if [ -f "$twk" -a -r "$twk" ]
then
- if ! tweakmeta >PKGMETA.new <$twk
+ if ! tweakmeta > PKGMETA.new < "$twk"
then
rm PKGMETA.new
exit 1
@@ -56,6 +57,10 @@ do
echo "Tweaked PKGMETA with $tweakd/$pkg."
fi
- TDIR=$libd/templ makepkgbuild
- echo "Generated $pkgd/$pkg/PKGBUILD"
+ if TDIR="$libd/templ" makepkgbuild
+ then
+ echo "Generated $pkgd/$pkg/PKGBUILD"
+ else
+ exit $?
+ fi
done