You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by do...@apache.org on 2010/02/16 04:38:08 UTC
svn commit: r910384 -
/spamassassin/trunk/build/mkupdates/mkupdate-with-scores
Author: dos
Date: Tue Feb 16 03:38:07 2010
New Revision: 910384
URL: http://svn.apache.org/viewvc?rev=910384&view=rev
Log:
fix update copy/publish failure abort code
Modified:
spamassassin/trunk/build/mkupdates/mkupdate-with-scores
Modified: spamassassin/trunk/build/mkupdates/mkupdate-with-scores
URL: http://svn.apache.org/viewvc/spamassassin/trunk/build/mkupdates/mkupdate-with-scores?rev=910384&r1=910383&r2=910384&view=diff
==============================================================================
--- spamassassin/trunk/build/mkupdates/mkupdate-with-scores (original)
+++ spamassassin/trunk/build/mkupdates/mkupdate-with-scores Tue Feb 16 03:38:07 2010
@@ -111,7 +111,11 @@
set +e
cp $SRC $DST
- diff -u $SRC $DST || ( set -e && return 1 )
+ diff -u $SRC $DST
+ if [ $? -ne 0 ]; then
+ set -e
+ return 1
+ fi
set -e
return 0
}
@@ -204,16 +208,22 @@
if [ $UPDATED_VERSIONS -gt 0 ]; then
# be careful, we want to make sure that the DNS records are always in a good state;
# even if we end up exiting unexpectedly due to an error
+ EXIT=0
(
copy_update_paranoid "$TMPDIR/$REVISION.tar.gz" "$UPDATEDIR/$REVISION.tar.gz" &&
copy_update_paranoid "$TMPDIR/$REVISION.tar.gz.asc" "$UPDATEDIR/$REVISION.tar.gz.asc" &&
copy_update_paranoid "$TMPDIR/$REVISION.tar.gz.sha1" "$UPDATEDIR/$REVISION.tar.gz.sha1" &&
chmod 544 $UPDATEDIR/$REVISION.tar.gz*
- ) || (
+ ) || EXIT=5
+
+ # copying the update files went wrong, revert dns and exit
+ if [ $EXIT -gt 0 ]; then
for (( I=0; I<=$MINOR_VERS; I++ )); do
- revert_dns_record "3.3.$MINOR_VERS"
+ revert_dns_record "3.3.$I"
done
- )
+ exit $EXIT
+ fi
+
# schedule dns commit/reload atq job
# note that we're probably not going to be able to commit the DNS changes
# until the update tarball mirrors have had time to sync since the ASF