[25542] in Source-Commits
/svn/athena r25070 - trunk/debathena/config/auto-update/debian
daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Tue Mar 22 23:05:19 2011
Date: Tue, 22 Mar 2011 23:04:45 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201103230304.p2N34jpt029495@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: jdreed
Date: 2011-03-22 23:04:45 -0400 (Tue, 22 Mar 2011)
New Revision: 25070
Added:
trunk/debathena/config/auto-update/debian/debathena-auto-update.dirs
Modified:
trunk/debathena/config/auto-update/debian/athena-auto-update
trunk/debathena/config/auto-update/debian/changelog
Log:
In auto-update:
* Don't re-run update-hooks once they've been run
* Don't bother to update license-config separately
Modified: trunk/debathena/config/auto-update/debian/athena-auto-update
===================================================================
--- trunk/debathena/config/auto-update/debian/athena-auto-update 2011-03-22 16:13:31 UTC (rev 25069)
+++ trunk/debathena/config/auto-update/debian/athena-auto-update 2011-03-23 03:04:45 UTC (rev 25070)
@@ -198,21 +198,23 @@
chmod 500 $UPDATE_HOOK
SHA256SUM="$(curl -sf --cacert $MITCA $UPDATE_HOOK_SUM)"
rv=$?
- if [ $rv = 0 ]; then
- LOCALSUM="$(sha256sum $UPDATE_HOOK | awk '{print $1}')"
- if [ "$SHA256SUM" = "$LOCALSUM" ]; then
- if ! $UPDATE_HOOK; then
- complain "update hook returned non-zero status"
- exit
- fi
- else
- complain "bad update hook checksum ($SHA256SUM != $LOCALSUM)"
- exit
- fi
- else
+ if [ $rv != 0 ]; then
complain "Failed to retrieve $UPDATE_HOOK_SUM (curl returned $rv)"
exit
fi
+ LOCALSUM="$(sha256sum $UPDATE_HOOK | awk '{print $1}')"
+ if [ "$SHA256SUM" != "$LOCALSUM" ]; then
+ complain "bad update hook checksum ($SHA256SUM != $LOCALSUM)"
+ exit
+ fi
+ if ! [ -f "/var/lib/athena-update-hooks/$SHA256SUM" ]; then
+ if ! $UPDATE_HOOK; then
+ complain "update hook returned non-zero status"
+ exit
+ else
+ touch "/var/lib/athena-update-hooks/$SHA256SUM"
+ fi
+ fi
fi
echo "Running aptitude install"
@@ -260,24 +262,15 @@
exit
fi
-# Update debathena-license-config
-pattern='^0 packages upgraded, 0 newly installed, 0 to remove'
+# If new licenses were installed since the last update, deal.
licenses=/usr/share/debathena-license-config/debathena-license-selections
-if ! v aptitude --simulate --assume-yes install debathena-license-config | grep -q "$pattern"; then
- if ! v aptitude --assume-yes install debathena-license-config; then
- complain "Failed to update debathena-license-config"
- exit
- fi
-fi
-
-# If new licenses were installed, deal.
if [ -f /var/lib/debathena-license-config/reconfigure_required ]; then
rm -f /var/lib/debathena-license-config/reconfigure_require
if [ -f $licenses ]; then
for p in $(awk '{print $1}' $licenses); do
if dpkg-query --showformat '${Status}\n' -W $p 2>/dev/null | grep -q ' installed$'; then
if ! v dpkg-reconfigure -fnoninteractive $p; then
- # Don't fail here
+ # Don't fail here
complain "Failed to dpkg-reconfigure $p"
fi
fi
@@ -291,6 +284,7 @@
# Exit quietly (except for perhaps rebooting) if there are no upgrades
# to take.
+pattern='^0 packages upgraded, 0 newly installed, 0 to remove'
if v aptitude --simulate --assume-yes full-upgrade | grep -q "$pattern"; then
echo "Nothing to do!"
save_success "No updates"
Modified: trunk/debathena/config/auto-update/debian/changelog
===================================================================
--- trunk/debathena/config/auto-update/debian/changelog 2011-03-22 16:13:31 UTC (rev 25069)
+++ trunk/debathena/config/auto-update/debian/changelog 2011-03-23 03:04:45 UTC (rev 25070)
@@ -1,8 +1,10 @@
debathena-auto-update (1.23.1) unstable; urgency=low
* cron.d files don't inherit crontab's path, so set one
+ * Don't re-run update-hooks once they've been run
+ * Don't bother to update license-config separately
- -- Jonathan Reed <jdreed@mit.edu> Tue, 22 Mar 2011 11:11:59 -0400
+ -- Jonathan Reed <jdreed@mit.edu> Tue, 22 Mar 2011 23:04:23 -0400
debathena-auto-update (1.23) unstable; urgency=low
Added: trunk/debathena/config/auto-update/debian/debathena-auto-update.dirs
===================================================================
--- trunk/debathena/config/auto-update/debian/debathena-auto-update.dirs (rev 0)
+++ trunk/debathena/config/auto-update/debian/debathena-auto-update.dirs 2011-03-23 03:04:45 UTC (rev 25070)
@@ -0,0 +1 @@
+var/lib/athena-update-hooks