From 9e1ffd833bafd2710fc2cf9fda90735a2df6ee32 Mon Sep 17 00:00:00 2001 From: dbs Date: Sun, 15 Mar 2009 17:28:15 +0000 Subject: [PATCH] Move to local DTD file for most custom / added strings (opac_conifer.dtd) Beginnings of an automated update script for applying customizations to our test server Push migration-scripts under a more generic "tools" category git-svn-id: svn://svn.open-ils.org/ILS-Contrib/conifer/trunk@178 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- .../migration-scripts}/create_test_users.pl | 0 .../migration-scripts}/demousers.sql | 0 .../migration-scripts}/generate_copies.sql | 0 .../migration-scripts}/lul_import.pl | 0 .../migration-scripts}/org_units.sql | 0 .../migration-scripts}/windsor_import.pl | 0 tools/patch_conifer.sh | 101 +++ web/opac/locale/en-CA/opac_conifer.dtd | 2 + web/opac/locale/en-US/opac.dtd | 694 --------------------- web/opac/locale/en-US/opac_conifer.dtd | 2 + web/opac/locale/fr-CA/opac_conifer.dtd | 2 + web/opac/skin/default/xml/index.xml | 22 + web/opac/skin/lul/xml/index.xml | 22 + 13 files changed, 151 insertions(+), 694 deletions(-) rename {migration-scripts => tools/migration-scripts}/create_test_users.pl (100%) rename {migration-scripts => tools/migration-scripts}/demousers.sql (100%) rename {migration-scripts => tools/migration-scripts}/generate_copies.sql (100%) rename {migration-scripts => tools/migration-scripts}/lul_import.pl (100%) rename {migration-scripts => tools/migration-scripts}/org_units.sql (100%) rename {migration-scripts => tools/migration-scripts}/windsor_import.pl (100%) create mode 100644 tools/patch_conifer.sh create mode 100644 web/opac/locale/en-CA/opac_conifer.dtd delete mode 100644 web/opac/locale/en-US/opac.dtd create mode 100644 web/opac/locale/en-US/opac_conifer.dtd create mode 100644 web/opac/locale/fr-CA/opac_conifer.dtd create mode 100644 web/opac/skin/default/xml/index.xml create mode 100644 web/opac/skin/lul/xml/index.xml diff --git a/migration-scripts/create_test_users.pl b/tools/migration-scripts/create_test_users.pl similarity index 100% rename from migration-scripts/create_test_users.pl rename to tools/migration-scripts/create_test_users.pl diff --git a/migration-scripts/demousers.sql b/tools/migration-scripts/demousers.sql similarity index 100% rename from migration-scripts/demousers.sql rename to tools/migration-scripts/demousers.sql diff --git a/migration-scripts/generate_copies.sql b/tools/migration-scripts/generate_copies.sql similarity index 100% rename from migration-scripts/generate_copies.sql rename to tools/migration-scripts/generate_copies.sql diff --git a/migration-scripts/lul_import.pl b/tools/migration-scripts/lul_import.pl similarity index 100% rename from migration-scripts/lul_import.pl rename to tools/migration-scripts/lul_import.pl diff --git a/migration-scripts/org_units.sql b/tools/migration-scripts/org_units.sql similarity index 100% rename from migration-scripts/org_units.sql rename to tools/migration-scripts/org_units.sql diff --git a/migration-scripts/windsor_import.pl b/tools/migration-scripts/windsor_import.pl similarity index 100% rename from migration-scripts/windsor_import.pl rename to tools/migration-scripts/windsor_import.pl diff --git a/tools/patch_conifer.sh b/tools/patch_conifer.sh new file mode 100644 index 0000000000..40a70d6b11 --- /dev/null +++ b/tools/patch_conifer.sh @@ -0,0 +1,101 @@ +#!/bin/bash + +REMOTE_CANONICAL_SVN_DIR=svn://svn.open-ils.org/ILS-/branches/rel_1_4 +CANONICAL_SVN_DIR=/home/opensrf/Evergreen-rel_1_4/Open-ILS +CANONICAL_EXPORT_DIR=/home/opensrf/rel_1_4_export +REMOTE_SVN_DIR=svn://svn.open-ils.org/ILS-Contrib/conifer/trunk +LOCAL_SVN_DIR=/home/opensrf/conifer-svn +LOCAL_EXPORT_DIR=/home/opensrf/conifer-export +INSTALL_DIR=/openils + +update_repository() +{ + # Create a copy of the Evergreen source if it doesn't exist + if [[ -d "$CANONICAL_SVN_DIR" ]] + then echo -n + else + svn co -q "$REMOTE_CANONICAL_SVN_DIR" "$CANONICAL_SVN_DIR" + fi + + # Create a copy of the Conifer customized source if it doesn't exist + if [[ -d "$LOCAL_SVN_DIR" ]] + then echo -n + else + svn co -q "$REMOTE_SVN_DIR" "$LOCAL_SVN_DIR" + fi + + # Update our copy of the Evergreen source + svn up -q "$CANONICAL_SVN_DIR" + + # Update our copy of the Conifer customized files + svn up -q "$REMOTE_SVN_DIR" + + # Export a clean copy of the SVN files + # We have to delete the target directory first + rm -fr "$LOCAL_EXPORT_DIR" + svn export -q "$LOCAL_SVN_DIR" "$LOCAL_EXPORT_DIR" + rm -fr "$CANONICAL_EXPORT_DIR" + svn export -q "$CANONICAL_SVN_DIR" "$CANONICAL_EXPORT_DIR" +} + +copy_web_common() +{ + # Copy the impossible-to-be-harmful (really!) Web stuff in place + # Images + cp "$LOCAL_EXPORT_DIR"/web/opac/images/* "$INSTALL_DIR"/var/web/opac/images/. + # DTD files for replacement strings + cp "$LOCAL_EXPORT_DIR"/web/opac/locale/* "$INSTALL_DIR"/var/web/opac/locale/. +} + +copy_opac_skins() +{ + SKINS=`cd "$LOCAL_EXPORT_DIR"/web/opac/skin; ls -1` + + # For skins, create a _test variation of each + # Copy the default skin in place first, then copy our custom files over top + # We probably need to munge the links to point to default_test for rdetail.js (possibly others?) + for skin in $SKINS + do + cp -r "$CANONICAL_EXPORT_DIR"/web/opac/skin/default "$INSTALL_DIR"/var/web/opac/skin/"$skin"_test + cp -r "$LOCAL_EXPORT_DIR"/web/opac/skin/"$skin"/* "$INSTALL_DIR"/var/web/opac/skin/"$skin"_test/. + for munge_file in 'page_rdetail.xml' + do + sed -i -e 's/skin\/default\/js/skin\/default_test\/js/' "$INSTALL_DIR"/var/web/opac/skin/"$skin"_test/xml/"$munge_file" + done + done +} + +# We'll need to restart Perl services after an update of circ rules +copy_circ_rules() +{ + for circ_rule in `ls -1 "$LOCAL_EXPORT_DIR"/circ/*` + if cmp "$LOCAL_EXPORT_DIR"/circ/"$circ_rule" "$LOCAL_EG_DIR"/var/circ/"$circ_rule" &> /dev/null + then echo -n + else + cp --backup=numbered "$LOCAL_EXPORT_DIR"/circ/"$circ_rule" "$INSTALL_DIR"/var/circ/. + osrf_ctl.sh -a restart_perl > /dev/null + fi + done +} + +# Not sure if we really want to do this in an automated fashion, because it would mean: +# 1. restarting Perl and possibly C services to pick up the new configuration file(s) +# 2. running autogen.sh to generate updates for fm_IDL.xml +# And it could potentially break the whole thing. +copy_conf_files() +{ + for conf in `ls -1 "$LOCAL_EXPORT_DIR"/conf/*` + if cmp "$LOCAL_EXPORT_DIR"/conf/"$conf" "$LOCAL_EG_DIR"/conf/"$conf" &> /dev/null + then echo -n + else + cp --backup=numbered "$LOCAL_EXPORT_DIR"/conf/"$conf" "$INSTALL_DIR"/conf/. + fi + done +} + +# Here end the functions; let the fun begin + +update_repository +copy_web_common +copy_opac_skins +copy_circ_rules diff --git a/web/opac/locale/en-CA/opac_conifer.dtd b/web/opac/locale/en-CA/opac_conifer.dtd new file mode 100644 index 0000000000..d8599ac83f --- /dev/null +++ b/web/opac/locale/en-CA/opac_conifer.dtd @@ -0,0 +1,2 @@ + + diff --git a/web/opac/locale/en-US/opac.dtd b/web/opac/locale/en-US/opac.dtd deleted file mode 100644 index ce1381cdbd..0000000000 --- a/web/opac/locale/en-US/opac.dtd +++ /dev/null @@ -1,694 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -try again. -

Alternatively, you can use the basic HTML-only catalog -here."> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -! -Please see a librarian to renew your account."> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -not contain the following words"> -exact phrase"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -My Account for setting your email address)"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/web/opac/locale/en-US/opac_conifer.dtd b/web/opac/locale/en-US/opac_conifer.dtd new file mode 100644 index 0000000000..d8599ac83f --- /dev/null +++ b/web/opac/locale/en-US/opac_conifer.dtd @@ -0,0 +1,2 @@ + + diff --git a/web/opac/locale/fr-CA/opac_conifer.dtd b/web/opac/locale/fr-CA/opac_conifer.dtd new file mode 100644 index 0000000000..d8599ac83f --- /dev/null +++ b/web/opac/locale/fr-CA/opac_conifer.dtd @@ -0,0 +1,2 @@ + + diff --git a/web/opac/skin/default/xml/index.xml b/web/opac/skin/default/xml/index.xml new file mode 100644 index 0000000000..81db882cab --- /dev/null +++ b/web/opac/skin/default/xml/index.xml @@ -0,0 +1,22 @@ + + + + + + + +]> + + + + + + + + + + + diff --git a/web/opac/skin/lul/xml/index.xml b/web/opac/skin/lul/xml/index.xml new file mode 100644 index 0000000000..81db882cab --- /dev/null +++ b/web/opac/skin/lul/xml/index.xml @@ -0,0 +1,22 @@ + + + + + + + +]> + + + + + + + + + + + -- 2.11.0