summaryrefslogtreecommitdiff
path: root/indra/newview/llversioninfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llversioninfo.cpp')
-rw-r--r--[-rwxr-xr-x]indra/newview/llversioninfo.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp
index 5cc7d7bed3..a0ca91672a 100755..100644
--- a/indra/newview/llversioninfo.cpp
+++ b/indra/newview/llversioninfo.cpp
@@ -29,6 +29,7 @@
#include <iostream>
#include <sstream>
#include "llversioninfo.h"
+#include <boost/regex.hpp>
#if ! defined(LL_VIEWER_CHANNEL) \
|| ! defined(LL_VIEWER_VERSION_MAJOR) \
@@ -131,3 +132,48 @@ void LLVersionInfo::resetChannel(const std::string& channel)
sWorkingChannelName = channel;
sVersionChannel.clear(); // Reset version and channel string til next use.
}
+
+//static
+LLVersionInfo::ViewerMaturity LLVersionInfo::getViewerMaturity()
+{
+ ViewerMaturity maturity;
+
+ std::string channel = getChannel();
+
+ static const boost::regex is_test_channel("\\bTest\\b");
+ static const boost::regex is_beta_channel("\\bBeta\\b");
+ static const boost::regex is_project_channel("\\bProject\\b");
+ static const boost::regex is_release_channel("\\bRelease\\b");
+
+ if (boost::regex_search(channel, is_release_channel))
+ {
+ maturity = RELEASE_VIEWER;
+ }
+ else if (boost::regex_search(channel, is_beta_channel))
+ {
+ maturity = BETA_VIEWER;
+ }
+ else if (boost::regex_search(channel, is_project_channel))
+ {
+ maturity = PROJECT_VIEWER;
+ }
+ else if (boost::regex_search(channel, is_test_channel))
+ {
+ maturity = TEST_VIEWER;
+ }
+ else
+ {
+ LL_WARNS() << "Channel '" << channel
+ << "' does not follow naming convention, assuming Test"
+ << LL_ENDL;
+ maturity = TEST_VIEWER;
+ }
+ return maturity;
+}
+
+
+const std::string &LLVersionInfo::getBuildConfig()
+{
+ static const std::string build_configuration(LLBUILD_CONFIG); // set in indra/cmake/BuildVersion.cmake
+ return build_configuration;
+}