Files
moldyn/mathmech/update_ver.sh
arcan1s cd3857adc1 Added helpwindow
fixed wersions
edited PKGBUILD
edited scripts
2013-09-01 14:16:23 +04:00

59 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
func_help() {
echo -e "\nUsage: update_ver.sh -o OLDVER -n NEWVER"
echo -e "\nRequired parameters:"
echo -e " -o --oldver - old version"
echo -e " -n --newver - new version"
echo -e "\nAdditional parametrs:"
echo -e " -h --help - show this help and exit"
exit 1
}
until [ -z $1 ]; do
if [ "$1" = "-h" ]; then
func_help; fi
if [ "$1" = "--help" ]; then
func_help; fi
if [ "$1" = "-o" ]; then
OLDVER="$2"
shift; fi
if [ "$1" = "--oldver" ]; then
OLDVER="$2"
shift; fi
if [ "$1" = "-n" ]; then
NEWVER="$2"
shift; fi
if [ "$1" = "--newver" ]; then
NEWVER="$2"
shift; fi
shift
done
if [[ -z "$OLDVER" || -z "$NEWVER" ]]; then
echo "Parametrs aren't set"
echo "Usage: update_ver.sh -o OLDVER -n NEWVER"
exit 1
fi
# work block
COMPONENTS=(mm_agl mm_envir mm_radf mm_statgen mm_trj mm_trj2pdb)
for COMPONENT in ${COMPONENTS[*]}; do
# help message
sed -i "s/Version : $OLDVER/Version : $NEWVER/g" $COMPONENT/src/main.c
# head in output
sed -i "s/V.$OLDVER/V.$NEWVER/g" $COMPONENT/src/add_main.c
# readme
sed -i "s/Version: $OLDVER/Version: $NEWVER/g" $COMPONENT/README
# documentation
sed -i "s/V.$OLDVER/V.$NEWVER/g" $COMPONENT/$COMPONENT.doxygen
done
# update documentation
./update_docs.sh
COMPONENT=mathmech
# about window
sed -i "s/$OLDVER/$NEWVER/g" $COMPONENT/resources/translations/eng.ts
sed -i "s/$OLDVER/$NEWVER/g" $COMPONENT/resources/translations/rus.ts
# readme
sed -i "s/Version: $OLDVER/Version: $NEWVER/g" $COMPONENT/README