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 2018/10/25 20:41:04 UTC
[trafficcontrol] branch master updated: Trim `wc -l` output for
build number when running on Mac
This is an automated email from the ASF dual-hosted git repository.
dangogh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new 60f530b Trim `wc -l` output for build number when running on Mac
60f530b is described below
commit 60f530b946ad0391169ef2f5c8c0aca246412ff7
Author: Rawlin Peters <ra...@comcast.com>
AuthorDate: Thu Oct 25 12:15:03 2018 -0600
Trim `wc -l` output for build number when running on Mac
On Mac `wc -l` output contains leading whitespace, and this ends up
causing the following error:
cp -f ../../dist/traffic_monitor-3.0.0- 9679.ee069e97.el7.x86_64.rpm
traffic_monitor/traffic_monitor.rpm
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ...
target_directory
make: *** [traffic_monitor/traffic_monitor.rpm] Error 64
By trimming the output from `wc -l`, that leading space is removed and
fixes the error.
---
infrastructure/cdn-in-a-box/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/infrastructure/cdn-in-a-box/Makefile b/infrastructure/cdn-in-a-box/Makefile
index 37f8526..d2a899b 100644
--- a/infrastructure/cdn-in-a-box/Makefile
+++ b/infrastructure/cdn-in-a-box/Makefile
@@ -29,7 +29,7 @@ ifneq ($(PWD),$(makefile_dir))
$(error This makefile MUST be run from within its directory)
endif
-BUILD_NUMBER := $(shell git rev-list HEAD 2>/dev/null | wc -l).$(shell git rev-parse --short=8 HEAD)
+BUILD_NUMBER := $(shell git rev-list HEAD 2>/dev/null | wc -l | tr -d '[[:space:]]').$(shell git rev-parse --short=8 HEAD)
TC_VERSION := $(shell cat "../../VERSION")
TOMCAT_VERSION := $(shell grep 'export TOMCAT_VERSION=' ../../traffic_router/build/build_rpm.sh | cut -d '=' -f 2)
TOMCAT_RELEASE := $(shell grep 'export TOMCAT_RELEASE=' ../../traffic_router/build/build_rpm.sh | cut -d '=' -f 2)