diff options
author | Justin Davis <jrcd83@gmail.com> | 2012-01-14 22:30:52 +0100 |
---|---|---|
committer | Justin Davis <jrcd83@gmail.com> | 2012-01-14 22:30:52 +0100 |
commit | d24ac50ea29e76a7d4ee0946b6f076b577a133bb (patch) | |
tree | e325bc7369e88e6abfe0f0b93e9fb2830ebbbb2e | |
parent | b33ebaf52259edc14c0dc834a0ed4d0b02cc91a4 (diff) | |
download | genpkg-d24ac50ea29e76a7d4ee0946b6f076b577a133bb.tar.gz genpkg-d24ac50ea29e76a7d4ee0946b6f076b577a133bb.tar.xz |
Better error-checking in genpkg.
-rwxr-xr-x | bin/genpkg | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -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 |