Issue #2725 Adding user/site derivparam migrate script

Former-commit-id: b4e353332b [formerly 8c37f0716051384e6364ffa30a6dd0a4649fb96b]
Former-commit-id: a0edd808b0
This commit is contained in:
Everett Kladstrup 2014-04-10 17:12:35 -05:00
parent 4a395ff2bc
commit fcca67d5ee

View file

@ -0,0 +1,38 @@
#!/bin/bash
# This script will move any non-base derived parameter functions and definitions
# from cave_static to common_static.
#
# This update is required with 14.3.1.
#
echo "INFO: Moving all derived parameter definitions and functions to common_static."
IFS=$'\n'
# LEVEL NAME
definitionFiles=`find /awips2/edex/data/utility/cave_static/*/*/derivedParameters/definitions/ -maxdepth 1 -iname '*.xml'`
functionFiles=`find /awips2/edex/data/utility/cave_static/*/*/derivedParameters/functions/ -maxdepth 1 -iname '*.py'`
for f in $definitionFiles; do
newf=${f//cave_static/common_static}
if [ -e "$newf" ]; then
echo cannot upgrade $f because $newf already exists
else
mkdir -p `dirname $newf`
#echo "moving $f"
mv "$f" "$newf"
fi
done
for f in $functionFiles; do
newf=${f//cave_static/common_static}
if [ -e "$newf" ]; then
echo cannot upgrade $f because $newf already exists
else
mkdir -p `dirname $newf`
#echo "moving $f"
mv "$f" "$newf"
fi
done
echo "INFO: The update finished successfully."
exit 0