Merge branch 'asm_14.3.1' of winter:/data/gerrit2/git/AWIPS2_baseline into master_14.3.1

Former-commit-id: 20dd249d2c [formerly 2a911984f0 [formerly 441fc7561a8526422f9b73b9c47cd220f0babb54]]
Former-commit-id: 2a911984f0
Former-commit-id: db665d3876
This commit is contained in:
Brian.Dyke 2014-10-02 10:44:50 -04:00
commit 7390f6c3a8
23 changed files with 288 additions and 43088 deletions

File diff suppressed because it is too large Load diff

View file

@ -21,6 +21,7 @@ package com.raytheon.uf.viz.spellchecker.dialogs;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Deque;
import java.util.HashSet;
import java.util.LinkedList;
@ -77,6 +78,7 @@ import com.raytheon.uf.viz.spellchecker.jobs.SpellCheckJob;
* ------------ ---------- ----------- --------------------------
* 18 APR 2008 ### lvenable Initial creation
* 01Mar2010 4765 MW Fegan Moved from GFE plug-in.
* 09/24/2014 #16693 lshi filter out swear words in spelling check
*
* </pre>
*
@ -85,6 +87,8 @@ import com.raytheon.uf.viz.spellchecker.jobs.SpellCheckJob;
*
*/
public class SpellCheckDlg extends Dialog implements ISpellingProblemCollector {
private static java.util.List<String> swearWords = Arrays.asList("ASSHOLE");
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(SpellCheckDlg.class);
private static final Pattern DIGITS = Pattern.compile("\\d");
@ -348,7 +352,8 @@ public class SpellCheckDlg extends Dialog implements ISpellingProblemCollector {
if (pdMatch.matches()) {
String replString = pdMatch.group(1).toUpperCase();
// proposals may include case changes, which get lost
if (replString != badWord) {
//if (replString != badWord) {
if (!swearWords.contains(replString) && !replString.equals(badWord)) {
suggestionList.add(replString);
}
}

View file

@ -15,50 +15,61 @@
#clean up platform dictionary
#
cmddir=$(dirname $_)
FNAME="spelldict"
user=$(whoami)
host=$(hostname)
stddict=$cmddir/$FNAME.std
[ ! -f $stddict ] && {
echo Error: the standard dictionary \"$stddict\" not found.
exit 1
}
edex_user_dir=/awips2/edex/data/utility/cave_static/user/
cave_etc=/awips2/cave/etc
run_type=0
FNAME="spelldict"
clean () {
lines=`cat $1 |wc -l`
size=`cat $1 |wc -c`
MSG="$1, size=$size, #line=$lines:"
LASTWD=$(grep 'zymurgy' $1)
if [ $size -eq 1290760 ]
if [ $run_type == 1 ]
then
remove $1
# elif [ $lines -gt 135553 ]
# then
# [ $run_type == 1 ] && (cp $1 "$1.bak";
# sed -n "135554,${lines}p" "$1.bak" > $1)
# let "newlines=${lines}-135553"
# echo $MSG modified, \#line=$(( lines-135553 ))
elif [ "$LASTWD" ]
then
line=$(sed -n "/^$LASTWD/=" $1)
# echo line=$line
[ $run_type == 1 ] && (cp -p $1 "$1.bak"; sed "1, /^$LASTWD/d" "$1.bak" > $1)
echo $MSG "modified, #line=$(( lines-line ))"
cp -p $1 "$1.bak"
cp $stddict $1
if [ "$LASTWD" ]
then
sed "1, /^$LASTWD/d" "$1.bak" >> $1
else
cat $1.bak >> $1
fi
echo "$MSG modified, #line=$(cat $1 |wc -l)"
else
echo $MSG unchanged
echo $MSG "modified"
fi
}
remove () {
lines=`cat $1 |wc -l`
size=`cat $1 |wc -c`
if [ $run_type == 1 ]
if [ $run_type == 1 ] && [ -f $1 ]
then
cp -p $1 "$1.bak"
mv $1 "$1.bak"
[[ $1 == ${cave_etc}* ]] && cat /dev/null > $1 || rm -f $1
fi
action=$([[ $1 == ${cave_etc}* ]] && echo emptied || echo removed )
echo "$1, size=$size, #line=$lines: $action"
echo "$1, removed"
}
create () {
[ $run_type == 1 ] && (
cp $stddict $1
chown awips $1
chgrp fxalpha $1
chmod 644 $1
)
echo "$1, created the standard dictionary"
}
usage () {
@ -110,11 +121,7 @@ then
then
clean $f
else
cat /dev/null > $f
chown awips $f
chgrp fxalpha $f
chmod 644 $f
echo $f: created, size=0
create $f
fi
fi

View file

@ -103,11 +103,11 @@ THE ONSET OF ACCUMULATING SLEET OR SNOW.
## If sites do not want watches in their AWW product comment out the
## section below
#######################################################################
#if(${list.contains(${includedWatches}, "torWatches")} && ${list.contains(${bullets}, "includeTorWatches")})
#if(${list.contains(${includedWatches}, "TO.A")} && ${list.contains(${bullets}, "includeTorWatches")})
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${list.contains(${includedWatches}, "svrWatches")} && ${list.contains(${bullets}, "includeSvrWatches")})
#if(${list.contains(${includedWatches}, "SV.A")} && ${list.contains(${bullets}, "includeSvrWatches")})
#insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end

View file

@ -50,11 +50,11 @@ turned on unless the corresponding .vm file is turned on in a given template's .
<autoLockText>true</autoLockText>
<!-- Included watches: If a tornado watch or severe thunderstorm watch is to be
included with the warning product include torWatches and/or svrWatches,
included with the warning product include TO.A and/or SV.A,
respectively. Please refer to 'includedWatchAreaBuffer' in <areaConfig/>. -->
<includedWatches>
<includedWatch>torWatches</includedWatch>
<includedWatch>svrWatches</includedWatch>
<includedWatch>TO.A</includedWatch>
<includedWatch>SV.A</includedWatch>
</includedWatches>
<!-- durations: the list of possible durations of the warning -->

View file

@ -53,7 +53,7 @@ turned on unless the corresponding .vm file is turned on in a given template's .
<autoLockText>false</autoLockText>
<!-- Included watches: If a tornado watch or severe thunderstorm watch is to be
included with the warning product include torWatches and/or svrWatches,
included with the warning product include TO.A and/or SV.A,
respectively. Please refer to 'includedWatchAreaBuffer' in <areaConfig/>. -->
<includedWatches>
</includedWatches>

View file

@ -67,11 +67,11 @@ Must be paired with proper vm code (also commented out in flashFloodWarning.vm)!
<!-- <trackEnabled>true</trackEnabled> -->
<!-- Included watches: If a tornado watch or severe thunderstorm watch is to be
included with the warning product include torWatches and/or svrWatches,
included with the warning product include TO.A and/or SV.A,
respectively. Please refer to 'includedWatchAreaBuffer' in <areaConfig/>. -->
<includedWatches>
<includedWatch>torWatches</includedWatch>
<includedWatch>svrWatches</includedWatch>
<includedWatch>TO.A</includedWatch>
<includedWatch>SV.A</includedWatch>
</includedWatches>
<!-- durations: the list of possible durations of the warning -->

View file

@ -635,12 +635,12 @@ TORRENTIAL RAINFALL IS OCCURRING WITH THIS STORM...AND MAY LEAD TO FLASH FLOODIN
## WATCHES ##
#############
#if(${list.contains(${includedWatches}, "torWatches")})
#if(${list.contains(${includedWatches}, "TO.A")})
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#* NO NEED TO INCLUDE SVR T-STM WATCHES IN A SVR WARNING!!!!
#if(${list.contains(${includedWatches}, "svrWatches")})
#if(${list.contains(${includedWatches}, "SV.A")})
#insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#
#end

View file

@ -58,10 +58,10 @@ turned on unless the corresponding .vm file is turned on in a given template's .
<autoLockText>true</autoLockText>
<!-- Included watches: If a tornado watch or severe thunderstorm watch is to be
included with the warning product include torWatches and/or svrWatches,
included with the warning product include TO.A and/or SV.A,
respectively. Please refer to 'includedWatchAreaBuffer' in <areaConfig/>. -->
<includedWatches>
<includedWatch>torWatches</includedWatch>
<includedWatch>TO.A</includedWatch>
</includedWatches>
<!-- durations: the list of possible durations of the warning -->

View file

@ -292,10 +292,10 @@ ${expcanPhrase} ${addthreat}
###########################################
## WATCHES ##
#############
#if(${list.contains(${includedWatches}, "torWatches")})
#if(${list.contains(${includedWatches}, "TO.A")})
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${list.contains(${includedWatches}, "svrWatches")})
#if(${list.contains(${includedWatches}, "SV.A")})
#insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
@ -1198,7 +1198,7 @@ TORRENTIAL RAINFALL IS OCCURRING WITH THIS STORM...AND MAY LEAD TO FLASH FLOODIN
## WATCHES ##
#############
#if(${list.contains(${includedWatches}, "torWatches")} && ${phenomena}=="SV")
#if(${list.contains(${includedWatches}, "TO.A")} && ${phenomena}=="SV")
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end

View file

@ -79,8 +79,8 @@ turned on unless the corresponding .vm file is turned on in a given template's .
</phensigs>
<includedWatches>
<includedWatch>torWatches</includedWatch>
<includedWatch>svrWatches</includedWatch>
<includedWatch>TO.A</includedWatch>
<includedWatch>SV.A</includedWatch>
</includedWatches>
<enableRestart>false</enableRestart>

View file

@ -479,10 +479,10 @@ REPORT SEVERE WEATHER TO THE COAST GUARD OR NEAREST LAW ENFORCEMENT AGENCY. THEY
## WATCHES ##
#############
#if(${list.contains(${includedWatches}, "torWatches")})
#if(${list.contains(${includedWatches}, "TO.A")})
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${list.contains(${includedWatches}, "svrWatches")})
#if(${list.contains(${includedWatches}, "SV.A")})
#insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${productClass}=="T")

View file

@ -55,11 +55,11 @@ turned on unless the corresponding .vm file is turned on in a given template's .
<autoLockText>true</autoLockText>
<!-- Included watches: If a tornado watch or severe thunderstorm watch is to be
included with the warning product include torWatches and/or svrWatches,
included with the warning product include TO.A and/or SV.A,
respectively. Please refer to 'includedWatchAreaBuffer' in <areaConfig/>. -->
<includedWatches>
<includedWatch>torWatches</includedWatch>
<includedWatch>svrWatches</includedWatch>
<includedWatch>TO.A</includedWatch>
<includedWatch>SV.A</includedWatch>
</includedWatches>
<!-- durations: the list of possible durations of the warning -->

View file

@ -400,10 +400,10 @@ ${canwarning}
#############
## WATCHES ##
#############
#if(${list.contains(${includedWatches}, "torWatches")})
#if(${list.contains(${includedWatches}, "TO.A")})
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${list.contains(${includedWatches}, "svrWatches")})
#if(${list.contains(${includedWatches}, "SV.A")})
#insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#end
@ -580,10 +580,10 @@ REPORT SEVERE WEATHER TO THE COAST GUARD OR NEAREST LAW ENFORCEMENT AGENCY. THEY
#############
## WATCHES ##
#############
#if(${list.contains(${includedWatches}, "torWatches")})
#if(${list.contains(${includedWatches}, "TO.A")})
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${list.contains(${includedWatches}, "svrWatches")})
#if(${list.contains(${includedWatches}, "SV.A")})
#insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#end
@ -688,10 +688,10 @@ THE ${eventType} !** WEAKENED / MOVED OUT OF THE WARNED AREA **! AND NO LONGER $
#############
## WATCHES ##
#############
#if(${list.contains(${includedWatches}, "torWatches")})
#if(${list.contains(${includedWatches}, "TO.A")})
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${list.contains(${includedWatches}, "svrWatches")})
#if(${list.contains(${includedWatches}, "SV.A")})
#insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${productClass}=="T")
@ -895,10 +895,10 @@ REPORT SEVERE WEATHER TO THE COAST GUARD OR NEAREST LAW ENFORCEMENT AGENCY. THEY
#############
## WATCHES ##
#############
#if(${list.contains(${includedWatches}, "torWatches")})
#if(${list.contains(${includedWatches}, "TO.A")})
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${list.contains(${includedWatches}, "svrWatches")})
#if(${list.contains(${includedWatches}, "SV.A")})
#insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#elseif(${CORCAN} == "true")
@ -967,10 +967,10 @@ THE ${eventType} !** WEAKENED / MOVED OUT OF THE WARNED AREA **! AND NO LONGER $
#############
## WATCHES ##
#############
#if(${list.contains(${includedWatches}, "torWatches")})
#if(${list.contains(${includedWatches}, "TO.A")})
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${list.contains(${includedWatches}, "svrWatches")})
#if(${list.contains(${includedWatches}, "SV.A")})
#insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${productClass}=="T")
@ -1163,10 +1163,10 @@ REPORT SEVERE WEATHER TO THE COAST GUARD OR NEAREST LAW ENFORCEMENT AGENCY. THEY
#############
## WATCHES ##
#############
#if(${list.contains(${includedWatches}, "torWatches")})
#if(${list.contains(${includedWatches}, "TO.A")})
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${list.contains(${includedWatches}, "svrWatches")})
#if(${list.contains(${includedWatches}, "SV.A")})
#insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#end
@ -1240,10 +1240,10 @@ ${expwarning}
#############
## WATCHES ##
#############
#if(${list.contains(${includedWatches}, "torWatches")})
#if(${list.contains(${includedWatches}, "TO.A")})
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${list.contains(${includedWatches}, "svrWatches")})
#if(${list.contains(${includedWatches}, "SV.A")})
#insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#end

View file

@ -55,11 +55,11 @@ turned on unless the corresponding .vm file is turned on in a given template's .
<autoLockText>true</autoLockText>
<!-- Included watches: If a tornado watch or severe thunderstorm watch is to be
included with the warning product include torWatches and/or svrWatches,
included with the warning product include TO.A and/or SV.A,
respectively. Please refer to 'includedWatchAreaBuffer' in <areaConfig/>. -->
<includedWatches>
<includedWatch>torWatches</includedWatch>
<includedWatch>svrWatches</includedWatch>
<includedWatch>TO.A</includedWatch>
<includedWatch>SV.A</includedWatch>
</includedWatches>
<!-- durations: the list of possible durations of the svs -->

View file

@ -471,7 +471,7 @@ TORRENTIAL RAINFALL IS ALSO OCCURRING WITH THIS STORM...AND MAY LEAD TO FLASH FL
## WATCHES ##
#############
#if(${list.contains(${includedWatches}, "torWatches")})
#if(${list.contains(${includedWatches}, "TO.A")})
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end

View file

@ -59,10 +59,10 @@ turned on unless the corresponding .vm file is turned on in a given template's .
<autoLockText>true</autoLockText>
<!-- Included watches: If a tornado watch or severe thunderstorm watch is to be
included with the warning product include torWatches and/or svrWatches,
included with the warning product include TO.A and/or SV.A,
respectively. Please refer to 'includedWatchAreaBuffer' in <areaConfig/>. -->
<includedWatches>
<includedWatch>torWatches</includedWatch>
<includedWatch>TO.A</includedWatch>
</includedWatches>
<!-- durations: the list of possible durations of the warning -->

View file

@ -264,10 +264,10 @@ ${expcanPhrase} ${addthreat}
###########################################
## WATCHES ##
#############
###if(${list.contains(${includedWatches}, "torWatches")})
###if(${list.contains(${includedWatches}, "TO.A")})
###inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
###end
###if(${list.contains(${includedWatches}, "svrWatches")})
###if(${list.contains(${includedWatches}, "SV.A")})
###insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
###end
#if(${list.contains(${bullets}, "svrboxactive")})
@ -926,7 +926,7 @@ TORRENTIAL RAINFALL IS ALSO OCCURRING WITH THIS STORM...AND MAY LEAD TO FLASH FL
#############
## WATCHES ##
#############
#if(${list.contains(${includedWatches}, "torWatches")} && ${phenomena}=="SV")
#if(${list.contains(${includedWatches}, "TO.A")} && ${phenomena}=="SV")
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end

View file

@ -70,8 +70,8 @@ turned on unless the corresponding .vm file is turned on in a given template's .
</phensigs>
<includedWatches>
<includedWatch>torWatches</includedWatch>
<includedWatch>svrWatches</includedWatch>
<includedWatch>TO.A</includedWatch>
<includedWatch>SV.A</includedWatch>
</includedWatches>
<enableRestart>false</enableRestart>

View file

@ -233,10 +233,10 @@ LOCATIONS CAN EXPECT !** EXPECTED SNOW **! INCHES OF SNOW.
#############
## WATCHES ##
#############
#if(${list.contains(${includedWatches}, "torWatches")} && ${list.contains(${bullets}, "includeTorWatches")})
#if(${list.contains(${includedWatches}, "TO.A")} && ${list.contains(${bullets}, "includeTorWatches")})
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${list.contains(${includedWatches}, "svrWatches")} && ${list.contains(${bullets}, "includeSvrWatches")})
#if(${list.contains(${includedWatches}, "SV.A")} && ${list.contains(${bullets}, "includeSvrWatches")})
#insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end

View file

@ -310,10 +310,10 @@ IF ON OR NEAR !**Name Of Lake**!...GET OUT OF THE WATER AND MOVE INDOORS OR INSI
#############
## WATCHES ##
#############
#if(${list.contains(${includedWatches}, "torWatches")} && ${list.contains(${bullets}, "includeTorWatches")})
#if(${list.contains(${includedWatches}, "TO.A")} && ${list.contains(${bullets}, "includeTorWatches")})
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${list.contains(${includedWatches}, "svrWatches")} && ${list.contains(${bullets}, "includeSvrWatches")})
#if(${list.contains(${includedWatches}, "SV.A")} && ${list.contains(${bullets}, "includeSvrWatches")})
#insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
####################################

View file

@ -51,11 +51,11 @@ turned on unless the corresponding .vm file is turned on in a given template's .
<autoLockText>true</autoLockText>
<!-- Included watches: If a tornado watch or severe thunderstorm watch is to be
included with the warning product include torWatches and/or svrWatches,
included with the warning product include TO.A and/or SV.A,
respectively. Please refer to 'includedWatchAreaBuffer' in <areaConfig/>. -->
<includedWatches>
<includedWatch>torWatches</includedWatch>
<includedWatch>svrWatches</includedWatch>
<includedWatch>TO.A</includedWatch>
<includedWatch>SV.A</includedWatch>
</includedWatches>
<!-- durations: the list of possible durations of the warning -->

View file

@ -0,0 +1,192 @@
#!/bin/bash
# check-localized-files.sh
# goal is to alert the user to which files changed in baseline for which they may have overrides
### Supporting / Reoccuring functions in my scripts
function isUp() {
# sub-script for checking availability of a host via ping
# USAGE: isUp $host
# EXAMPLE: isUp lx1
ping -q -c2 $1 > /dev/null 2>&1
return $?
}
function print_bar {
_int=$((${1} % 8))
case "${_int}" in
[04] ) echo -ne "\b\b\ " ;;
[15] ) echo -ne "\b\b| " ;;
[26] ) echo -ne "\b\b/ " ;;
[37] ) echo -ne "\b\b- " ;;
esac
}
function color_echo() {
# To echo something to stdout with color
#
# Usage: color_echo $COLOR $BOLD $STRING
#
# COLOR: Color string from: black, green, blue, red, yellow, white
# BOLD: 1 = true, 0 = false
# STRING: String to echo
sColor=$1
sBold=$2
sString=$3
if [[ -z "${sColor}" || -z "${sBold}" || -z "${sString}" ]] || [[ ${sBold} -ne 1 && ${sBold} -ne 0 ]]
then
echo -e "ERROR IN $FUNCNAME:\t Usage:\t$FUNCNAME $COLOR $BOLD $STRING"
else
case ${sColor} in
"green" ) colorInt=32 ;;
"blue" ) colorInt=34 ;;
"red" ) colorInt=31 ;;
"yellow" ) colorInt=33 ;;
"white" ) colorInt=37 ;;
"black" ) colorInt=30 ;;
* ) colorInt="" ;;
esac
if [[ ${sBold} -eq 0 ]]; then sBold="" ; fi
echo -e "\033[${sBold};${colorInt}m${sString}\033[0m"
fi
return 0
}
function echoDate() {
echo -ne "|-- $( date +"%Y%m%d %H:%M:%S" ) "
}
function logIt() {
#built for easier logging.
# Usage: logIt $LEVEL $SCRIPT_LOCATION $TEXT
# Example: logIt ERROR $FUNCNAME "Error in doing something"
local logLevel=$1
local scriptLoc=$2
local logText=$3
case "${logLevel}" in
"INFO" ) echoDate && echo -e "\t[${scriptLoc}]:\tINFO: ${logText}" ;;
"NOTE" ) echoDate && echo -ne "\t[${scriptLoc}]:\t" && color_echo yellow 0 "NOTE: ${logText}" ;;
"ERROR" ) echoDate && echo -ne "\t[${scriptLoc}]:\t" && color_echo red 1 "ERROR: ${logText}" ;;
"DEBUG" ) if [[ "${DEBUG}" ]] ; then echoDate && echo -ne "\t[${scriptLoc}]:\tDEBUG: ${logText}\n"; fi ;;
"HEADER" ) echoDate && echo -ne "\t[${scriptLoc}]:\t" && color_echo blue 1 "${logText}" ;;
* ) echoDate && echo -e "\t[${scriptLoc}]:\t${logText}" ;;
esac
return 0
}
## Script Specific
function setupEnv() {
scriptRoot=$( dirname $0 )
if [[ "${scriptRoot}" == "." ]]
then
fullScriptPath=$( pwd )
else
fullScriptPath=${scriptRoot}
fi
inputFileName="changed_xml_1355_filtered.txt"
if [[ $# -gt 0 ]] ; then
inputFileName=$1
logIt INFO main "User passed an argument which we're using for the input file name : $1"
fi
inputFile=${fullScriptPath}/${inputFileName}
runTimeStamp=$( date +%Y%m%d_%H%M%S )
}
# Main
# Catch the passed arguments
while getopts ":d" Option
do
case $Option in
d ) DEBUG=1 ;;
# y ) debug_echo "Option y -- Accept Defaults specified." && acceptDefaults=1 && color_echo yellow 0 "*** Accept Defaults Specified ***" ;;
* ) logIt ERROR main "Unimplemented $Option. OPTIND=$OPTIND -- IGNORING" ;;
esac
done
shift $(($OPTIND - 1))
setupEnv $1
{
logIt HEADER main "Starting Main Program"
if [[ ! -f ${inputFile} ]] ; then
color_echo red 1 "ERROR: You are missing ${inputFileName}"
exit 1
fi
logIt INFO main "\tAbout to check for new files....."
while read file ; do
fileName=${file##*/}
fileLocation=${file%%/*}
#echo -e "NEW FILE: ${fileName}\t${fileLocation}\t${file}"
case ${fileLocation} in
"cave" ) paredPath=${file#cave/*/localization/}
paredPath=${paredPath%/*}
searchPath="cave_static/(site|user)/.*/${paredPath}" ;;
"edexOsgi" ) paredPath=${file#edexOsgi/*/utility/}
paredPath=${paredPath%/*}
#searchPath=${paredPath#*/}
#searchPath=${paredPath%/*}
searchPath=$( echo ${paredPath} | sed -e "s/base/\(site|user\)\/\.\*/g" );;
esac
logIt DEBUG main "Search Path: ${searchPath}"
logIt DEBUG main "File Name: ${fileName}"
if ! cd /awips2/edex/data/utility ; then
logIt ERROR main "Can not change directory (cd) to /awips2/edex/data/utility. Please check you are on a device with this path mounted"
exit 1
fi
#echo -e "------------------------------------------"
if [[ ! -n ${searchPath} || ${searchPath} != "" ]] ; then
logIt DEBUG main "FIND COMMAND: find . -type f -regextype posix-egrep -regex \"./${searchPath}/${fileName}\" -ls"
find . -type f -regextype posix-egrep -regex "./${searchPath}/${fileName}" -ls | while read line ; do
logIt NOTE main "Found file which may match a new baselined file: "
logIt "" main "\tBaseline File:\t ${paredPath}/${fileName}"
logIt "" main "\tYour File:\t${line}"
done
#echo && echo
#find . -type f -name ${fileName} -ls
fi
#echo -e "------------------------------------------"
done< ${inputFile}
logIt HEADER main "Completing Main Program"
} | tee -a /tmp/$(basename $0 .sh)_${runTimeStamp}.log
exit 0