Further autogen.sh cleanup
authorDan Scott <dan@coffeecode.net>
Tue, 16 Aug 2011 03:14:01 +0000 (23:14 -0400)
committerJason Etheridge <jason@esilibrary.com>
Thu, 18 Aug 2011 05:39:30 +0000 (01:39 -0400)
* 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 <dscott@laurentian.ca>
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/src/Makefile.am
Open-ILS/src/extras/autogen.sh
Open-ILS/src/extras/cache-generator.sh [deleted file]
Open-ILS/src/perlmods/MANIFEST
Open-ILS/src/perlmods/t/14-OpenILS-Utils.t

index e14f4c2..c7c2a62 100644 (file)
@@ -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
 
index 0e47148..315d882 100755 (executable)
@@ -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 (file)
index a9dd834..0000000
+++ /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
-
index 3641b6f..c581a01 100644 (file)
@@ -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
index f24e980..28a7267 100644 (file)
@@ -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' );