You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@edgent.apache.org by dl...@apache.org on 2016/12/29 23:17:49 UTC

incubator-edgent git commit: simplify download_edgent_asf.sh logic

Repository: incubator-edgent
Updated Branches:
  refs/heads/master c0d090ae8 -> a6090c844


simplify download_edgent_asf.sh logic


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

Branch: refs/heads/master
Commit: a6090c844bf2050e86cb90342d1f4bb214469f3d
Parents: c0d090a
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Thu Dec 29 17:28:58 2016 -0500
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Thu Dec 29 17:28:58 2016 -0500

----------------------------------------------------------------------
 buildTools/download_edgent_asf.sh | 60 ++++++++++++++++++++--------------
 1 file changed, 36 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a6090c84/buildTools/download_edgent_asf.sh
----------------------------------------------------------------------
diff --git a/buildTools/download_edgent_asf.sh b/buildTools/download_edgent_asf.sh
index b464513..9342313 100755
--- a/buildTools/download_edgent_asf.sh
+++ b/buildTools/download_edgent_asf.sh
@@ -77,39 +77,49 @@ if [ ${IS_RC} ]; then
 fi
 
 DST_BASE_DIR=downloaded-edgent-${VER}${RC_SFX}
-DST_VER_DIR=${DST_BASE_DIR}/${VER}-incubating
-if [ ${IS_RC} ]; then
-  DST_VER_DIR=${DST_VER_DIR}/${RC_SFX}
-fi
 [ -d ${DST_BASE_DIR} ] && die "${DST_BASE_DIR} already exists"
 
 [ ${NQUERY} ] || confirm "Proceed to download to ${DST_BASE_DIR} from ${BASE_URL}?" || exit
 
 echo Downloading to ${DST_BASE_DIR} ...
 
-# make a template structure of everything we're going to retrieve
+function mywget() {
+  # OSX lacks wget by default
+  (set -x; curl -f -O $1)
+}
+
+function getSignedBundle() {
+  mywget ${1}
+  mywget ${1}.asc
+  mywget ${1}.md5
+  mywget ${1}.sha
+}
+
 mkdir -p ${DST_BASE_DIR}
-(cd ${DST_BASE_DIR}; touch KEYS)
+cd ${DST_BASE_DIR}
+ABS_BASE_DIR=`pwd`
+URL=${BASE_URL}
+mywget ${URL}/KEYS
+
+DST_VER_DIR=${VER}-incubating
+URL=${BASE_URL}/${VER}-incubating
+if [ ${IS_RC} ]; then
+  DST_VER_DIR=${DST_VER_DIR}/${RC_SFX}
+  URL=${URL}/${RC_SFX}
+fi
 
 mkdir -p ${DST_VER_DIR}
-(cd ${DST_VER_DIR}; touch LICENSE README RELEASE_NOTES apache-edgent-${VER}-incubating-src.tgz{,.asc,.md5,.sha} )
-
-mkdir -p ${DST_VER_DIR}/binaries
-(cd ${DST_VER_DIR}/binaries; touch LICENSE apache-edgent-${VER}-incubating-bin.tgz{,.asc,.md5,.sha} )
-
-# download everything identified in the template tree
-ORIG_DIR=`pwd`
-cd `pwd`/${DST_BASE_DIR}
-for i in `find . -type f`; do
-  echo ======= $i
-  uri=`echo $i | sed -e s?^./??`  # strip leading "./"
-  url=${BASE_URL}/$uri
-  d=`dirname $i`
-  # OSX lacks wget by default
-  echo "(cd $d; curl -f -O $url)"
-  (cd $d; curl -f -O $url)
-done
-cd ${ORIG_DIR}
+cd ${DST_VER_DIR}
+mywget ${URL}/LICENSE
+mywget ${URL}/README
+mywget ${URL}/RELEASE_NOTES
+getSignedBundle ${URL}/apache-edgent-${VER}-incubating-src.tgz
+
+mkdir binaries
+cd binaries
+URL=${URL}/binaries
+mywget ${URL}/LICENSE
+getSignedBundle ${URL}/apache-edgent-${VER}-incubating-bin.tgz
 
 echo
 echo Done Downloading to ${DST_BASE_DIR}
@@ -123,6 +133,8 @@ echo "import the project's list of signing keys to your keyring"
 echo "    $ gpg ${DST_BASE_DIR}/KEYS            # show the included keys"
 echo "    $ gpg --import ${DST_BASE_DIR}/KEYS"
 
+cd ${ABS_BASE_DIR}
+
 echo
 echo "Verifying the source bundle signatures..."
 $BUILDTOOLS_DIR/check_sigs.sh ${DST_VER_DIR}