aboutsummaryrefslogtreecommitdiff
path: root/buildconfig/BuildConfig.cpp.in
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-06-23 11:02:25 +0200
committerSefa Eyeoglu <contact@scrumplex.net>2022-07-03 17:23:13 +0200
commitcbc1aad58d21f5551f1405ea441cfa176bf56739 (patch)
tree63ca7899354cd6cc20236e44d901fa36982fa5b2 /buildconfig/BuildConfig.cpp.in
parent89a30a47c52bde8fd4b4af147aafc89075057e74 (diff)
downloadPrismLauncher-cbc1aad58d21f5551f1405ea441cfa176bf56739.tar.gz
PrismLauncher-cbc1aad58d21f5551f1405ea441cfa176bf56739.tar.bz2
PrismLauncher-cbc1aad58d21f5551f1405ea441cfa176bf56739.zip
fix: don't assume stable channel, if tag is unset
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Diffstat (limited to 'buildconfig/BuildConfig.cpp.in')
-rw-r--r--buildconfig/BuildConfig.cpp.in19
1 files changed, 14 insertions, 5 deletions
diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in
index 2051dbdf..89f040e5 100644
--- a/buildconfig/BuildConfig.cpp.in
+++ b/buildconfig/BuildConfig.cpp.in
@@ -64,12 +64,16 @@ Config::Config()
GIT_COMMIT = "@Launcher_GIT_COMMIT@";
GIT_TAG = "@Launcher_GIT_TAG@";
GIT_REFSPEC = "@Launcher_GIT_REFSPEC@";
+
+ // Assume that builds outside of Git repos are "stable"
if (GIT_REFSPEC == QStringLiteral("GITDIR-NOTFOUND")
- || GIT_TAG == QStringLiteral("-128-NOTFOUND"))
+ || GIT_TAG == QStringLiteral("GITDIR-NOTFOUND"))
{
- VERSION_CHANNEL = QStringLiteral("stable");
+ GIT_REFSPEC = "refs/heads/stable";
+ GIT_TAG = versionString();
}
- else if(GIT_REFSPEC.startsWith("refs/heads/"))
+
+ if (GIT_REFSPEC.startsWith("refs/heads/"))
{
VERSION_CHANNEL = GIT_REFSPEC;
VERSION_CHANNEL.remove("refs/heads/");
@@ -83,7 +87,7 @@ Config::Config()
}
else
{
- VERSION_CHANNEL = QObject::tr("unknown");
+ VERSION_CHANNEL = "unknown";
}
VERSION_STR = "@Launcher_VERSION_STRING@";
@@ -102,9 +106,14 @@ Config::Config()
SUBREDDIT_URL = "@Launcher_SUBREDDIT_URL@";
}
+QString Config::versionString() const
+{
+ return QString("%1.%2.%3").arg(VERSION_MAJOR).arg(VERSION_MINOR).arg(VERSION_HOTFIX);
+}
+
QString Config::printableVersionString() const
{
- QString vstr = QString("%1.%2.%3").arg(VERSION_MAJOR).arg(VERSION_MINOR).arg(VERSION_HOTFIX);
+ QString vstr = versionString();
// If the build is not a main release, append the channel
if(VERSION_CHANNEL != "stable" && GIT_TAG != vstr)