diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2016-10-21 14:18:08 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2016-10-21 14:18:08 +0000 |
commit | d593d1b4a18375475af9a685a9181023aa8e2642 (patch) | |
tree | 1b699e2a5d5901c6b07fe79212b1586cb477f0a7 /messagebus | |
parent | c202f27ac730619ca99ac5d75fd04f4942563ca0 (diff) |
We only need one vtag
Diffstat (limited to 'messagebus')
-rw-r--r-- | messagebus/src/apps/printversion/printversion.cpp | 17 | ||||
-rw-r--r-- | messagebus/src/tests/routing/routing.cpp | 10 | ||||
-rw-r--r-- | messagebus/src/tests/simpleprotocol/simpleprotocol.cpp | 10 | ||||
-rw-r--r-- | messagebus/src/tests/targetpool/targetpool.cpp | 7 | ||||
-rw-r--r-- | messagebus/src/vespa/messagebus/CMakeLists.txt | 1 | ||||
-rw-r--r-- | messagebus/src/vespa/messagebus/network/rpcnetwork.cpp | 10 | ||||
-rw-r--r-- | messagebus/src/vespa/messagebus/testlib/testserver.cpp | 10 | ||||
-rw-r--r-- | messagebus/src/vespa/messagebus/vtag.cpp | 81 | ||||
-rw-r--r-- | messagebus/src/vespa/messagebus/vtag.h | 23 |
9 files changed, 31 insertions, 138 deletions
diff --git a/messagebus/src/apps/printversion/printversion.cpp b/messagebus/src/apps/printversion/printversion.cpp index 8401653fc51..d616394ef80 100644 --- a/messagebus/src/apps/printversion/printversion.cpp +++ b/messagebus/src/apps/printversion/printversion.cpp @@ -1,19 +1,18 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/fastos/fastos.h> -#include <vespa/messagebus/vtag.h> +#include <vespa/vespalib/component/vtag.h> #include <stdio.h> -#include <vespa/vespalib/component/version.h> int main(int, char **) { - printf("version tag: %s\n", mbus::VersionTag); - printf("version tag date: %s\n", mbus::VersionTagDate); - printf("version tag system: %s\n", mbus::VersionTagSystem); - printf("version tag system rev: %s\n", mbus::VersionTagSystemRev); - printf("version tag builder: %s\n", mbus::VersionTagBuilder); + printf("version tag: %s\n", vespalib::VersionTag); + printf("version tag date: %s\n", vespalib::VersionTagDate); + printf("version tag system: %s\n", vespalib::VersionTagSystem); + printf("version tag system rev: %s\n", vespalib::VersionTagSystemRev); + printf("version tag builder: %s\n", vespalib::VersionTagBuilder); printf("nice version:\n\t"); - mbus::Vtag::printVersionNice(); + vespalib::Vtag::printVersionNice(); printf("\n"); - printf("currentVersion object: %s\n", mbus::Vtag::currentVersion.toString().c_str()); + printf("currentVersion object: %s\n", vespalib::Vtag::currentVersion.toString().c_str()); return 0; } diff --git a/messagebus/src/tests/routing/routing.cpp b/messagebus/src/tests/routing/routing.cpp index b9c673263b5..23698279137 100644 --- a/messagebus/src/tests/routing/routing.cpp +++ b/messagebus/src/tests/routing/routing.cpp @@ -1,8 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("routing_test"); - #include <vespa/messagebus/emptyreply.h> #include <vespa/messagebus/errorcode.h> #include <vespa/messagebus/messagebus.h> @@ -16,8 +13,11 @@ LOG_SETUP("routing_test"); #include <vespa/messagebus/testlib/simplereply.h> #include <vespa/messagebus/testlib/slobrok.h> #include <vespa/messagebus/testlib/testserver.h> -#include <vespa/messagebus/vtag.h> +#include <vespa/vespalib/component/vtag.h> #include <vespa/vespalib/testkit/testapp.h> +#include <vespa/log/log.h> + +LOG_SETUP("routing_test"); using namespace mbus; @@ -650,7 +650,7 @@ Test::testTrace(TestData &data, const std::vector<string> &expected) bool Test::testTrace(const std::vector<string> &expected, const Trace &trace) { - string version = Vtag::currentVersion.toString(); + string version = vespalib::Vtag::currentVersion.toString(); string actual = trace.toString(); size_t pos = 0; for (uint32_t i = 0; i < expected.size(); ++i) { diff --git a/messagebus/src/tests/simpleprotocol/simpleprotocol.cpp b/messagebus/src/tests/simpleprotocol/simpleprotocol.cpp index eaf609a2be1..c4268e5108d 100644 --- a/messagebus/src/tests/simpleprotocol/simpleprotocol.cpp +++ b/messagebus/src/tests/simpleprotocol/simpleprotocol.cpp @@ -1,9 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("simpleprotocol_test"); - #include <vespa/vespalib/testkit/testapp.h> +#include <vespa/vespalib/component/vtag.h> #include <vespa/messagebus/errorcode.h> #include <vespa/messagebus/ireplyhandler.h> #include <vespa/messagebus/network/identity.h> @@ -14,7 +12,9 @@ LOG_SETUP("simpleprotocol_test"); #include <vespa/messagebus/testlib/simplereply.h> #include <vespa/messagebus/testlib/slobrok.h> #include <vespa/messagebus/testlib/testserver.h> -#include <vespa/messagebus/vtag.h> +#include <vespa/log/log.h> + +LOG_SETUP("simpleprotocol_test"); using namespace mbus; @@ -25,7 +25,7 @@ Test::Main() { TEST_INIT("simpleprotocol_test"); - vespalib::Version version = Vtag::currentVersion; + vespalib::Version version = vespalib::Vtag::currentVersion; SimpleProtocol protocol; EXPECT_TRUE(protocol.getName() == "Simple"); diff --git a/messagebus/src/tests/targetpool/targetpool.cpp b/messagebus/src/tests/targetpool/targetpool.cpp index 0e63be19547..855784ec557 100644 --- a/messagebus/src/tests/targetpool/targetpool.cpp +++ b/messagebus/src/tests/targetpool/targetpool.cpp @@ -1,13 +1,12 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("targetpool_test"); - -#include <vespa/messagebus/vtag.h> #include <vespa/messagebus/network/rpctargetpool.h> #include <vespa/messagebus/testlib/slobrok.h> #include <vespa/messagebus/testlib/testserver.h> #include <vespa/vespalib/testkit/testapp.h> +#include <vespa/log/log.h> + +LOG_SETUP("targetpool_test"); using namespace mbus; diff --git a/messagebus/src/vespa/messagebus/CMakeLists.txt b/messagebus/src/vespa/messagebus/CMakeLists.txt index 81b86d8e0dc..01526e0dd59 100644 --- a/messagebus/src/vespa/messagebus/CMakeLists.txt +++ b/messagebus/src/vespa/messagebus/CMakeLists.txt @@ -31,7 +31,6 @@ vespa_add_library(messagebus sourcesessionparams.cpp staticthrottlepolicy.cpp systemtimer.cpp - vtag.cpp $<TARGET_OBJECTS:messagebus_routing> $<TARGET_OBJECTS:messagebus_network> INSTALL lib64 diff --git a/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp b/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp index 434cdb0e3c3..8ec6794919b 100644 --- a/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp +++ b/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp @@ -1,19 +1,19 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".rpcnetwork"); - #include <vespa/messagebus/emptyreply.h> #include <vespa/messagebus/errorcode.h> #include <vespa/messagebus/iprotocol.h> #include <vespa/messagebus/tracelevel.h> -#include <vespa/messagebus/vtag.h> #include <vespa/vespalib/util/vstringfmt.h> #include <vespa/vespalib/util/sync.h> #include "inetworkowner.h" #include "rpcnetwork.h" #include "rpcsendv1.h" #include "rpcservice.h" +#include <vespa/log/log.h> + +LOG_SETUP(".rpcnetwork"); + namespace { @@ -160,7 +160,7 @@ RPCNetwork::flushTargetPool() const vespalib::Version & RPCNetwork::getVersion() const { - return Vtag::currentVersion; + return vespalib::Vtag::currentVersion; } void diff --git a/messagebus/src/vespa/messagebus/testlib/testserver.cpp b/messagebus/src/vespa/messagebus/testlib/testserver.cpp index c0ef5f9fbf9..cdc7325c508 100644 --- a/messagebus/src/vespa/messagebus/testlib/testserver.cpp +++ b/messagebus/src/vespa/messagebus/testlib/testserver.cpp @@ -1,22 +1,22 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".testserver"); - +#include <vespa/vespalib/component/vtag.h> #include <vespa/vespalib/util/vstringfmt.h> #include <vespa/messagebus/network/rpcnetworkparams.h> -#include <vespa/messagebus/vtag.h> #include "oosstate.h" #include "simpleprotocol.h" #include "slobrok.h" #include "slobrokstate.h" #include "testserver.h" +#include <vespa/log/log.h> + +LOG_SETUP(".testserver"); namespace mbus { VersionedRPCNetwork::VersionedRPCNetwork(const RPCNetworkParams ¶ms) : RPCNetwork(params), - _version(Vtag::currentVersion) + _version(vespalib::Vtag::currentVersion) { // empty } diff --git a/messagebus/src/vespa/messagebus/vtag.cpp b/messagebus/src/vespa/messagebus/vtag.cpp deleted file mode 100644 index 0a42b5e6ec0..00000000000 --- a/messagebus/src/vespa/messagebus/vtag.cpp +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <string.h> -#include <stdio.h> -#include "vtag.h" -#include <vespa/vespalib/component/version.h> - -#ifndef V_TAG -#define V_TAG "NOTAG" -#define V_TAG_DATE "NOTAG" -#define V_TAG_SYSTEM "NOTAG" -#define V_TAG_SYSTEM_REV "NOTAG" -#define V_TAG_BUILDER "NOTAG" -#define V_TAG_VERSION "0" -#define V_TAG_ARCH "NOTAG" -#endif - -namespace mbus { - -char VersionTag[] = V_TAG; -char VersionTagDate[] = V_TAG_DATE; -char VersionTagSystem[] = V_TAG_SYSTEM; -char VersionTagSystemRev[] = V_TAG_SYSTEM_REV; -char VersionTagBuilder[] = V_TAG_BUILDER; -char VersionTagPkg[] = V_TAG_PKG; -char VersionTagComponent[] = V_TAG_COMPONENT; -char VersionTagArch[] = V_TAG_ARCH; - -vespalib::Version Vtag::currentVersion(VersionTagComponent); - -void -Vtag::printVersionNice() -{ - char *s = VersionTag; - bool needdate = true; - if (strncmp(VersionTag, "V_", 2) == 0) { - s += 2; - do { - while (strchr("0123456789", *s) != NULL) { - printf("%c", *s++); - } - if (strncmp(s, "_RELEASE", 8) == 0) { - needdate = false; - break; - } - if (strncmp(s, "_RC", 3) == 0) { - char *e = strchr(s, '-'); - if (e == NULL) { - printf("%s", s); - } else { - printf("%.*s", (int)(e-s), s); - } - needdate = false; - break; - } - if (*s == '_' && strchr("0123456789", *++s)) { - printf("."); - } else { - break; - } - } while (*s && *s != '-'); - } else { - char *e = strchr(s, '-'); - if (e == NULL) { - printf("%s", s); - } else { - printf("%.*s", (int)(e-s), s); - } - } - if (needdate) { - s = VersionTagDate; - char *e = strchr(s, '-'); - if (e == NULL) { - printf("-%s", s); - } else { - printf("-%.*s", (int)(e-s), s); - } - } -} - -} // namespace mbus diff --git a/messagebus/src/vespa/messagebus/vtag.h b/messagebus/src/vespa/messagebus/vtag.h deleted file mode 100644 index 505ffb42161..00000000000 --- a/messagebus/src/vespa/messagebus/vtag.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#pragma once - -namespace vespalib { -class Version; -} - -namespace mbus { - -extern char VersionTag[]; -extern char VersionTagDate[]; -extern char VersionTagSystem[]; -extern char VersionTagSystemRev[]; -extern char VersionTagBuilder[]; - -class Vtag { -public: - static vespalib::Version currentVersion; - static void printVersionNice(); -}; - -} // namespace messagebus - |