You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2014/07/10 19:14:56 UTC
git commit: TS-2932: specify the build number at build time
Repository: trafficserver
Updated Branches:
refs/heads/master d537357da -> 0030d8f2c
TS-2932: specify the build number at build time
Add a --with-build-number configuration option so that this can be
published in proxy.node.version.manager.build_number and
proxy.process.version.server.build_number.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0030d8f2
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0030d8f2
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0030d8f2
Branch: refs/heads/master
Commit: 0030d8f2cd1c74d459342f196d2c7e4b3a811efb
Parents: d537357
Author: James Peach <jp...@apache.org>
Authored: Wed Jul 9 16:47:13 2014 -0700
Committer: James Peach <jp...@apache.org>
Committed: Thu Jul 10 09:41:40 2014 -0700
----------------------------------------------------------------------
CHANGES | 2 ++
configure.ac | 26 ++++++++++++++++----------
lib/ts/Version.cc | 9 ++++++++-
lib/ts/ink_config.h.in | 1 +
4 files changed, 27 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0030d8f2/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index d96ac08..822639d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
-*- coding: utf-8 -*-
Changes with Apache Traffic Server 5.1.0
+ *) [TS-2932] Add an option to specify the build number at configure time.
+
*) [TS-2931] Plugin metrics fail after a crash.
*) [TS-2649] Use SSL certificate chain loading everywhere.
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0030d8f2/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 84a1007..c2121ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,16 +107,6 @@ AC_CANONICAL_HOST
HOST_GUESS="$host"
AC_SUBST(HOST_GUESS)
-#
-# Build environment
-#
-build_person="`id -nu`"
-build_group="`id -ng`"
-build_machine="`uname -n`"
-AC_SUBST([build_machine])
-AC_SUBST([build_person])
-AC_SUBST([build_group])
-
AC_ARG_WITH([user],
[AS_HELP_STRING([--with-user],[specify the system user [default=nobody]])],
[
@@ -138,6 +128,22 @@ AC_ARG_WITH([group],
AC_SUBST([pkgsysuser],[$with_user])
AC_SUBST([pkgsysgroup],[$with_group])
+AC_ARG_WITH([build-version],
+ [AS_HELP_STRING([--with-build-version],[specify a version string for this build])],
+ [ build_number="$withval" ]
+)
+
+#
+# Build environment
+#
+build_person="`id -nu`"
+build_group="`id -ng`"
+build_machine="`uname -n`"
+AC_SUBST([build_machine])
+AC_SUBST([build_person])
+AC_SUBST([build_group])
+AC_SUBST([build_number])
+
# -----------------------------------------------------------------------------
# 2. SITE CONFIGURATION
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0030d8f2/lib/ts/Version.cc
----------------------------------------------------------------------
diff --git a/lib/ts/Version.cc b/lib/ts/Version.cc
index 01dfa0b..a4423fc 100644
--- a/lib/ts/Version.cc
+++ b/lib/ts/Version.cc
@@ -69,7 +69,14 @@ AppVersionInfo::setup(const char *pkg_name, const char *app_name, const char *ap
ink_strlcpy(PkgStr, pkg_name, sizeof(PkgStr));
ink_strlcpy(AppStr, app_name, sizeof(AppStr));
snprintf(VersionStr, sizeof(VersionStr), "%s", app_version);
- snprintf(BldNumStr, sizeof(BldNumStr), "%d%d%d", month, day, hour);
+
+ // If the builder set a build number, use that. Otherwise take the build timestamp.
+ if (strlen(BUILD_NUMBER) == 0) {
+ snprintf(BldNumStr, sizeof(BldNumStr), "%d%d%d", month, day, hour);
+ } else {
+ snprintf(BldNumStr, sizeof(BldNumStr), "%s", BUILD_NUMBER);
+ }
+
snprintf(BldTimeStr, sizeof(BldTimeStr), "%s", build_time);
snprintf(BldDateStr, sizeof(BldDateStr), "%s", build_date);
snprintf(BldMachineStr, sizeof(BldMachineStr), "%s", build_machine);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0030d8f2/lib/ts/ink_config.h.in
----------------------------------------------------------------------
diff --git a/lib/ts/ink_config.h.in b/lib/ts/ink_config.h.in
index 9d88417..cde3103 100644
--- a/lib/ts/ink_config.h.in
+++ b/lib/ts/ink_config.h.in
@@ -41,6 +41,7 @@
#define BUILD_MACHINE "@build_machine@"
#define BUILD_PERSON "@build_person@"
#define BUILD_GROUP "@build_group@"
+#define BUILD_NUMBER "@build_number@"
/* Libraries */
#define TS_HAS_LIBZ @zlibh@