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/11/28 17:00:56 UTC
[3/5] 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/23e49aa1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/23e49aa1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/23e49aa1
Branch: refs/heads/psql-rebase
Commit: 23e49aa13d088691416fa4d774e1c98a9eb7c7b9
Parents: 3162178
Author: Dan Kirkwood <da...@gmail.com>
Authored: Fri Nov 11 18:41:11 2016 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Mon Nov 28 10:00:16 2016 -0700
----------------------------------------------------------------------
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/23e49aa1/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/23e49aa1/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"