- if [ -n "$TNEWVER" ]; then
- TOLDVER=`echo $TNOTIFY | awk '{ print $3; }'`
- echo "New version found, updating spec file from $TOLDVER to version $TNEWVER"
- if [ "$REVERT_BROKEN_UPGRADE" = "yes" ]; then
- cp -f $SPECFILE $SPECFILE.bak
- fi
- chmod +w $SPECFILE
- set_release $SPECFILE $PACKAGE_RELEASE 1
- set_version $SPECFILE $PACKAGE_VERSION $TNEWVER
- parse_spec
- if [ "$PACKAGE_VERSION" != "$TNEWVER" ]; then
- echo >&2 "Upgrading version failed, you need to update spec yourself"
- exit 1
- fi
- return 1
+ # pldnotify.awk does not set exit codes, but it has match for ERROR
+ # in output which means so.
+ if [[ "$TNOTIFY" = *ERROR* ]]; then
+ echo >&2 "$TNOTIFY"
+ exit 1