diff options
-rw-r--r-- | desktop/source/app/app.cxx | 5 | ||||
-rw-r--r-- | desktop/source/app/updater.cxx | 19 |
2 files changed, 17 insertions, 7 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index bbf8ccdd0e86..d50df34bc43c 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1465,7 +1465,8 @@ int Desktop::Main() return EXIT_FAILURE; #if HAVE_FEATURE_UPDATE_MAR - if (officecfg::Office::Update::Update::Enabled::get()) + const char* pUpdaterTestReplace = std::getenv("LIBO_UPDATER_TEST_REPLACE"); + if (pUpdaterTestReplace || officecfg::Office::Update::Update::Enabled::get()) { // check if we just updated bool bUpdateRunning = officecfg::Office::Update::Update::UpdateRunning::get(); @@ -1507,7 +1508,7 @@ int Desktop::Main() osl::DirectoryItem aDirectoryItem; osl::DirectoryItem::get(Updater::getUpdateDirURL(), aDirectoryItem); - if (aPatchInfo.is() && aDirectoryItem.is()) + if (pUpdaterTestReplace || (aPatchInfo.is() && aDirectoryItem.is())) { OUString aBuildID("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("version") ":buildid}"); rtl::Bootstrap::expandMacros(aBuildID); diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index 9701691c1fb4..782bfef9079b 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -86,8 +86,6 @@ OUString normalizePath(const OUString& rPath) aPath = aTempPath.copy(0, i) + aPath.copy(nIndex + 3); } - SAL_DEBUG(aPath); - return aPath; } @@ -267,13 +265,24 @@ void update() #if UNX - if (execv(aPath.getStr(), pArgs)) + const char* pUpdaterTestReplace = std::getenv("LIBO_UPDATER_TEST_REPLACE"); + if (!pUpdaterTestReplace) + { + if (execv(aPath.getStr(), pArgs)) + { + printf("execv failed with error %d %s\n",errno,strerror(errno)); + } + } + else { - printf("execv failed with error %d %s\n",errno,strerror(errno)); + for (size_t i = 0; i < 8 + rtl_getAppCommandArgCount(); ++i) + { + SAL_WARN("desktop.updater", pArgs[i]); + } } #endif - for (size_t i = 0; i < 8; ++i) + for (size_t i = 0; i < 8 + rtl_getAppCommandArgCount(); ++i) { delete[] pArgs[i]; } |