Skip to content

Commit

Permalink
Use releaseMajorMinor for release URL in newer SFOS versions
Browse files Browse the repository at this point in the history
Fixes: #270
  • Loading branch information
rinigus committed May 23, 2024
1 parent 2831334 commit a7367a6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/ssu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@
#include <QDBusPendingReply>
#include <QDebug>

#if defined(sailfishos_version) && sailfishos_version >= 40600
#define RELEASE_TAG "%(releaseMajorMinor)"
#else
#define RELEASE_TAG "%(release)"
#endif

static QString s_repo_regular(
QStringLiteral("https://repo.sailfishos.org/obs/sailfishos:/chum/%(release)_%(arch)/"));
QStringLiteral("https://repo.sailfishos.org/obs/sailfishos:/chum/" RELEASE_TAG "_%(arch)/"));
static QString s_repo_regular_alias(
QStringLiteral("sailfishos-chum"));
static QString s_repo_regular_prefix(
QStringLiteral("https://repo.sailfishos.org/obs/sailfishos:/chum/"));
static QString s_repo_testing(
QStringLiteral("https://repo.sailfishos.org/obs/sailfishos:/chum:/testing/%(release)_%(arch)/"));
QStringLiteral("https://repo.sailfishos.org/obs/sailfishos:/chum:/testing/" RELEASE_TAG "_%(arch)/"));
static QString s_repo_testing_alias(
QStringLiteral("sailfishos-chum-testing"));
static QString s_repo_testing_prefix(
Expand Down Expand Up @@ -131,7 +137,7 @@ void Ssu::setRepo(const QString &version, bool testing) {
QString url = testing ? s_repo_testing : s_repo_regular;

if (!version.isEmpty()) {
url = url.replace(QLatin1String("%(release)"), version);
url = url.replace(QLatin1String(RELEASE_TAG), version);
}

if (rname != m_repo_name) {
Expand Down

0 comments on commit a7367a6

Please sign in to comment.