From: Jason Boyer Date: Tue, 13 Jul 2021 12:00:37 +0000 (-0400) Subject: LP1900005: autogen.sh tidy followup X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fjboyer%2Flp1900005_dont_sweat_the_user;p=working%2FEvergreen.git LP1900005: autogen.sh tidy followup Pick one indent style and stick with it, remove unnecessary semicolons. Signed-off-by: Jason Boyer --- diff --git a/Open-ILS/src/extras/autogen.sh b/Open-ILS/src/extras/autogen.sh index fd8ab6b97e..7cf95020ff 100755 --- a/Open-ILS/src/extras/autogen.sh +++ b/Open-ILS/src/extras/autogen.sh @@ -21,41 +21,41 @@ set -e # Throw an error for uninitialized variables set -u -JSDIR="LOCALSTATEDIR/web/opac/common/js"; -FMDOJODIR="LOCALSTATEDIR/web/js/dojo/fieldmapper"; -SLIMPACDIR="LOCALSTATEDIR/web/opac/extras/slimpac"; +JSDIR="LOCALSTATEDIR/web/opac/common/js" +FMDOJODIR="LOCALSTATEDIR/web/js/dojo/fieldmapper" +SLIMPACDIR="LOCALSTATEDIR/web/opac/extras/slimpac" # --------------------------------------------------------------------------- # Make sure we're not root and are able to write to the destination directory # --------------------------------------------------------------------------- -[ `id -u` -eq 0 ] && echo 'Not to be run as root' && exit 1; +[ `id -u` -eq 0 ] && echo 'Not to be run as root' && exit 1 function usage { - echo ""; - echo "usage: $0 [-u]"; - echo ""; - echo "Updates the Evergreen organization tree and fieldmapper IDL."; - echo "Run this every time you change the Evergreen organization tree"; - echo "or update fm_IDL.xml"; - echo ""; - echo "Optional parameters:"; - echo -e " -u\t\tupdate proximity of library sites in organization tree"; - echo -e " \t\t(this is expensive for a large organization tree)"; - echo ""; - echo "Examples:"; - echo ""; - echo " Update organization tree and fieldmapper IDL:"; - echo " $0"; - echo ""; - echo " Update organization tree and refresh proximity:"; - echo " $0 -u"; - echo ""; + echo "" + echo "usage: $0 [-u]" + echo "" + echo "Updates the Evergreen organization tree and fieldmapper IDL." + echo "Run this every time you change the Evergreen organization tree" + echo "or update fm_IDL.xml" + echo "" + echo "Optional parameters:" + echo -e " -u\t\tupdate proximity of library sites in organization tree" + echo -e " \t\t(this is expensive for a large organization tree)" + echo "" + echo "Examples:" + echo "" + echo " Update organization tree and fieldmapper IDL:" + echo " $0" + echo "" + echo " Update organization tree and refresh proximity:" + echo " $0 -u" + echo "" } function check_dir_writable { if [ ! -d "$1" ] || [ ! -w "$1" ]; then - echo "Unable to write to ${1}, please check"; - OHNO=1; + echo "Unable to write to ${1}, please check" + OHNO=1 fi } @@ -94,16 +94,16 @@ done cd "BINDIR" # Initialize our variables -PROXIMITY=""; +PROXIMITY="" # --------------------------------------------------------------------------- # Load the command line options and set the global vars # --------------------------------------------------------------------------- while getopts "u h" flag; do - case $flag in - "u") PROXIMITY="REFRESH";; - "h") usage && exit;; - esac; + case $flag in + "u") PROXIMITY="REFRESH";; + "h") usage && exit;; + esac done shift $((OPTIND - 1)) @@ -111,58 +111,58 @@ echo "Updating Evergreen organization tree and IDL" echo "" OUTFILE="$JSDIR/fmall.js" -echo "Updating fieldmapper"; +echo "Updating fieldmapper" 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"; +echo "Updating web_fieldmapper" 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"; +echo "Updating OrgTree" perl -MOpenILS::Utils::Configure -e "OpenILS::Utils::Configure::org_tree_js('$JSDIR', 'OrgTree.js');" cp "$JSDIR/en-US/OrgTree.js" "$FMDOJODIR/" echo " -> $OUTFILE" OUTFILES="$OUTFILES $OUTFILE" OUTFILE="$SLIMPACDIR/*/lib_list.inc" -echo "Updating OrgTree HTML"; +echo "Updating OrgTree HTML" perl -MOpenILS::Utils::Configure -e "OpenILS::Utils::Configure::org_tree_html_options('$SLIMPACDIR', 'lib_list.inc');" echo " -> $OUTFILE" OUTFILES="$OUTFILES $OUTFILE" OUTFILE="$SLIMPACDIR/locales.inc" -echo "Updating locales selection HTML"; +echo "Updating locales selection HTML" perl -MOpenILS::Utils::Configure -e "print OpenILS::Utils::Configure::locale_html_options();" > "$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();" + echo "Refreshing proximity of org units" + perl -MOpenILS::Utils::Configure -e "OpenILS::Utils::Configure::org_tree_proximity();" fi # 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 + 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' ' | cut -b 27-32 > LOCALSTATEDIR/web/eg_cache_hash echo echo -n "Current Evergreen cache key: " cat LOCALSTATEDIR/web/eg_cache_hash -echo "Done"; +echo "Done" )