diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-08-19 22:10:27 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-08-20 00:25:17 +0200 |
commit | 5daa3a1cc0bced06c638952ececf4299ef71183a (patch) | |
tree | 2d1db975359763ae556cd3ed254a25ee5a9ce30e /desktop | |
parent | 3f8a48f5d81baee92f83a666842b7322195d6116 (diff) |
updater: make it easier to test some parts of the updating code
Change-Id: I7f3758eb8c12d912a47ac3a3c632347e6e124601
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 3 | ||||
-rw-r--r-- | desktop/source/app/updater.cxx | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index f71355c03b7a..209c0d7d8ed2 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1427,6 +1427,7 @@ int Desktop::Main() osl::DirectoryItem::get(Updater::getUpdateFileURL(), aUpdateFile); const char* pUpdaterTestUpdate = std::getenv("LIBO_UPDATER_TEST_UPDATE"); + const char* pForcedUpdateCheck = std::getenv("LIBO_UPDATER_TEST_UPDATE_CHECK"); if (pUpdaterTestUpdate || aUpdateFile.is()) { OUString aBuildID("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("version") ":buildid}"); @@ -1446,7 +1447,7 @@ int Desktop::Main() if (bSuccess) return EXIT_SUCCESS; } - else if (isTimeForUpdateCheck()) + else if (isTimeForUpdateCheck() || pForcedUpdateCheck) { sal_uInt64 nNow = tools::Time::GetSystemTicks(); Updater::log("Update Check Time: " + OUString::number(nNow)); diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index 73a3bd993476..4049b0ab3472 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -678,6 +678,13 @@ void update_checker() OUString aProductName = utl::ConfigManager::getProductName(); OUString aBuildID = Updater::getBuildID(); + + static const char* pBuildIdEnv = std::getenv("LIBO_UPDATER_BUILD"); + if (pBuildIdEnv) + { + aBuildID = OUString::createFromAscii(pBuildIdEnv); + } + OUString aBuildTarget = "${_OS}_${_ARCH}"; rtl::Bootstrap::expandMacros(aBuildTarget); OUString aChannel = officecfg::Office::Update::Update::UpdateChannel::get(); |