From 4790c6a0f6896fe2ee77c4040e78eb9567ba4d18 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Mon, 15 Aug 2011 23:14:01 -0400 Subject: [PATCH] Further autogen.sh cleanup * Roll cache-generator.sh functionality into autogen.sh * No longer install deleted scripts * Teach Perl build infrastructure about OpenILS::Utils::Configure Signed-off-by: Dan Scott Signed-off-by: Jason Etheridge --- Open-ILS/src/Makefile.am | 12 +---- Open-ILS/src/extras/autogen.sh | 60 ++++++++++++++++------ Open-ILS/src/extras/cache-generator.sh | 19 ------- Open-ILS/src/perlmods/MANIFEST | 1 + Open-ILS/src/perlmods/t/14-OpenILS-Utils.t | 3 +- 5 files changed, 49 insertions(+), 46 deletions(-) delete mode 100644 Open-ILS/src/extras/cache-generator.sh diff --git a/Open-ILS/src/Makefile.am b/Open-ILS/src/Makefile.am index e14f4c2426..c7c2a62426 100644 --- a/Open-ILS/src/Makefile.am +++ b/Open-ILS/src/Makefile.am @@ -34,16 +34,8 @@ supportscr = @srcdir@/support-scripts # Collect files to be used by multiple targets -autojsbinscripts = @srcdir@/extras/fieldmapper.pl \ - @srcdir@/extras/locale_html_options.pl \ - @srcdir@/extras/org_tree_js.pl \ - @srcdir@/extras/org_lasso_js.pl \ - @srcdir@/extras/facet_types_js.pl \ - @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 +autojsbinscripts = @srcdir@/extras/autogen.sh \ + @srcdir@/support-scripts/offline-blocked-list.pl # Decide which entities to build diff --git a/Open-ILS/src/extras/autogen.sh b/Open-ILS/src/extras/autogen.sh index 0e47148e2a..315d8824b1 100755 --- a/Open-ILS/src/extras/autogen.sh +++ b/Open-ILS/src/extras/autogen.sh @@ -96,42 +96,56 @@ COMPRESSOR="" # TODO: set via ./configure echo "Updating Evergreen organization tree and IDL using '$CONFIG'" echo "" +OUTFILE="$JSDIR/fmall.js" echo "Updating fieldmapper"; -perl -MOpenILS::Utils::Configure -e 'print OpenILS::Utils::Configure::fieldmapper();' > "$JSDIR/fmall.js"; -cp "$JSDIR/fmall.js" "$FMDOJODIR/" -echo " -> $JSDIR/fmall.js"; +perl -MOpenILS::Utils::Configure -e 'print OpenILS::Utils::Configure::fieldmapper();' > "$OUTFILE" +cp "$OUTFILE" "$FMDOJODIR/" +echo " -> $OUTFILE" +OUTFILES="$OUTFILE" +OUTFILE="$JSDIR/fmcore.js" echo "Updating web_fieldmapper"; -perl -MOpenILS::Utils::Configure -e 'print OpenILS::Utils::Configure::fieldmapper("web_core");' > "$JSDIR/fmcore.js"; -echo " -> $JSDIR/fmcore.js"; +perl -MOpenILS::Utils::Configure -e 'print OpenILS::Utils::Configure::fieldmapper("web_core");' > "$OUTFILE" +echo " -> $OUTFILE" +OUTFILES="$OUTFILES $OUTFILE" +OUTFILE="$JSDIR/*/OrgTree.js" echo "Updating OrgTree"; -perl -MOpenILS::Utils::Configure -e "OpenILS::Utils::Configure::org_tree_js('$JSDIR', 'OrgTree.js');' +perl -MOpenILS::Utils::Configure -e "OpenILS::Utils::Configure::org_tree_js('$JSDIR', 'OrgTree.js');" cp "$JSDIR/en-US/OrgTree.js" "$FMDOJODIR/" -echo " -> $JSDIR/*/OrgTree.js"; +echo " -> $OUTFILE" +OUTFILES="$OUTFILES $OUTFILE" +OUTFILE="$SLIMPACDIR/*/lib_list.inc" echo "Updating OrgTree HTML"; perl -MOpenILS::Utils::Configure -e "OpenILS::Utils::Configure::org_tree_html_options('$SLIMPACDIR', 'lib_list.inc');" -echo " -> $SLIMPACDIR/*/lib_list.inc"; +echo " -> $OUTFILE" +OUTFILES="$OUTFILES $OUTFILE" +OUTFILE="$SLIMPACDIR/locales.inc" echo "Updating locales selection HTML"; -perl -MOpenILS::Utils::Configure -e "print OpenILS::Utils::Configure::locale_html_options();" > "$SLIMPACDIR/locales.inc" -echo " -> $SLIMPACDIR/*/locales.inc"; +perl -MOpenILS::Utils::Configure -e "print OpenILS::Utils::Configure::locale_html_options();" > "$OUTFILE" +echo " -> $OUTFILE" +OUTFILES="$OUTFILES $OUTFILE" +OUTFILE="$JSDIR/OrgLasso.js" echo "Updating Search Groups"; -perl -MOpenILS::Utils::Configure -e "print OpenILS::Utils::Configure::org_lasso();" > "$JSDIR/OrgLasso.js"; -cp "$JSDIR/OrgLasso.js" "$FMDOJODIR/" -echo " -> $JSDIR/OrgLasso.js"; +perl -MOpenILS::Utils::Configure -e "print OpenILS::Utils::Configure::org_lasso();" > "$OUTFILE"; +cp "$OUTFILE" "$FMDOJODIR/" +echo " -> $OUTFILE" +OUTFILES="$OUTFILES $OUTFILE" +OUTFILE="$JSDIR/*/FacetDefs.js" echo "Updating Facet Definitions"; perl -MOpenILS::Utils::Configure -e "OpenILS::Utils::Configure::facet_types('$JSDIR', 'FacetDefs.js');" cp "$JSDIR/en-US/FacetDefs.js" "$FMDOJODIR/" -echo " -> $JSDIR/*/FacetDefs.js"; +echo " -> $OUTFILE" +OUTFILES="$OUTFILES $OUTFILE" if [ ! -z "$PROXIMITY" ] then echo "Refreshing proximity of org units"; - perl -MOpenILS::Utils::Configure -e "OpenILS::Utils::Configure::org_tree_proximity();" + perl -MOpenILS::Utils::Configure -e "OpenILS::Utils::Configure::org_tree_proximity();" fi echo "Creating combined JS..." @@ -163,7 +177,21 @@ for skin in $(ls $SKINDIR); do fi; done; +# Generate a hash of the generated files +( + date +%Y%m%d + for file in `ls -1 $OUTFILES`; do + if [[ -n $file && -f $file ]] + then + md5sum $file + fi + done +) | md5sum | cut -f1 -d' ' | colrm 1 26 > LOCALSTATEDIR/web/eg_cache_hash + +echo +echo -n "Current Evergreen cache key: " +cat LOCALSTATEDIR/web/eg_cache_hash + echo "Done"; ) - diff --git a/Open-ILS/src/extras/cache-generator.sh b/Open-ILS/src/extras/cache-generator.sh deleted file mode 100644 index a9dd834854..0000000000 --- a/Open-ILS/src/extras/cache-generator.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/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 > LOCALSTATEDIR/web/eg_cache_hash - -echo -echo -n "Current Evergreen cache key: " -cat LOCALSTATEDIR/web/eg_cache_hash - -rm /tmp/.eg-cache-generator.$PID - diff --git a/Open-ILS/src/perlmods/MANIFEST b/Open-ILS/src/perlmods/MANIFEST index 3641b6fb71..c581a01a43 100644 --- a/Open-ILS/src/perlmods/MANIFEST +++ b/Open-ILS/src/perlmods/MANIFEST @@ -129,6 +129,7 @@ lib/OpenILS/SIP/Transaction/Renew.pm lib/OpenILS/Template/Plugin/Unicode.pm lib/OpenILS/Template/Plugin/WebSession.pm lib/OpenILS/Template/Plugin/WebUtils.pm +lib/OpenILS/Utils/Configure.pm lib/OpenILS/Utils/Cronscript.pm lib/OpenILS/Utils/Cronscript.pm.in lib/OpenILS/Utils/CStoreEditor.pm diff --git a/Open-ILS/src/perlmods/t/14-OpenILS-Utils.t b/Open-ILS/src/perlmods/t/14-OpenILS-Utils.t index f24e980419..28a7267e4f 100644 --- a/Open-ILS/src/perlmods/t/14-OpenILS-Utils.t +++ b/Open-ILS/src/perlmods/t/14-OpenILS-Utils.t @@ -1,7 +1,8 @@ #!perl -T -use Test::More tests => 19; +use Test::More tests => 20; +use_ok( 'OpenILS::Utils::Configure' ); use_ok( 'OpenILS::Utils::Cronscript' ); use_ok( 'OpenILS::Utils::CStoreEditor' ); use_ok( 'OpenILS::Utils::Editor' ); -- 2.43.2