From 29be38d2671db067c86e07fa6177cd14055a32ea Mon Sep 17 00:00:00 2001 From: Justin Davis Date: Fri, 1 Jun 2012 13:34:51 -0400 Subject: Fix error handling when prepkg fails. Typo fixed in prepkg. Do not duplicate pkgver unless we are going to modify the package. Pipes screw up the error code returned. vervar silently ignores a missing _ver field. --- bin/genpkg | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'bin/genpkg') diff --git a/bin/genpkg b/bin/genpkg index ef78e29..047a07f 100755 --- a/bin/genpkg +++ b/bin/genpkg @@ -104,20 +104,20 @@ do # Duplicate the version in case modpkg modifies it. vervar will remove a # redundant ver field that is the same as pkgver. trap 'rm -f PKGDATA' 1 2 15 - if PREPSPATH="$prepd" PKGVAR="$vard" prepkg "$pkg" | dupver > PKGDATA - then - echo "$pkgd/$pkg" - else - rm PKGDATA - exit "$?" - fi + PREPSPATH="$prepd" PKGVAR="$vard" prepkg "$pkg" > PKGDATA + ret=$? + case $ret in + 0) echo "$pkgd/$pkg" ;; + *) rm PKGDATA + exit $ret + esac trap '' 1 2 15 mod="$modsd/$pkg" if [ -f "$mod" -a -r "$mod" ] then trap 'rm -f PKGDATA.new' 1 2 15 - if modpkg "$mod" < PKGDATA > PKGDATA.new + if cat PKGDATA | dupver | modpkg "$mod" > PKGDATA.new then echo "Modified with $mod." 1>&2 mv PKGDATA.new PKGDATA -- cgit v1.2.3-24-g4f1b