LP2003707: Add an OpenSRF Core Config Param to autogen.sh
authorJason Boyer <JBoyer@equinoxOLI.org>
Mon, 23 Jan 2023 12:23:15 +0000 (07:23 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Wed, 1 Mar 2023 18:49:42 +0000 (13:49 -0500)
What it says on the tin, if you change the name or location of
opensrf_core.xml now you can still run autogen.sh.

Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org>
Signed-off-by: Josh Stompro <stomproj@larl.org>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/extras/autogen.sh

index 176e1da..cc2d91d 100755 (executable)
@@ -105,12 +105,14 @@ cd "BINDIR"
 
 # Initialize our variables
 PROXIMITY=""
+OSRF_CORE="SYSCONFDIR/opensrf_core.xml"
 
 # ---------------------------------------------------------------------------
 # Load the command line options and set the global vars
 # ---------------------------------------------------------------------------
-while getopts  "h" flag; do
+while getopts  "c:uh" flag; do
     case $flag in    
+        "c")        OSRF_CORE="$OPTARG";;
         "u")        PROXIMITY="REFRESH";;
         "h")        usage && exit;;
     esac
@@ -122,40 +124,40 @@ echo ""
 
 OUTFILE="$JSDIR/fmall.js"
 echo "Updating fieldmapper"
-perl -MOpenILS::Utils::Configure -e 'print OpenILS::Utils::Configure::fieldmapper();' > "$OUTFILE"
+perl -MOpenILS::Utils::Configure -e 'print OpenILS::Utils::Configure::fieldmapper();' -- --osrf-config "$OSRF_CORE" > "$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");' > "$OUTFILE"
+perl -MOpenILS::Utils::Configure -e 'print OpenILS::Utils::Configure::fieldmapper("web_core");' -- --osrf-config "$OSRF_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');" -- --osrf-config "$OSRF_CORE"
 cp "$JSDIR/en-US/OrgTree.js" "$FMDOJODIR/"
 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');"
+perl -MOpenILS::Utils::Configure -e "OpenILS::Utils::Configure::org_tree_html_options('$SLIMPACDIR', 'lib_list.inc');" -- --osrf-config "$OSRF_CORE"
 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();" > "$OUTFILE"
+perl -MOpenILS::Utils::Configure -e "print OpenILS::Utils::Configure::locale_html_options();" -- --osrf-config "$OSRF_CORE" > "$OUTFILE"
 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();" -- --osrf-config "$OSRF_CORE"
 fi
 
 # Generate a hash of the generated files