Repository: incubator-hivemall
Updated Branches:
  refs/heads/master 4fd3b74c3 -> d93aac6ab (forced update)


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/d93aac6a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/tree/d93aac6a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/diff/d93aac6a

Branch: refs/heads/master
Commit: d93aac6ab3d2d3ab09aa0436832e341152a26f35
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:26:39 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/d93aac6a/bin/set_version.sh
----------------------------------------------------------------------
diff --git a/bin/set_version.sh b/bin/set_version.sh
index 00811eb..84e0335 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!"

Reply via email to