Repository: incubator-hivemall Updated Branches: refs/heads/master ccbd25433 -> 4fd3b74c3
Added -pom option Project: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/commit/4fd3b74c Tree: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/tree/4fd3b74c Diff: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/diff/4fd3b74c Branch: refs/heads/master Commit: 4fd3b74c3bcab90bb47bb7d76da48a73bef6866f Parents: ccbd254 Author: Makoto Yui <[email protected]> Authored: Fri Jan 5 14:23:55 2018 +0900 Committer: Makoto Yui <[email protected]> Committed: Fri Jan 5 14:23:55 2018 +0900 ---------------------------------------------------------------------- bin/set_version.sh | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/4fd3b74c/bin/set_version.sh ---------------------------------------------------------------------- diff --git a/bin/set_version.sh b/bin/set_version.sh index 00811eb..2235807 100755 --- a/bin/set_version.sh +++ b/bin/set_version.sh @@ -28,7 +28,6 @@ if [ "$HIVEMALL_HOME" = "" ]; then exit 1 fi fi - cd $HIVEMALL_HOME function yes_or_no() { @@ -48,6 +47,15 @@ function yes_or_no() { done } +update_pom=1 +for opt in "$@"; do + case "${opt}" in + '--pom' ) + update_pom=0; shift + ;; + esac +done + old_version=`cat VERSION` echo "Current version number is ${old_version}" echo @@ -57,20 +65,28 @@ echo echo "Please input a version string (e.g., 0.4.3-rc.2)" echo -n ">>" read new_version - echo + +if [ $update_pom -eq 1 ]; then + echo "Do you want update pom.xml as well?" + yes_or_no + update_pom="$?" +fi + echo "--------------------------------------------------------------------------" echo "[Here are the list of files to update]" -echo -find . -type f \( -name 'VERSION' -o -name 'pom.xml' -o -name 'HivemallConstants.java' -o -name 'HivemallOpsSuite.scala' -o -name 'HiveUdfSuite.scala' \) | xargs grep ${old_version} +echo +if [ $update_pom -eq 0 ]; then + find . -type f \( -name 'VERSION' -o -name 'pom.xml' -o -name 'HivemallConstants.java' -o -name 'HivemallOpsSuite.scala' -o -name 'HiveUdfSuite.scala' \) | xargs grep ${old_version} +else + find . -type f \( -name 'VERSION' -o -name 'HivemallConstants.java' -o -name 'HivemallOpsSuite.scala' -o -name 'HiveUdfSuite.scala' \) | xargs grep ${old_version} +fi echo "--------------------------------------------------------------------------" echo echo "Do you really want to update Hivemall version string from ${old_version} to ${new_version}?" echo - yes_or_no - if [ "$?" -eq 1 ]; then echo "aborted!" exit 1 @@ -78,5 +94,10 @@ fi echo echo -n "Updating ..." -find . -type f \( -name 'VERSION' -o -name 'pom.xml' -o -name 'HivemallConstants.java' -o -name 'HivemallOpsSuite.scala' -o -name 'HiveUdfSuite.scala' \) | xargs sed -i '' -e "s/${old_version}/${new_version}/g" +if [ $update_pom -eq 0 ]; then + find . -type f \( -name 'VERSION' -o -name 'pom.xml' -o -name 'HivemallConstants.java' -o -name 'HivemallOpsSuite.scala' -o -name 'HiveUdfSuite.scala' \) | xargs sed -i '' -e "s/${old_version}/${new_version}/g" +else + find . -type f \( -name 'VERSION' -o -name 'HivemallConstants.java' -o -name 'HivemallOpsSuite.scala' -o -name 'HiveUdfSuite.scala' \) | xargs sed -i '' -e "s/${old_version}/${new_version}/g" +fi + echo "Done!"
