Skip to content

Commit

Permalink
build_version: apply the build tag to the Speedb version string (#231)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
isaac-io authored and Yuval-Ariel committed Nov 25, 2022
1 parent 57cf5f6 commit d7481e7
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions util/build_version.cc.in
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,16 @@ const std::unordered_map<std::string, std::string>& GetRocksBuildProperties() {
std::string GetRocksVersionAsString(bool with_patch) {
std::string version = std::to_string(ROCKSDB_MAJOR) + "." + std::to_string(ROCKSDB_MINOR);
if (with_patch) {
version += "." + ToString(SPEEDB_PATCH);
// Only add a build tag if it was specified (e.g. not a release build)
if (SPDB_BUILD_TAG[0] != '\0') {
if (SPDB_BUILD_TAG[0] == '@') {
// In case build tag substitution at build time failed, add a question mark
version += "-?";
} else {
version += "-" + std::string(SPDB_BUILD_TAG);
}
}
return version + "." + ToString(ROCKSDB_PATCH);
} else {
return version;
}
return version;
}

std::string GetSpeedbVersionAsString(bool with_patch) {
std::string version = std::to_string(SPEEDB_MAJOR) + "." + std::to_string(SPEEDB_MINOR);
std::string version = ToString(SPEEDB_MAJOR) + "." + ToString(SPEEDB_MINOR);
if (with_patch) {
version += "." + std::to_string(SPEEDB_PATCH);
version += "." + ToString(SPEEDB_PATCH);
// Only add a build tag if it was specified (e.g. not a release build)
if (SPDB_BUILD_TAG[0] != '\0') {
if (SPDB_BUILD_TAG[0] == '@') {
Expand Down

0 comments on commit d7481e7

Please sign in to comment.