[open-ils-commits] r20213 - in trunk/Open-ILS/src: . extras (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Apr 19 12:15:04 EDT 2011
Author: miker
Date: 2011-04-19 12:15:01 -0400 (Tue, 19 Apr 2011)
New Revision: 20213
Added:
trunk/Open-ILS/src/extras/cache-generator.sh
Modified:
trunk/Open-ILS/src/Makefile.am
Log:
Add a wrapper for autogen.sh which generates a date+content hash for use in (browser) cache killing
Modified: trunk/Open-ILS/src/Makefile.am
===================================================================
--- trunk/Open-ILS/src/Makefile.am 2011-04-19 16:01:47 UTC (rev 20212)
+++ trunk/Open-ILS/src/Makefile.am 2011-04-19 16:15:01 UTC (rev 20213)
@@ -42,6 +42,7 @@
@srcdir@/extras/org_tree_html_options.pl \
@srcdir@/extras/org_tree_proximity.pl \
@srcdir@/extras/autogen.sh \
+ @srcdir@/extras/cache-generator.sh \
@srcdir@/support-scripts/offline-blocked-list.pl
# Decide which entities to build
@@ -183,6 +184,9 @@
sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/autogen.sh'
sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@bindir@/autogen.sh'
sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/autogen.sh'
+ sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/cache-generator.sh'
+ sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@bindir@/cache-generator.sh'
+ sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/cache-generator.sh'
sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/reshelving_complete.srfsh'
sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/clear_expired_circ_history.srfsh'
sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/update_hard_due_dates.srfsh'
Added: trunk/Open-ILS/src/extras/cache-generator.sh
===================================================================
--- trunk/Open-ILS/src/extras/cache-generator.sh (rev 0)
+++ trunk/Open-ILS/src/extras/cache-generator.sh 2011-04-19 16:15:01 UTC (rev 20213)
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+PID=$$
+
+BINDIR/autogen.sh $@ |tee /tmp/.eg-cache-generator.$PID
+
+(
+ date +%Y%m%d
+ for i in `grep -- '->' /tmp/.eg-cache-generator.$PID| awk '{print $2}'`; do
+ ls $i >/dev/null 2>/dev/null && md5sum $i
+ done
+) | md5sum | cut -f1 -d' ' | colrm 1 26 > SYSCONFDIR/eg_cache_hash
+
+echo
+echo -n "Current Evergreen cache key: "
+cat SYSCONFDIR/eg_cache_hash
+
+rm /tmp/.eg-cache-generator.$PID
+
More information about the open-ils-commits
mailing list