You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ts...@apache.org on 2017/08/17 07:12:39 UTC

[4/6] logging-log4cxx git commit: functions added

functions added


Project: http://git-wip-us.apache.org/repos/asf/logging-log4cxx/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4cxx/commit/3ca47c80
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4cxx/tree/3ca47c80
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4cxx/diff/3ca47c80

Branch: refs/heads/next_stable
Commit: 3ca47c80a273dd1e01b71aaf2970c037e8055f13
Parents: e1265f0
Author: Thorsten Schöning <ts...@am-soft.de>
Authored: Thu Aug 17 09:07:22 2017 +0200
Committer: Thorsten Schöning <ts...@am-soft.de>
Committed: Thu Aug 17 09:07:22 2017 +0200

----------------------------------------------------------------------
 releasePerform.sh | 100 ++++++++++++++++++++++++++++++-------------------
 1 file changed, 61 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4cxx/blob/3ca47c80/releasePerform.sh
----------------------------------------------------------------------
diff --git a/releasePerform.sh b/releasePerform.sh
index 99f542f..a290bf1 100755
--- a/releasePerform.sh
+++ b/releasePerform.sh
@@ -27,49 +27,71 @@
 # most likely prepared by the preparing counterpart.
 #
 
-# log4cxx is able to build using private copies of apr and apr-util, which are expected in some 
-# special relative dir structure. That doesn't work with the default working dir "perform" uses, 
-# which is "target/checkout". So we either need to make apr and apr-util available in "target" or 
-# change the working dir. Making available seems easy using symlinks, but "mvn clean" deletes the
-# contents(!) of the linked dirs then. And always copying things around seems a bit unnecessary as
-# well, so I'm using a relocation of the folder for now. The downside is that "mvn clean" ignores
-# that dir by default...
-WD_RELEASE="$(pwd)/../log4cxx-next_stable"
-WD_DIST_DEV="$(pwd)/../log4cxx-dist-dev"
+function main()
+{
+  # log4cxx is able to build using private copies of apr and apr-util, which are expected in some
+  # special relative dir structure. That doesn't work with the default working dir "perform" uses,
+  # which is "target/checkout". So we either need to make apr and apr-util available in "target" or
+  # change the working dir. Making available seems easy using symlinks, but "mvn clean" deletes the
+  # contents(!) of the linked dirs then. And always copying things around seems a bit unnecessary as
+  # well, so I'm using a relocation of the folder for now. The downside is that "mvn clean" ignores
+  # that dir by default...
+  WD_RELEASE="$( pwd)/../log4cxx-next_stable"
+  WD_DIST_DEV="$(pwd)/../log4cxx-dist-dev"
 
-rm -rf "${WD_RELEASE}"
-mvn release:perform "-DworkingDirectory=${WD_RELEASE}"
+  perform_release
+  prepare_dist_dev
+  sign_and_copy
+  publish_for_vote
+}
+
+function perform_release()
+{
+  rm -rf "${WD_RELEASE}"
+  mvn release:perform "-DworkingDirectory=${WD_RELEASE}"
+}
 
 # Prepare dist/dev to get the release candidate published for a vote.
-mkdir -p "${WD_DIST_DEV}"
-pushd    "${WD_DIST_DEV}" > /dev/null
-if [ ! -d ".svn" ]
-then
-  svn co "https://dist.apache.org/repos/dist/dev/logging/log4cxx" .
-fi
-svn up
+function prepare_dist_dev()
+{
+  mkdir -p "${WD_DIST_DEV}"
+  pushd    "${WD_DIST_DEV}" > /dev/null
+  if [ ! -d ".svn" ]
+  then
+    svn co "https://dist.apache.org/repos/dist/dev/logging/log4cxx" .
+  fi
+  svn up
+}
 
-# Might be a good idea to have another look at the GPG plugin for Maven in the future:
-#
-# http://blog.sonatype.com/2010/01/how-to-generate-pgp-signatures-with-maven/
-# http://maven.apache.org/plugins/maven-gpg-plugin/
-pushd "${WD_RELEASE}/target" > /dev/null
-for file in *.tar.gz *.zip
-do
-  echo "Processing ${file}:"
+function sign_and_copy()
+{
+  # Might be a good idea to have another look at the GPG plugin for Maven in the future:
+  #
+  # http://blog.sonatype.com/2010/01/how-to-generate-pgp-signatures-with-maven/
+  # http://maven.apache.org/plugins/maven-gpg-plugin/
+  pushd "${WD_RELEASE}/target" > /dev/null
+  for file in "*.tar.gz" "*.zip"
+  do
+    echo "Processing ${file}:"
+
+    gpg -ab --yes "${file}" > "${file}.asc"
+    md5sum        "${file}" > "${file}.md5"
+    sha512sum     "${file}" > "${file}.sha"
 
-  gpg -ab --yes "${file}" > "${file}.asc"
-  md5sum        "${file}" > "${file}.md5"
-  sha512sum     "${file}" > "${file}.sha"
+    # No symlinks because those would be treated as is, no hardlinks because it should be safer for
+    # commits.
+    cp  --force   "${file}"     "${WD_DIST_DEV}"
+    cp  --force   "${file}.asc" "${WD_DIST_DEV}"
+    cp  --force   "${file}.md5" "${WD_DIST_DEV}"
+    cp  --force   "${file}.sha" "${WD_DIST_DEV}"
+  done
+}
 
-  # No symlinks because those would be treated as is, no hardlinks because it should be safer for
-  # commits.
-  cp  --force   "${file}"     "${WD_DIST_DEV}"
-  cp  --force   "${file}.asc" "${WD_DIST_DEV}"
-  cp  --force   "${file}.md5" "${WD_DIST_DEV}"
-  cp  --force   "${file}.sha" "${WD_DIST_DEV}"
-done
+function publish_for_vote()
+{
+  pushd "${WD_DIST_DEV}" > /dev/null
+  svn add --force "*.*"
+  svn ci  -m "Publishing artifacts for new release to vote on."
+}
 
-pushd "${WD_DIST_DEV}" > /dev/null
-svn add --force *.*
-svn ci  -m "Adding artifacts for new release to vote on."
+main