You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2016/12/04 05:41:30 UTC
[04/22] incubator-trafficcontrol git commit: if not in git tree,
no tarball
if not in git tree, no tarball
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/df480152
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/df480152
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/df480152
Branch: refs/heads/psql-rebase
Commit: df480152e958ff3e137974c5064743d1edeadfab
Parents: ca648d9
Author: Dan Kirkwood <da...@gmail.com>
Authored: Fri Nov 11 18:41:11 2016 -0700
Committer: Jan van Doorn <jv...@apache.org>
Committed: Mon Nov 28 16:42:44 2016 +0000
----------------------------------------------------------------------
build/build.sh | 12 +++++++-----
build/functions.sh | 7 ++++---
2 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/df480152/build/build.sh
----------------------------------------------------------------------
diff --git a/build/build.sh b/build/build.sh
index 1327280..32d47d4 100755
--- a/build/build.sh
+++ b/build/build.sh
@@ -28,11 +28,13 @@ export TC_DIR=$(dirname $(dirname "$topscript"))
checkEnvironment
# Create tarball first
-projName=$(basename $(pwd))
-echo "----- Building tarball ..."
-tarball=$(createTarball "$TC_DIR")
-ls -l $tarball
-
+if isInGitTree; then
+ echo "----- Building tarball ..."
+ tarball=$(createTarball "$TC_DIR")
+ ls -l $tarball
+else
+ echo "---- Skipping tarball creation"
+fi
if [[ $# -gt 0 ]]; then
projects=( "$*" )
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/df480152/build/functions.sh
----------------------------------------------------------------------
diff --git a/build/functions.sh b/build/functions.sh
index 2132064..4f56e7a 100755
--- a/build/functions.sh
+++ b/build/functions.sh
@@ -49,13 +49,14 @@ function getRevCount() {
# ---------------------------------------
function isInGitTree() {
- git rev-parse --is-inside-work-tree 2>/dev/null
+ # ignore output -- use exit status
+ git rev-parse --is-inside-work-tree >/dev/null 2>&1
}
# ---------------------------------------
function getBuildNumber() {
- local in_git=$(isInGitTree)
- if [[ $in_git ]]; then
+ local in_git=$()
+ if isInGitTree; then
local commits=$(getRevCount)
local sha=$(git rev-parse --short=8 HEAD)
echo "$commits.$sha"