summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/base
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-06-17 11:25:11 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-06-17 11:25:11 +0200
commita3d9ace41ecbdfe72486dd9ec4d0dabf5eec299c (patch)
tree7e155fdd8208589a3ee71f4102b20224def069f3 /rbutil/rbutilqt/base
parentd3ddad95be5acac99b4f6e2a45336cc2b99a2ab2 (diff)
Support release-candidate entry format for releases.
The release-candiate entries provide both version and URL instead of only a version entry and requiring the URL to be constructed separately. Since it's easy to identify the format support both for release entries for improved flexibility -- if the server URLs ever change the server only needs to get updated to use the extended format. Change-Id: If5c669b72d7acd6ac648c5f42dd844ae36904df6
Diffstat (limited to 'rbutil/rbutilqt/base')
-rw-r--r--rbutil/rbutilqt/base/serverinfo.cpp29
1 files changed, 19 insertions, 10 deletions
diff --git a/rbutil/rbutilqt/base/serverinfo.cpp b/rbutil/rbutilqt/base/serverinfo.cpp
index eef7b1bdfe..995cc1fe74 100644
--- a/rbutil/rbutilqt/base/serverinfo.cpp
+++ b/rbutil/rbutilqt/base/serverinfo.cpp
@@ -71,13 +71,22 @@ void ServerInfo::readBuildInfo(QString file)
QString releaseUrl;
QString relCandidateVersion;
QString relCandidateUrl;
+ // support two formats for "release" sections:
+ // - <target>=<version>. In this case the URL is constructed.
+ // - <target>=<version>,<url>.
info.beginGroup("release");
if(keys.contains(platforms.at(i))) {
- releaseVersion = info.value(platforms.at(i)).toString();
- // construct release download URL
- releaseUrl = releaseBaseUrl;
- releaseUrl.replace("%MODEL%", platforms.at(i));
- releaseUrl.replace("%RELVERSION%", releaseVersion);
+ QStringList entry = info.value(platforms.at(i)).toStringList();
+ releaseVersion = entry.at(0);
+ if(entry.size() > 1) {
+ releaseUrl = entry.at(1);
+ }
+ else {
+ // construct release download URL
+ releaseUrl = releaseBaseUrl;
+ releaseUrl.replace("%MODEL%", platforms.at(i));
+ releaseUrl.replace("%RELVERSION%", releaseVersion);
+ }
}
info.endGroup();
// "release-candidate" section currently only support the 2nd format.
@@ -91,6 +100,11 @@ void ServerInfo::readBuildInfo(QString file)
}
info.endGroup();
+ // "bleeding" section (development) does not provide individual
+ // information but only a global revision value.
+ QString develUrl = develBaseUrl;
+ develUrl.replace("%MODEL%", platforms.at(i));
+ develUrl.replace("%RELVERSION%", developmentRevision);
info.beginGroup("status");
QString status = tr("Unknown");
@@ -109,11 +123,6 @@ void ServerInfo::readBuildInfo(QString file)
break;
}
info.endGroup();
- // release and development URLs are not provided by the server but
- // constructed.
- QString develUrl = develBaseUrl;
- develUrl.replace("%MODEL%", platforms.at(i));
- develUrl.replace("%RELVERSION%", developmentRevision);
// set variants (if any)
for(int j = 0; j < variants.size(); ++j) {
setPlatformValue(variants.at(j), ServerInfo::CurStatus, status);