Update for single build-info file.

The server now provides a single build-info file (instead of two separate ones
for development builds and stable releases). Update to use the new file, since
it simplifies things.

Change-Id: If3b949f4d78eecb54e47622da887f51005f6d155
This commit is contained in:
Dominik Riebeling 2012-06-03 00:50:01 +02:00
parent b73c961683
commit f4b0e316c3
9 changed files with 21 additions and 71 deletions

View file

@ -32,7 +32,6 @@ const static struct {
} ServerInfoList[] = {
{ ServerInfo::CurReleaseVersion, ":platform:/releaseversion", "" },
{ ServerInfo::CurStatus, ":platform:/status", "Unknown" },
{ ServerInfo::DailyDate, "dailydate", "" },
{ ServerInfo::BleedingRevision, "bleedingrev", "" },
{ ServerInfo::BleedingDate, "bleedingdate", "" },
};
@ -43,8 +42,9 @@ void ServerInfo::readBuildInfo(QString file)
{
QSettings info(file, QSettings::IniFormat);
QDate date = QDate::fromString(info.value("dailies/date").toString(), "yyyyMMdd");
setValue(ServerInfo::DailyDate,date.toString(Qt::ISODate));
setValue(ServerInfo::BleedingRevision,info.value("bleeding/rev"));
QDateTime date = QDateTime::fromString(info.value("bleeding/timestamp").toString(), "yyyyMMddThhmmssZ");
setValue(ServerInfo::BleedingDate,date.toString(Qt::ISODate));
info.beginGroup("release");
QStringList keys = info.allKeys();
@ -87,18 +87,9 @@ void ServerInfo::readBuildInfo(QString file)
setPlatformValue(variants.at(j), ServerInfo::CurStatus, status);
setPlatformValue(variants.at(j), ServerInfo::CurReleaseVersion, release);
}
}
}
void ServerInfo::readBleedingInfo(QString file)
{
QSettings info(file, QSettings::IniFormat);
setValue(ServerInfo::BleedingRevision,info.value("bleeding/rev"));
QDateTime date = QDateTime::fromString(info.value("bleeding/timestamp").toString(), "yyyyMMddThhmmssZ");
setValue(ServerInfo::BleedingDate,date.toString(Qt::ISODate));
}
QVariant ServerInfo::value(enum ServerInfos info)
{

View file

@ -32,15 +32,12 @@ class ServerInfo : public QObject
enum ServerInfos {
CurReleaseVersion,
CurStatus,
DailyDate,
BleedingRevision,
BleedingDate,
};
//! read in buildinfo file
static void readBuildInfo(QString file);
//! read in bleeding info file
static void readBleedingInfo(QString file);
//! get a value from server info
static QVariant value(enum ServerInfos setting);
//! get a value from server info for a named platform.

View file

@ -43,12 +43,11 @@ const static struct {
{ SystemInfo::DoomUrl, "doom_url", "" },
{ SystemInfo::ReleaseUrl, "release_url", "" },
{ SystemInfo::DailyUrl, "daily_url", "" },
{ SystemInfo::ServerConfUrl, "server_conf_url", "" },
{ SystemInfo::BuildInfoUrl, "build_info_url", "" },
{ SystemInfo::GenlangUrl, "genlang_url", "" },
{ SystemInfo::ThemesUrl, "themes_url", "" },
{ SystemInfo::ThemesInfoUrl, "themes_info_url", "" },
{ SystemInfo::RbutilUrl, "rbutil_url", "" },
{ SystemInfo::BleedingInfo, "bleeding_info", "" },
{ SystemInfo::CurPlatformName, ":platform:/name", "" },
{ SystemInfo::CurManual, ":platform:/manualname","rockbox-:platform:" },
{ SystemInfo::CurBootloaderMethod, ":platform:/bootloadermethod", "none" },

View file

@ -47,12 +47,11 @@ class SystemInfo : public QObject
ReleaseUrl,
ReleaseVoiceUrl,
ReleaseFontUrl,
ServerConfUrl,
BuildInfoUrl,
GenlangUrl,
ThemesUrl,
ThemesInfoUrl,
RbutilUrl,
BleedingInfo,
CurPlatformName,
CurManual,
CurBootloaderMethod,

View file

@ -104,8 +104,6 @@ void ManualWidget::downloadManual(void)
manual = "rockbox-" + SystemInfo::value(SystemInfo::CurBuildserverModel).toString();
}
QDate date = QDate::fromString(ServerInfo::value(
ServerInfo::DailyDate).toString(), Qt::ISODate);
QString manualurl;
ProgressLoggerGui* logger = new ProgressLoggerGui(this);
@ -123,7 +121,7 @@ void ManualWidget::downloadManual(void)
else {
manualurl = manualUrl(ManualZip);
installer->setLogSection("Manual (HTML)");
installer->setTarget("/" + manual + "-" + date.toString("yyyyMMdd") + "-html.zip");
installer->setTarget("/" + manual + "-" + "-html.zip");
}
qDebug() << "[ManualWidget] Manual URL:" << manualurl;

View file

@ -144,7 +144,6 @@ void InstallWindow::accept()
}
file.replace("%MODEL%", buildname);
file.replace("%RELVERSION%", ServerInfo::value(ServerInfo::CurReleaseVersion).toString());
file.replace("%DATE%", ServerInfo::value(ServerInfo::DailyDate).toString());
RbSettings::sync();

View file

@ -1,12 +1,10 @@
[general]
; builds
release_url=http://download.rockbox.org/release/%RELVERSION%/rockbox-%MODEL%-%RELVERSION%.zip
daily_url=http://download.rockbox.org/daily/%MODEL%/rockbox-%MODEL%.zip
bleeding_url=http://build.rockbox.org/data/rockbox-%MODEL%.zip
; voice files
release_voice_url=http://download.rockbox.org/release/%RELVERSION%/%MODEL%-%RELVERSION%-english.zip
daily_voice_url=http://download.rockbox.org/daily/voices/%MODEL%-%DATE%-english.zip
genlang_url=http://www.rockbox.org/genlang/?lang=%LANG%&t=%TARGET%&rev=%REVISION%&f=%FEATURES%
; bootloader
@ -18,15 +16,14 @@ 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
server_conf_url=http://download.rockbox.org/daily/build-info
bleeding_info=http://build.rockbox.org/cvsmod/build-info
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/daily/manual/%MANUALBASENAME%.%EXTENSION%
manual_url=http://download.rockbox.org/manual/%MANUALBASENAME%.%EXTENSION%
doom_url=http://download.rockbox.org/useful/rockdoom.zip
rbutil_url=http://download.rockbox.org/rbutil/

View file

@ -227,7 +227,7 @@ void RbUtilQt::downloadInfo()
ui.statusbar->showMessage(tr("Downloading build information, please wait ..."));
qDebug() << "[RbUtil] downloading build info";
daily->setFile(&buildInfo);
daily->getFile(QUrl(SystemInfo::value(SystemInfo::ServerConfUrl).toString()));
daily->getFile(QUrl(SystemInfo::value(SystemInfo::BuildInfoUrl).toString()));
}
@ -249,42 +249,13 @@ void RbUtilQt::downloadDone(bool error)
ServerInfo::readBuildInfo(buildInfo.fileName());
buildInfo.close();
// start bleeding info download
bleeding = new HttpGet(this);
connect(bleeding, SIGNAL(done(bool)), this, SLOT(downloadBleedingDone(bool)));
connect(qApp, SIGNAL(lastWindowClosed()), bleeding, SLOT(abort()));
if(RbSettings::value(RbSettings::CacheOffline).toBool())
bleeding->setCache(true);
bleeding->setFile(&bleedingInfo);
bleeding->getFile(QUrl(SystemInfo::value(SystemInfo::BleedingInfo).toString()));
ui.statusbar->showMessage(tr("Downloading build information, please wait ..."));
ui.statusbar->showMessage(tr("Download build information finished."), 5000);
updateSettings();
m_gotInfo = true;
}
//start check for updates
checkUpdate();
void RbUtilQt::downloadBleedingDone(bool error)
{
if(error) {
qDebug() << "[RbUtil] network error:" << bleeding->error();
ui.statusbar->showMessage(tr("Can't get version information!"));
QMessageBox::critical(this, tr("Network error"),
tr("Can't get version information.\n"
"Network error: %1. Please check your network and proxy settings.")
.arg(bleeding->errorString()));
return;
}
else {
bleedingInfo.open();
ServerInfo::readBleedingInfo(bleedingInfo.fileName());
bleedingInfo.close();
ui.statusbar->showMessage(tr("Download build information finished."), 5000);
updateSettings();
m_gotInfo = true;
//start check for updates
checkUpdate();
}
}

View file

@ -105,7 +105,6 @@ class RbUtilQt : public QMainWindow
void createTalkFiles(void);
void createVoiceFile(void);
void downloadDone(bool);
void downloadBleedingDone(bool);
void downloadInfo(void);
void installVoice(void);