| 1 | #!/bin/sh |
|---|
| 2 | |
|---|
| 3 | # $Id: update-version,v 1.2 2003-10-23 01:00:43 piso Exp $ |
|---|
| 4 | |
|---|
| 5 | # Usage: update-version old-version new-version |
|---|
| 6 | |
|---|
| 7 | if [[ -z $1 || -z $2 ]]; then |
|---|
| 8 | echo "Usage: update-version old-version new-version"; exit 1; |
|---|
| 9 | fi |
|---|
| 10 | |
|---|
| 11 | echo Old version is $1 |
|---|
| 12 | echo New version is $2 |
|---|
| 13 | |
|---|
| 14 | if [ -f Version.java ]; then |
|---|
| 15 | grep $1 Version.java > /dev/null || |
|---|
| 16 | { echo "Error: current version of Version.java is not $1"; exit 1; } |
|---|
| 17 | p4 edit Version.java |
|---|
| 18 | sed -e "s/$1/$2/g" Version.java > Version.java.new |
|---|
| 19 | mv Version.java Version.java~ |
|---|
| 20 | mv Version.java.new Version.java |
|---|
| 21 | cvs commit -m "$2" Version.java |
|---|
| 22 | exit 0; |
|---|
| 23 | fi |
|---|
| 24 | |
|---|
| 25 | grep $1 build.xml > /dev/null || |
|---|
| 26 | { echo "Error: current version of build.xml is not $1"; exit 1; } |
|---|
| 27 | grep $1 configure.ac > /dev/null || |
|---|
| 28 | { echo "Error: current version of configure.ac is not $1"; exit 1; } |
|---|
| 29 | grep $1 configure > /dev/null || |
|---|
| 30 | { echo "Error: current version of configure is not $1"; exit 1; } |
|---|
| 31 | |
|---|
| 32 | p4 edit build.xml |
|---|
| 33 | sed -e "s/$1/$2/g" build.xml > build.xml.new |
|---|
| 34 | mv build.xml build.xml~ |
|---|
| 35 | mv build.xml.new build.xml |
|---|
| 36 | cvs commit -m "$2" build.xml || |
|---|
| 37 | { echo "Error: unable to commit build.xml"; exit 1; } |
|---|
| 38 | |
|---|
| 39 | p4 edit configure.ac |
|---|
| 40 | p4 edit configure |
|---|
| 41 | sed -e "s/$1/$2/g" configure.ac > configure.ac.new |
|---|
| 42 | mv configure.ac configure.ac~ |
|---|
| 43 | mv configure.ac.new configure.ac |
|---|
| 44 | cvs commit -m "$2" configure.ac || |
|---|
| 45 | { echo "Error: unable to commit configure.ac"; exit 1; } |
|---|
| 46 | mv configure configure~ |
|---|
| 47 | autoconf |
|---|
| 48 | cvs commit -m "$2" configure || |
|---|
| 49 | { echo "Error: unable to commit configure"; exit 1; } |
|---|
| 50 | |
|---|
| 51 | # Note that the files are left open for edit in Perforce at this point. |
|---|
| 52 | |
|---|
| 53 | exit 0; |
|---|