[26634] in Source-Commits

home help back first fref pref prev next nref lref last post

/svn/athena r25668 - trunk/debathena/debathena/thirdparty-installer/debian

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Sat Jul 28 11:10:02 2012

Date: Sat, 28 Jul 2012 11:10:00 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201207281510.q6SFA07T032416@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: jdreed
Date: 2012-07-28 11:09:59 -0400 (Sat, 28 Jul 2012)
New Revision: 25668

Modified:
   trunk/debathena/debathena/thirdparty-installer/debian/control
   trunk/debathena/debathena/thirdparty-installer/debian/thirdparty
Log:
Provide a way for the package to know about changes to the list via md5sums

Modified: trunk/debathena/debathena/thirdparty-installer/debian/control
===================================================================
--- trunk/debathena/debathena/thirdparty-installer/debian/control	2012-07-27 18:04:12 UTC (rev 25667)
+++ trunk/debathena/debathena/thirdparty-installer/debian/control	2012-07-28 15:09:59 UTC (rev 25668)
@@ -7,7 +7,7 @@
 
 Package: debathena-thirdparty-installer
 Architecture: all
-Depends: libapt-pkg-perl, ${misc:Depends}
+Depends: libapt-pkg-perl, coreutils, ${misc:Depends}
 Description: Debathena thirdparty software installer
  This ships an installer that installs "third party software" in a
  separate APT transaction.  It is only intended for use on public,

Modified: trunk/debathena/debathena/thirdparty-installer/debian/thirdparty
===================================================================
--- trunk/debathena/debathena/thirdparty-installer/debian/thirdparty	2012-07-27 18:04:12 UTC (rev 25667)
+++ trunk/debathena/debathena/thirdparty-installer/debian/thirdparty	2012-07-28 15:09:59 UTC (rev 25668)
@@ -66,6 +66,8 @@
     if ! /usr/lib/debathena-thirdparty/generate-package-list.pl -d "$LISTDIR" -c "$CACHEDIR"; then
 	exit 1
     fi
+    md5sum "${LISTDIR}/common" > "${CACHEDIR}/common.sum"
+    md5sum "${LISTDIR}/$(lsb_release -sc)" > "${CACHEDIR}/$(lsb_release -sc).sum"
     export DEBIAN_FRONTEND=noninteractive
     echo "** Required package list:"
     cat "${CACHEDIR}/dependencies"
@@ -114,11 +116,12 @@
 	install
 	;;
     up-to-date)
-	if [ -e "$FLAGFILE" ]; then
-	    exit 1
-	else
-	    exit 0
-	fi
+	# If the package got upgraded, always do a reinstall
+	[ -e "$FLAGFILE" ] && exit 1
+	# If the files in AFS have changed, always do a reinstall
+	[ "$(md5sum "${LISTDIR}/common")" != "$(cat "${CACHEDIR}/common.sum")" ] && exit 1
+	[ "$(md5sum "${LISTDIR}/$(lsb_release -sc)")" != "$(cat "${CACHEDIR}/$(lsb_release -sc).sum")" ] && exit 1
+	exit 0
 	;;
     *)
 	echo "Usage: $0 [install | up-to-date]"


home help back first fref pref prev next nref lref last post