Merge pull request #350 from zhsj/fix-version-suffix
Remove duplicated suffix on version string
This commit is contained in:
commit
0592810746
5 changed files with 2 additions and 47 deletions
|
|
@ -63,7 +63,6 @@ set(SOURCES
|
||||||
anbox/config.cpp
|
anbox/config.cpp
|
||||||
anbox/not_reachable.cpp
|
anbox/not_reachable.cpp
|
||||||
|
|
||||||
anbox/build/version.cpp
|
|
||||||
anbox/build/version.h.in
|
anbox/build/version.h.in
|
||||||
|
|
||||||
anbox/android/intent.cpp
|
anbox/android/intent.cpp
|
||||||
|
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2017 Simon Fels <morphis@gravedo.de>
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 3, as published
|
|
||||||
* by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranties of
|
|
||||||
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE. See the GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along
|
|
||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "anbox/build/version.h"
|
|
||||||
#include "anbox/utils.h"
|
|
||||||
|
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
namespace anbox {
|
|
||||||
namespace build {
|
|
||||||
static std::string init_version_string() {
|
|
||||||
std::string v;
|
|
||||||
if (!version_suffix || std::strlen(version_suffix) == 0)
|
|
||||||
v = utils::string_format("%s", version);
|
|
||||||
else
|
|
||||||
v = utils::string_format("%s-%s", version, version_suffix);
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string print_version() {
|
|
||||||
static const std::string v{init_version_string()};
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
} // namespace build
|
|
||||||
} // namespace anbox
|
|
||||||
|
|
@ -27,11 +27,6 @@ namespace anbox {
|
||||||
namespace build {
|
namespace build {
|
||||||
/// @brief version marks the version
|
/// @brief version marks the version
|
||||||
static constexpr const char *version{"@ANBOX_VERSION@"};
|
static constexpr const char *version{"@ANBOX_VERSION@"};
|
||||||
/// @brief version_suffix is an additional suffix which can be amended to
|
|
||||||
/// the major version number to indicate a dev build for example.
|
|
||||||
static constexpr const char *version_suffix{"@ANBOX_VERSION_SUFFIX@"};
|
|
||||||
/// @brief version queries the version of Anbox
|
|
||||||
std::string print_version();
|
|
||||||
} // namespace build
|
} // namespace build
|
||||||
} // namespace anbox
|
} // namespace anbox
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ class SystemInformation {
|
||||||
std::stringstream s;
|
std::stringstream s;
|
||||||
|
|
||||||
s << "version: "
|
s << "version: "
|
||||||
<< anbox::build::print_version()
|
<< anbox::build::version
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
if (anbox::utils::is_env_set("SNAP_REVISION")) {
|
if (anbox::utils::is_env_set("SNAP_REVISION")) {
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ anbox::cmds::Version::Version()
|
||||||
cli::Name{"version"}, cli::Usage{"version"},
|
cli::Name{"version"}, cli::Usage{"version"},
|
||||||
cli::Description{"print the version of the daemon"}} {
|
cli::Description{"print the version of the daemon"}} {
|
||||||
action([](const cli::Command::Context& ctxt) {
|
action([](const cli::Command::Context& ctxt) {
|
||||||
ctxt.cout << "anbox " << build::print_version() << std::endl;
|
ctxt.cout << "anbox " << build::version << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue