[27120] in Source-Commits
/svn/athena r25959 - trunk/debathena/config/auto-update/debian
daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Thu May 2 11:52:37 2013
Date: Thu, 2 May 2013 11:52:30 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201305021552.r42FqUsh012251@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: jdreed
Date: 2013-05-02 11:52:30 -0400 (Thu, 02 May 2013)
New Revision: 25959
Modified:
trunk/debathena/config/auto-update/debian/athena-auto-upgrade
Log:
Clean up logic, and ensure that upgrader exits if reinstalls are
possible but the machine is too new.
Modified: trunk/debathena/config/auto-update/debian/athena-auto-upgrade
===================================================================
--- trunk/debathena/config/auto-update/debian/athena-auto-upgrade 2013-05-02 14:08:11 UTC (rev 25958)
+++ trunk/debathena/config/auto-update/debian/athena-auto-upgrade 2013-05-02 15:52:30 UTC (rev 25959)
@@ -159,16 +159,19 @@
[ $? != 0 ] && complain "Failed to get clusterinfo" && exit 1
eval $CLUSTERINFO
REINSTALL=no
+UBUNTU_RELEASE=
if [ ! -z "$NEW_PRODUCTION_RELEASE" ]; then
debug "Taking new production release: $NEW_PRODUCTION_RELEASE"
NEWCLUSTER=`getcluster -b $NEW_PRODUCTION_RELEASE`
[ $? != 0 ] && complain "Failed to get clusterinfo" && exit 1
+ # This will set UBUNTU_RELEASE
eval $NEWCLUSTER
elif [ ! -z "$NEW_TESTING_RELEASE" ] && \
[ "$UPGRADE_TO_TESTING" = "yes" ]; then
debug "Taking new testing release: $NEW_TESTING_RELEASE"
NEWCLUSTER=`getcluster -b $NEW_TESTING_RELEASE`
[ $? != 0 ] && complain "Failed to get clusterinfo" && exit 1
+ # This will set UBUNTU_RELEASE
eval $NEWCLUSTER
elif [ ! -z "$REINSTALL_AT" ] && echo $REINSTALL_AT | grep -qx '[0-9]*'; then
debug "Found REINSTALL_AT = $REINSTALL_AT ..."
@@ -183,20 +186,20 @@
REINSTALL=yes
UBUNTU_RELEASE="$(lsb_release -sc)"
fi
-else
- if [[ ! -z "$DEBUG_RELEASE" ]]; then
+fi
+if [ "$(lsb_release -sc)" = "$UBUNTU_RELEASE" ] && \
+ [ "$REINSTALL" = "no" ]; then
+ complain "Tried to upgrade to already running release; shouldn't happen"
+ exit 1
+fi
+if [ -z "$UBUNTU_RELEASE" ]; then
+ if [ -n "$DEBUG_RELEASE" ]; then
UBUNTU_RELEASE=$DEBUG_RELEASE
else
echo "No new releases found."
exit 0
fi
fi
-if [ "$(lsb_release -sc)" = "$UBUNTU_RELEASE" ]; then
- if [ "$REINSTALL" = "no" ]; then
- complain "Tried to upgrade to already running release; shouldn't happen"
- exit 1
- fi
-fi
echo "Found $UBUNTU_RELEASE, starting upgrade"
# That's a space and then a tab inside the brackets