summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-06-21 22:33:12 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-06-24 10:59:44 +0200
commita2636093643a57ddd5d235246a9736e3352f3bd3 (patch)
treefe05e7daf1b2c5784746aacfd26b8021c63ec205 /desktop
parent784371488b759420fb84bc93ce21ec84cc0b0643 (diff)
updater: add a way to manually test updater command line
Without this hack it is not possible to debug the updater invocation easily. Each time this code will be called the updater would be executed and an update directory already present. Change-Id: I1159ee504b8f4ebf211e2a719369a48ae2e32345 Reviewed-on: https://gerrit.libreoffice.org/39080 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/app.cxx5
-rw-r--r--desktop/source/app/updater.cxx19
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];
}