You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by mx...@apache.org on 2015/10/28 12:47:04 UTC

[2/2] flink git commit: [release][scripts] use perl instead of sed for portability

[release][scripts] use perl instead of sed for portability


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/edd1914a
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/edd1914a
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/edd1914a

Branch: refs/heads/master
Commit: edd1914a0db7ecfd2193530f8d8ceaf217bc5bcd
Parents: 4687932
Author: Maximilian Michels <mx...@apache.org>
Authored: Wed Oct 28 12:27:49 2015 +0100
Committer: Maximilian Michels <mx...@apache.org>
Committed: Wed Oct 28 12:43:00 2015 +0100

----------------------------------------------------------------------
 tools/change-version.sh       |  4 ++--
 tools/create_release_files.sh | 24 +++++-------------------
 2 files changed, 7 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/edd1914a/tools/change-version.sh
----------------------------------------------------------------------
diff --git a/tools/change-version.sh b/tools/change-version.sh
index 19384a4..d937b92 100755
--- a/tools/change-version.sh
+++ b/tools/change-version.sh
@@ -28,7 +28,7 @@ if [[ "$HERE" != "tools" ]]; then
 fi
 
 # change version in all pom files
-find .. -name 'pom.xml' -type f -exec sed -i 's#<version>'"$OLD"'</version>#<version>'"$NEW"'</version>#' {} \;
+find .. -name 'pom.xml' -type f -exec perl -pi -e 's#<version>'"$OLD"'</version>#<version>'"$NEW"'</version>#' {} \;
 
 # change version of the quickstart property
-find .. -name 'pom.xml' -type f -exec sed -i 's#<flink.version>'"$OLD"'</flink.version>#<flink.version>'"$NEW"'</flink.version>#' {} \;
\ No newline at end of file
+find .. -name 'pom.xml' -type f -exec perl -pi -e 's#<flink.version>'"$OLD"'</flink.version>#<flink.version>'"$NEW"'</flink.version>#' {} \;

http://git-wip-us.apache.org/repos/asf/flink/blob/edd1914a/tools/create_release_files.sh
----------------------------------------------------------------------
diff --git a/tools/create_release_files.sh b/tools/create_release_files.sh
index 6a77420..7ba2206 100755
--- a/tools/create_release_files.sh
+++ b/tools/create_release_files.sh
@@ -105,30 +105,16 @@ make_source_release() {
   cd flink
 
   #change version in all pom files
-  if [ "$(uname)" == "Darwin" ]; then
-      find . -name 'pom.xml' -type f -exec sed -i "" 's#<version>'$OLD_VERSION'</version>#<version>'$NEW_VERSION'</version>#' {} \;
-  else
-      find . -name 'pom.xml' -type f -exec sed -i    's#<version>'$OLD_VERSION'</version>#<version>'$NEW_VERSION'</version>#' {} \;
-  fi
+  find . -name 'pom.xml' -type f -exec perl -pi -e 's#<version>'$OLD_VERSION'</version>#<version>'$NEW_VERSION'</version>#' {} \;
 
   #change version in quickstart archetypes
-  if [ "$(uname)" == "Darwin" ]; then
-      find . -name 'pom.xml' -type f -exec sed -i "" 's#<flink.version>'$OLD_VERSION'</flink.version>#<flink.version>'$NEW_VERSION'</flink.version>#' {} \;
-  else
-      find . -name 'pom.xml' -type f -exec sed -i    's#<flink.version>'$OLD_VERSION'</flink.version>#<flink.version>'$NEW_VERSION'</flink.version>#' {} \;
-  fi
+  find . -name 'pom.xml' -type f -exec perl -pi -e 's#<flink.version>'$OLD_VERSION'</flink.version>#<flink.version>'$NEW_VERSION'</flink.version>#' {} \;
 
   #change version of documentation
   cd docs
-  if [ "$(uname)" == "Darwin" ]; then
-      sed -i "" "s#version: .*#version: ${NEW_VERSION}#" _config.yml
-      sed -i "" "s#version_hadoop1: .*#version_hadoop1: ${NEW_VERSION}-hadoop1#" _config.yml
-      sed -i "" "s#version_short: .*#version_short: ${NEW_VERSION}#" _config.yml
-  else
-      sed -i   "s#version: .*#version: ${NEW_VERSION}#" _config.yml
-      sed -i    "s#version_hadoop1: .*#version_hadoop1: ${NEW_VERSION}-hadoop1#" _config.yml
-      sed -i    "s#version_short: .*#version_short: ${NEW_VERSION}#" _config.yml
-  fi
+  perl -pi -e "s#^version: .*#version: ${NEW_VERSION}#" _config.yml
+  perl -pi -e "s#^version_hadoop1: .*#version_hadoop1: ${NEW_VERSION}-hadoop1#" _config.yml
+  perl -pi -e "s#^version_short: .*#version_short: ${NEW_VERSION}#" _config.yml
   cd ..
 
   git commit --author="$GIT_AUTHOR" -am "Commit for release $RELEASE_VERSION"