summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rbutil/rbutilqt/base/serverinfo.cpp9
-rw-r--r--rbutil/rbutilqt/base/systeminfo.cpp55
-rw-r--r--rbutil/rbutilqt/base/systeminfo.h19
-rw-r--r--rbutil/rbutilqt/gui/selectiveinstallwidget.cpp4
-rw-r--r--rbutil/rbutilqt/rbutil.ini52
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp3
-rw-r--r--rbutil/rbutilqt/test/stubs/stubs-serverinfo.cpp23
-rw-r--r--rbutil/rbutilqt/test/test-serverinfo.cpp4
8 files changed, 94 insertions, 75 deletions
diff --git a/rbutil/rbutilqt/base/serverinfo.cpp b/rbutil/rbutilqt/base/serverinfo.cpp
index 08f7f770b7..2f73d96beb 100644
--- a/rbutil/rbutilqt/base/serverinfo.cpp
+++ b/rbutil/rbutilqt/base/serverinfo.cpp
@@ -95,17 +95,20 @@ QVariant ServerInfo::platformValue(enum ServerInfos info, QString platform)
if(value.toStringList().size() > 1)
value = value.toStringList().at(1);
else if(!version.isEmpty() && info == CurReleaseUrl)
- value = SystemInfo::value(SystemInfo::ReleaseUrl).toString()
+ value = SystemInfo::value(SystemInfo::BuildUrl,
+ SystemInfo::BuildRelease).toString()
.replace("%MODEL%", platform)
.replace("%RELVERSION%", version);
else if(!version.isEmpty() && info == RelCandidateUrl)
- value = SystemInfo::value(SystemInfo::CandidateUrl).toString()
+ value = SystemInfo::value(SystemInfo::BuildUrl,
+ SystemInfo::BuildCandidate).toString()
.replace("%MODEL%", platform)
.replace("%RELVERSION%", version);
}
break;
case CurDevelUrl:
- value = SystemInfo::value(SystemInfo::BleedingUrl).toString()
+ value = SystemInfo::value(SystemInfo::BuildUrl,
+ SystemInfo::BuildCurrent).toString()
.replace("%MODEL%", platform);
break;
case ManualPdfUrl:
diff --git a/rbutil/rbutilqt/base/systeminfo.cpp b/rbutil/rbutilqt/base/systeminfo.cpp
index 67b0428ceb..2aece49110 100644
--- a/rbutil/rbutilqt/base/systeminfo.cpp
+++ b/rbutil/rbutilqt/base/systeminfo.cpp
@@ -27,28 +27,23 @@ const static struct {
SystemInfo::SystemInfos info;
const char* name;
} SystemInfosList[] = {
- { SystemInfo::ManualUrl, "manual_url" },
- { SystemInfo::BleedingUrl, "bleeding_url" },
- { SystemInfo::BootloaderUrl, "bootloader_url" },
- { SystemInfo::BootloaderInfoUrl, "bootloader_info_url" },
- { SystemInfo::ReleaseFontUrl, "release_font_url" },
- { SystemInfo::DailyFontUrl, "daily_font_url" },
- { SystemInfo::DailyVoiceUrl, "daily_voice_url" },
- { SystemInfo::ReleaseVoiceUrl, "release_voice_url" },
- { SystemInfo::DoomUrl, "doom_url" },
- { SystemInfo::Duke3DUrl, "duke3d_url" },
- { SystemInfo::PuzzFontsUrl, "puzzfonts_url" },
- { SystemInfo::QuakeUrl, "quake_url" },
- { SystemInfo::Wolf3DUrl, "wolf3d_url" },
- { SystemInfo::XWorldUrl, "xworld_url" },
- { SystemInfo::ReleaseUrl, "release_url" },
- { SystemInfo::CandidateUrl, "rc_url" },
- { SystemInfo::DailyUrl, "daily_url" },
- { SystemInfo::BuildInfoUrl, "build_info_url" },
- { SystemInfo::GenlangUrl, "genlang_url" },
- { SystemInfo::ThemesUrl, "themes_url" },
- { SystemInfo::ThemesInfoUrl, "themes_info_url" },
- { SystemInfo::RbutilUrl, "rbutil_url" },
+ { SystemInfo::ManualUrl, ":build:/manual_url" },
+ { SystemInfo::BuildUrl, ":build:/build_url" },
+ { SystemInfo::FontUrl, ":build:/font_url" },
+ { SystemInfo::VoiceUrl, ":build:/voice_url" },
+ { SystemInfo::BootloaderUrl, "bootloader/download_url" },
+ { SystemInfo::BootloaderInfoUrl, "bootloader/info_url" },
+ { SystemInfo::DoomUrl, "doom_url" },
+ { SystemInfo::Duke3DUrl, "duke3d_url" },
+ { SystemInfo::PuzzFontsUrl, "puzzfonts_url" },
+ { SystemInfo::QuakeUrl, "quake_url" },
+ { SystemInfo::Wolf3DUrl, "wolf3d_url" },
+ { SystemInfo::XWorldUrl, "xworld_url" },
+ { SystemInfo::BuildInfoUrl, "build_info_url" },
+ { SystemInfo::GenlangUrl, "genlang_url" },
+ { SystemInfo::ThemesUrl, "themes_url" },
+ { SystemInfo::ThemesInfoUrl, "themes_info_url" },
+ { SystemInfo::RbutilUrl, "rbutil_url" },
};
const static struct {
@@ -84,7 +79,7 @@ void SystemInfo::ensureSystemInfoExists()
}
-QVariant SystemInfo::value(enum SystemInfos info)
+QVariant SystemInfo::value(enum SystemInfos info, BuildType type)
{
ensureSystemInfoExists();
@@ -93,6 +88,20 @@ QVariant SystemInfo::value(enum SystemInfos info)
while(SystemInfosList[i].info != info)
i++;
QString s = SystemInfosList[i].name;
+ switch(type) {
+ case BuildDaily:
+ s.replace(":build:", "daily");
+ break;
+ case BuildCurrent:
+ s.replace(":build:", "development");
+ break;
+ case BuildCandidate:
+ s.replace(":build:", "release-candidate");
+ break;
+ case BuildRelease:
+ s.replace(":build:", "release");
+ break;
+ }
LOG_INFO() << "GET:" << s << systemInfos->value(s).toString();
return systemInfos->value(s);
}
diff --git a/rbutil/rbutilqt/base/systeminfo.h b/rbutil/rbutilqt/base/systeminfo.h
index c4afe4b27d..12b9eb4bfb 100644
--- a/rbutil/rbutilqt/base/systeminfo.h
+++ b/rbutil/rbutilqt/base/systeminfo.h
@@ -34,15 +34,21 @@ class SystemInfo : public QObject
MapIncompatible,
};
+ enum BuildType {
+ BuildCurrent,
+ BuildDaily,
+ BuildRelease,
+ BuildCandidate
+ };
+
//! All system settings
enum SystemInfos {
+ BuildUrl,
+ FontUrl,
+ VoiceUrl,
ManualUrl,
- BleedingUrl,
BootloaderUrl,
BootloaderInfoUrl,
- DailyUrl,
- DailyFontUrl,
- DailyVoiceUrl,
DoomUrl,
Duke3DUrl,
QuakeUrl,
@@ -50,9 +56,6 @@ class SystemInfo : public QObject
Wolf3DUrl,
XWorldUrl,
ReleaseUrl,
- CandidateUrl,
- ReleaseVoiceUrl,
- ReleaseFontUrl,
BuildInfoUrl,
GenlangUrl,
ThemesUrl,
@@ -92,7 +95,7 @@ class SystemInfo : public QObject
//! returns a map of usb-ids and their targets
static QMap<int, QStringList> usbIdMap(enum MapType type);
//! get a value from system settings
- static QVariant value(enum SystemInfos info);
+ static QVariant value(enum SystemInfos info, BuildType type = BuildCurrent);
//! get a value from system settings for a named platform.
static QVariant platformValue(enum PlatformInfo info, QString platform = "");
diff --git a/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp b/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp
index fafe79c8f7..c916e7a190 100644
--- a/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp
+++ b/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp
@@ -428,10 +428,10 @@ void SelectiveInstallWidget::installFonts(void)
QString relversion = installInfo.release();
if(relversion.isEmpty()) {
// release is empty for non-release versions (i.e. daily / current)
- fontsurl = SystemInfo::value(SystemInfo::DailyFontUrl).toString();
+ fontsurl = SystemInfo::value(SystemInfo::FontUrl, SystemInfo::BuildDaily).toString();
}
else {
- fontsurl = SystemInfo::value(SystemInfo::ReleaseFontUrl).toString();
+ fontsurl = SystemInfo::value(SystemInfo::FontUrl, SystemInfo::BuildRelease).toString();
logversion = installInfo.release();
}
fontsurl.replace("%RELEASEVER%", relversion);
diff --git a/rbutil/rbutilqt/rbutil.ini b/rbutil/rbutilqt/rbutil.ini
index 93af1bfb1b..e0d60e797e 100644
--- a/rbutil/rbutilqt/rbutil.ini
+++ b/rbutil/rbutilqt/rbutil.ini
@@ -1,30 +1,13 @@
[general]
-; builds
-release_url=http://download.rockbox.org/release/%RELVERSION%/rockbox-%MODEL%-%RELVERSION%.zip
-bleeding_url=http://build.rockbox.org/data/rockbox-%MODEL%.zip
-rc_url=http://download.rockbox.org/release-candidate/%RELVERSION%/rockbox-%MODEL%-%RELVERSION%.zip
-
-; voice files
-release_voice_url=http://download.rockbox.org/release/%RELVERSION%/%MODEL%-%RELVERSION%-english.zip
+; server information
+build_info_url=http://download.rockbox.org/build-info
+; genlang -- used to get list of strings (only really old builds)
genlang_url=http://www.rockbox.org/genlang/?lang=%LANG%&t=%TARGET%&rev=%REVISION%&f=%FEATURES%
-
-; bootloader
-bootloader_info_url=http://download.rockbox.org/bootloader/bootloaders-info
-bootloader_url=http://download.rockbox.org/bootloader
-
; themes
themes_url=http://themes.rockbox.org/
themes_info_url=http://themes.rockbox.org/rbutilqt.php?target=%TARGET%&release=%RELEASE%&revision=%REVISION%&rbutilver=%RBUTILVER%
-; server information
-build_info_url=http://download.rockbox.org/build-info
-
-; fonts
-release_font_url=http://download.rockbox.org/release/%RELEASEVER%/rockbox-fonts-%RELEASEVER%.zip
-daily_font_url=http://download.rockbox.org/daily/fonts/rockbox-fonts.zip
-
; other
-manual_url=http://download.rockbox.org/manual/rockbox-%MODEL%%FORMAT%
doom_url=http://download.rockbox.org/useful/rockdoom.zip
duke3d_url=http://download.rockbox.org/useful/duke3d.zip
quake_url=http://download.rockbox.org/useful/quake.zip
@@ -33,6 +16,35 @@ wolf3d_url=http://download.rockbox.org/useful/wolf3d.zip
xworld_url=http://download.rockbox.org/useful/xworld.zip
rbutil_url=http://download.rockbox.org/rbutil/
+[bootloader]
+info_url=http://download.rockbox.org/bootloader/bootloaders-info
+download_url=http://download.rockbox.org/bootloader
+
+[release]
+build_url=https://download.rockbox.org/release/%RELVERSION%/rockbox-%MODEL%-%RELVERSION%.zip
+voice_url=https://download.rockbox.org/release/%RELVERSION%/%MODEL%-%RELVERSION%-english.zip
+font_url=https://download.rockbox.org/release/%RELEASEVER%/rockbox-fonts-%RELEASEVER%.zip
+manual_url=https://download.rockbox.org/release/%RELEASEVER%/rockbox-%MODEL%%FORMAT%
+
+[release-candidate]
+build_url=https://download.rockbox.org/release-candidate/%RELVERSION%/rockbox-%MODEL%-%RELVERSION%.zip
+voice_url=https://download.rockbox.org/release-candidate/%RELVERSION%/%MODEL%-%RELVERSION%-english.zip
+font_url=https://download.rockbox.org/release-candidate/%RELEASEVER%/rockbox-fonts-%RELEASEVER%.zip
+manual_url=https://download.rockbox.org/release-candidate/%RELEASEVER%/rockbox-%MODEL%%FORMAT%
+
+[development]
+build_url=http://build.rockbox.org/data/rockbox-%MODEL%.zip
+voice_url=https://download.rockbox.org/release/%RELVERSION%/%MODEL%-%RELVERSION%-english.zip
+font_url=https://download.rockbox.org/daily/fonts/rockbox-fonts.zip
+; manual is only built daily, use that one instead.
+manual_url=https://download.rockbox.org/daily/manual/rockbox-%MODEL%%FORMAT%
+
+[daily]
+build_url=https://download.rockbox.org/daily/%MODEL%/rockbox-%MODEL%.zip
+voice_url=https://download.rockbox.org/daily/voices/%MODEL%-%VERSION%-%LANGUAGE%.zip
+font_url=https://download.rockbox.org/daily/fonts/rockbox-fonts.zip
+manual_url=https://download.rockbox.org/daily/manual/rockbox-%MODEL%%FORMAT%
+
; [platforms] is used to determine the order in the device tree.
; Only devices present in this section will get displayed!
[platforms]
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index d013a7cb58..597509cc78 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -483,7 +483,8 @@ void RbUtilQt::installVoice()
return;
}
else {
- voiceurl = SystemInfo::value(SystemInfo::ReleaseVoiceUrl).toString();
+ voiceurl = SystemInfo::value(SystemInfo::VoiceUrl,
+ SystemInfo::BuildRelease).toString();
logversion = installInfo.release();
}
if(QMessageBox::question(this, tr("Confirm Installation"),
diff --git a/rbutil/rbutilqt/test/stubs/stubs-serverinfo.cpp b/rbutil/rbutilqt/test/stubs/stubs-serverinfo.cpp
index 38336a7a6f..f0fcaf6613 100644
--- a/rbutil/rbutilqt/test/stubs/stubs-serverinfo.cpp
+++ b/rbutil/rbutilqt/test/stubs/stubs-serverinfo.cpp
@@ -38,27 +38,22 @@ QVariant SystemInfo::platformValue(SystemInfo::PlatformInfo info, QString platfo
return QString();
}
-QVariant SystemInfo::value(SystemInfo::SystemInfos info)
+QVariant SystemInfo::value(SystemInfo::SystemInfos info, SystemInfo::BuildType type)
{
- switch(info) {
- case SystemInfo::ManualUrl:
- return QString("https://unittest/manual/rockbox-%MODEL%%FORMAT%");
- break;
- case SystemInfo::BleedingUrl:
+ (void)info; // test is currently only using BuildUrl.
+ switch(type) {
+ case SystemInfo::BuildCurrent:
return QString("https://unittest/dev/rockbox-%MODEL%.zip");
- break;
- case SystemInfo::DailyUrl:
+ case SystemInfo::BuildDaily:
return QString("https://unittest/daily/rockbox-%MODEL%-%RELVERSION%.zip");
- break;
- case SystemInfo::ReleaseUrl:
+ case SystemInfo::BuildRelease:
return QString("https://unittest/release/%RELVERSION%/rockbox-%MODEL%-%RELVERSION%.zip");
- break;
- case SystemInfo::CandidateUrl:
+ case SystemInfo::BuildCandidate:
return QString("https://unittest/rc/%RELVERSION%/rockbox-%MODEL%-%RELVERSION%.zip");
- break;
default:
- return QString();
+ break;
}
+ return QString();
}
QStringList SystemInfo::platforms(SystemInfo::PlatformType type, QString variant)
diff --git a/rbutil/rbutilqt/test/test-serverinfo.cpp b/rbutil/rbutilqt/test/test-serverinfo.cpp
index bc6024e843..b999624c78 100644
--- a/rbutil/rbutilqt/test/test-serverinfo.cpp
+++ b/rbutil/rbutilqt/test/test-serverinfo.cpp
@@ -93,10 +93,6 @@ const struct testvector testdata[] =
{ "iaudiox5.v", ServerInfo::BleedingRevision, "be1be79" },
{ "iaudiox5.v", ServerInfo::BleedingDate, "2020-11-14T10:57:23" },
{ "iaudiox5.v", ServerInfo::CurDevelUrl, "https://unittest/dev/rockbox-iaudiox5.zip" },
- { "iaudiox5.v", ServerInfo::ManualPdfUrl, "https://unittest/manual/rockbox-iaudiox5.pdf" },
- { "ipodmini2g", ServerInfo::ManualPdfUrl, "https://unittest/manual/rockbox-ipodmini1g.pdf" },
- { "iriverh100", ServerInfo::ManualHtmlUrl, "https://unittest/manual/rockbox-iriverh100/rockbox-build.html" },
- { "iriverh120", ServerInfo::ManualZipUrl, "https://unittest/manual/rockbox-iriverh100-html.zip" },
};