summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2022-03-12 22:44:37 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2022-03-12 22:46:07 +0100
commit403cb96f3a314d0e46e9c4d338e0a3b98e250ddd (patch)
tree01391196d33d3f1010bf24e3cf535b663a512c0c
parentce70e34476a4a7eb23b4b7585a1a3277e6fcb38a (diff)
downloadrockbox-403cb96f3a.tar.gz
rockbox-403cb96f3a.zip
rbutil: Fix installing fonts / manual for development builds.
For development builds we provide a download URL, but use the daily build files. Those require the version of the daily build to be set when expanding the URL string. Change-Id: Ie6dcf38f7e86527217edc01ee11a20758a178622
-rw-r--r--utils/rbutilqt/base/playerbuildinfo.cpp38
-rw-r--r--utils/rbutilqt/gui/selectiveinstallwidget.cpp6
-rw-r--r--utils/rbutilqt/test/test-playerbuildinfo.cpp23
3 files changed, 48 insertions, 19 deletions
diff --git a/utils/rbutilqt/base/playerbuildinfo.cpp b/utils/rbutilqt/base/playerbuildinfo.cpp
index f118a9fd7a..aba377eafc 100644
--- a/utils/rbutilqt/base/playerbuildinfo.cpp
+++ b/utils/rbutilqt/base/playerbuildinfo.cpp
@@ -113,40 +113,46 @@ QVariant PlayerBuildInfo::value(BuildInfo item, BuildType type)
// For build info we don't use that.
QString target = RbSettings::value(RbSettings::CurrentPlatform).toString().split('.').at(0);
- QString s = ServerInfoList[i].name;
- s.replace(":target:", target);
- QString v;
+ QString serverinfo = ServerInfoList[i].name;
+ serverinfo.replace(":target:", target);
+ QString buildtypename;
switch(type) {
case TypeRelease:
- v = "release";
+ buildtypename = "release";
break;
case TypeCandidate:
- v = "release-candidate";
+ buildtypename = "release-candidate";
break;
case TypeDaily:
- v = "daily";
+ buildtypename = "daily";
break;
case TypeDevel:
- v = "development";
+ buildtypename = "development";
+ // manual and fonts don't exist for development builds. We do have an
+ // URL configured, but need to get the daily version instead.
+ if(item == BuildManualUrl || item == BuildFontUrl) {
+ LOG_INFO() << "falling back to daily build for this info value";
+ buildtypename = "daily";
+ }
break;
}
QVariant result = QString();
if (!serverInfo)
return result;
- QStringList version = serverInfo->value(v + "/" + target, "").toStringList();
- s.replace(":build:", v);
- s.replace(":version:", version.at(0));
+ QStringList version = serverInfo->value(buildtypename + "/" + target, "").toStringList();
+ serverinfo.replace(":build:", buildtypename);
+ serverinfo.replace(":version:", version.at(0));
// get value from server build-info
// we need to get a version string, otherwise the data is invalid.
// For invalid data return an empty string.
if(version.at(0).isEmpty()) {
- LOG_INFO() << s << "(version invalid)";
+ LOG_INFO() << serverinfo << "(version invalid)";
return result;
}
- if(!s.isEmpty())
- result = serverInfo->value(s);
+ if(!serverinfo.isEmpty())
+ result = serverInfo->value(serverinfo);
// depending on the actual value we need more replacements.
switch(item) {
@@ -163,8 +169,8 @@ QVariant PlayerBuildInfo::value(BuildInfo item, BuildType type)
case BuildVoiceLangs:
if (type == TypeDaily)
- s = "voices/daily";
- result = serverInfo->value(s);
+ serverinfo = "voices/daily";
+ result = serverInfo->value(serverinfo);
break;
case BuildManualUrl:
@@ -188,7 +194,7 @@ QVariant PlayerBuildInfo::value(BuildInfo item, BuildType type)
.replace("%TARGET%", target)
.replace("%VERSION%", version.at(0));
- LOG_INFO() << "B:" << s << result;
+ LOG_INFO() << "B:" << serverinfo << result;
return result;
}
diff --git a/utils/rbutilqt/gui/selectiveinstallwidget.cpp b/utils/rbutilqt/gui/selectiveinstallwidget.cpp
index b65f180521..4417a52a29 100644
--- a/utils/rbutilqt/gui/selectiveinstallwidget.cpp
+++ b/utils/rbutilqt/gui/selectiveinstallwidget.cpp
@@ -97,6 +97,12 @@ void SelectiveInstallWidget::selectedVersionChanged(int index)
ui.voiceCombobox->setEnabled(voice);
ui.voiceLabel->setEnabled(voice);
ui.voiceCheckbox->setToolTip(voice ? "" : tr("Not available for the selected version"));
+ QString fontsurl = PlayerBuildInfo::instance()->value(
+ PlayerBuildInfo::BuildFontUrl, m_buildtype).toString();
+ ui.fontsCheckbox->setEnabled(!fontsurl.isEmpty());
+ QString manualurl = PlayerBuildInfo::instance()->value(
+ PlayerBuildInfo::BuildManualUrl, m_buildtype).toString();
+ ui.manualCheckbox->setEnabled(!manualurl.isEmpty());
updateVoiceLangs();
}
diff --git a/utils/rbutilqt/test/test-playerbuildinfo.cpp b/utils/rbutilqt/test/test-playerbuildinfo.cpp
index 4dd5773576..de81b36a30 100644
--- a/utils/rbutilqt/test/test-playerbuildinfo.cpp
+++ b/utils/rbutilqt/test/test-playerbuildinfo.cpp
@@ -47,30 +47,42 @@ const char* testinfo =
"iriverh100 = 3.11.2, http://dl.rockbox.org/release/3.11.2/rockbox-iriverh100-3.11.2.zip\n"
"iriverh120 = 3.3\n"
"iriverh300 = \n"
+ "\n"
"[release-candidate]\n"
"build_url=https://buildurl/rc/%VERSION%/rockbox-%TARGET%-%VERSION%.zip\n"
"gigabeatfx=f9dce96,http://dl.rockbox.org/rc/f9dce96/rockbox-gigabeatfx.zip\n"
"archosfmrecorder=f9dce96\n"
"archosrecorder = f9dce96\n"
"iaudiox5=f9dce96,http://dl.rockbox.org/rc/f9dce96/rockbox-iaudiox5.zip\n"
+ "\n"
"[development]\n"
"build_url=https://buildurl/dev/rockbox-%TARGET%.zip\n"
+ "font_url=https://buildurl/daily/fonts/rockbox-fonts-%VERSION%.zip\n"
+ "manual_url=https://buildurl/daily/manual/rockbox-%TARGET%-%VERSION%%FORMAT%\n"
"iriverh100 = be1be79\n"
"iaudiox5 = be1be76\n"
+ "\n"
"[dailies]\n"
"timestamp = 20201113\n"
"rev = 362f7a3\n"
+ "\n"
"[daily]\n"
"build_url=https://buildurl/daily/rockbox-%TARGET%-%VERSION%.zip\n"
- "iriverh100 = f9dce00\n"
+ "font_url=https://buildurl/daily/fonts/rockbox-fonts-%VERSION%.zip\n"
+ "manual_url=https://buildurl/daily/manual/rockbox-%TARGET%-%VERSION%%FORMAT%\n"
+ "iriverh100 = 20201114\n"
+ "iriverh120 = 20201115\n"
+ "\n"
"[bleeding]\n"
"timestamp = 20201114T105723Z\n"
"rev = be1be79\n"
+ "\n"
"[status]\n"
"archosfmrecorder=3\n"
"iriverh100=2\n"
"iriverh300=1\n"
"iriverh10=0\n"
+ "\n"
"[voices]\n"
"3.15=english,francais\n"
"3.11.2=english\n"
@@ -124,11 +136,16 @@ struct {
{ "iriverh100", PlayerBuildInfo::BuildUrl, PlayerBuildInfo::TypeDevel, "https://buildurl/dev/rockbox-iriverh100.zip" },
{ "iaudiox5.v", PlayerBuildInfo::BuildVersion, PlayerBuildInfo::TypeDevel, "be1be76" },
{ "iaudiox5.v", PlayerBuildInfo::BuildUrl, PlayerBuildInfo::TypeDevel, "https://buildurl/dev/rockbox-iaudiox5.zip" },
+ // devel builds use daily fonts.
+ { "iriverh100", PlayerBuildInfo::BuildFontUrl, PlayerBuildInfo::TypeDevel, "https://buildurl/daily/fonts/rockbox-fonts-20201114.zip" },
+ { "iriverh100", PlayerBuildInfo::BuildManualUrl, PlayerBuildInfo::TypeDevel, "https://buildurl/daily/manual/rockbox-iriverh100-20201114%FORMAT%" },
// daily builds
{ "iriverh100", PlayerBuildInfo::BuildVoiceLangs, PlayerBuildInfo::TypeDaily, "deutsch,english,francais" },
- { "iriverh100", PlayerBuildInfo::BuildVersion, PlayerBuildInfo::TypeDaily, "f9dce00" },
- { "iriverh100", PlayerBuildInfo::BuildUrl, PlayerBuildInfo::TypeDaily, "https://buildurl/daily/rockbox-iriverh100-f9dce00.zip" },
+ { "iriverh100", PlayerBuildInfo::BuildVersion, PlayerBuildInfo::TypeDaily, "20201114" },
+ { "iriverh100", PlayerBuildInfo::BuildUrl, PlayerBuildInfo::TypeDaily, "https://buildurl/daily/rockbox-iriverh100-20201114.zip" },
+ { "iriverh100", PlayerBuildInfo::BuildFontUrl, PlayerBuildInfo::TypeDaily, "https://buildurl/daily/fonts/rockbox-fonts-20201114.zip" },
+ { "iriverh120", PlayerBuildInfo::BuildManualUrl, PlayerBuildInfo::TypeDaily, "https://buildurl/daily/manual/rockbox-iriverh100-20201115%FORMAT%" },
};
struct {