From 6441b213e2a4af794587fdeb3d8bd8a0200309f6 Mon Sep 17 00:00:00 2001 From: Isaac Garzon Date: Thu, 10 Nov 2022 14:05:19 +0200 Subject: [PATCH] build_version: apply the build tag to the Speedb version string (#231) The changes in #157 were accidentally applied to the `GetRocksVersionAsString()` function instead of the `GetSpeedbVersionAsString()` function. This replaced the RocksDB patch number with the Speedb one, and added the build tag in the wrong place. Fix it by moving the logic to the intended function. --- util/build_version.cc.in | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/util/build_version.cc.in b/util/build_version.cc.in index 1aa2441ea2..fb39eb96d6 100644 --- a/util/build_version.cc.in +++ b/util/build_version.cc.in @@ -68,6 +68,15 @@ const std::unordered_map& GetRocksBuildProperties() { std::string GetRocksVersionAsString(bool with_patch) { std::string version = ToString(ROCKSDB_MAJOR) + "." + ToString(ROCKSDB_MINOR); + if (with_patch) { + return version + "." + ToString(ROCKSDB_PATCH); + } else { + return version; + } +} + +std::string GetSpeedbVersionAsString(bool with_patch) { + std::string version = ToString(SPEEDB_MAJOR) + "." + ToString(SPEEDB_MINOR); if (with_patch) { version += "." + ToString(SPEEDB_PATCH); // Only add a build tag if it was specified (e.g. not a release build) @@ -83,15 +92,6 @@ std::string GetRocksVersionAsString(bool with_patch) { return version; } -std::string GetSpeedbVersionAsString(bool with_patch) { - std::string version = ToString(SPEEDB_MAJOR) + "." + ToString(SPEEDB_MINOR); - if (with_patch) { - return version + "." + ToString(SPEEDB_PATCH); - } else { - return version; - } -} - std::string GetRocksBuildInfoAsString(const std::string& program, bool verbose) { std::string info = program + " (Speedb) " + GetSpeedbVersionAsString(true) + " (" + GetRocksVersionAsString(true) + ")";