Merge "Issue #2725 Adding user/site derivparam migrate script" into development

Former-commit-id: ea7a0b963bf90c657c574fb40e67e54c1f33c203
This commit is contained in:
Nate Jensen 2014-04-14 08:59:21 -05:00 committed by Gerrit Code Review
commit fc4d9a79ce

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