qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [1/2] qpid-proton git commit: NO-JIRA: improvements to export.sh
Date Wed, 06 May 2015 12:04:46 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master dcd4e47df -> 9a812bab4


NO-JIRA: improvements to export.sh

+ allow specific tag to be specified as cmdline arg
+ confirm the tag exists before proceeding
+ use the version.txt from that tag as the tar prefix folder
+ re-run the version.sh script before packaging to ensure the correct
  version is set
+ add .gitattributes to exclude .gitignore files from the exported tar

Closes #28


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

Branch: refs/heads/master
Commit: a90e2b1c04dd8a03d240b83ed9b67c3f7611a66c
Parents: 703db66
Author: Dominic Evans <dominic.evans@uk.ibm.com>
Authored: Wed May 6 12:03:58 2015 +0100
Committer: Dominic Evans <dominic.evans@uk.ibm.com>
Committed: Wed May 6 12:06:44 2015 +0100

----------------------------------------------------------------------
 .gitattributes |  2 ++
 bin/export.sh  | 30 ++++++++++++++++++++++--------
 2 files changed, 24 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a90e2b1c/.gitattributes
----------------------------------------------------------------------
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..0508865
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+.gitattributes export-ignore  
+.gitignore export-ignore

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a90e2b1c/bin/export.sh
----------------------------------------------------------------------
diff --git a/bin/export.sh b/bin/export.sh
index 85ef2c7..13fdbd1 100755
--- a/bin/export.sh
+++ b/bin/export.sh
@@ -28,7 +28,8 @@ SRC=$(dirname $(dirname $(readlink -f $0)))
 
 usage()
 {
-    echo "Usage: ${ME} [DIR]"
+    echo
+    echo "Usage: ${ME} [DIR] [TAG]"
     exit 1
 }
 
@@ -39,14 +40,24 @@ cleanup()
     [ ${WORKDIR} ] && [ -d ${WORKDIR} ] && rm -rf ${WORKDIR}
 }
 
-if [ $# == 1 ]; then
-    DIR=$1
-elif [ $# == 0 ]; then
-    DIR=$PWD
-else
+DIR=$PWD
+TAG=$(git describe --tags --always)
+
+##
+## Allow overrides to be passed on the cmdline
+##
+if [ $# -gt 2 ]; then
     usage
+elif [ $# -ge 1 ]; then
+    DIR=$1
+    if [ $# -eq 2 ]; then
+        TAG=$2
+    fi
 fi
 
+# verify the tag exists
+git rev-list -1 tags/${TAG} -- >/dev/null || usage
+
 WORKDIR=$(mktemp -d)
 
 ##
@@ -54,15 +65,18 @@ WORKDIR=$(mktemp -d)
 ##
 (
     cd ${SRC}
-    TAG=$(git describe --tags --always)
     MTIME=$(date -d @`git log -1 --pretty=format:%ct tags/${TAG}` '+%Y-%m-%d %H:%M:%S')
     ARCHIVE=$DIR/qpid-proton-${TAG}.tar.gz
+    VERSION=$(git show tags/${TAG}:version.txt)
+    PREFIX=qpid-proton-${VERSION}
     [ -d ${WORKDIR} ] || mkdir -p ${WORKDIR}
-    git archive --format=tar --prefix=qpid-proton-${TAG}/ tags/${TAG} \
+    git archive --format=tar --prefix=${PREFIX}/ tags/${TAG} \
         | tar -x -C ${WORKDIR}
+    ${SRC}/bin/version.sh ${WORKDIR}/${PREFIX} ${VERSION}
     cd ${WORKDIR}
     tar -c -z \
         --owner=root --group=root --numeric-owner \
         --mtime="${MTIME}" \
         -f ${ARCHIVE} .
+    echo "${ARCHIVE}"
 )


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message