diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-06-21 22:33:12 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-06-24 10:59:44 +0200 |
commit | a2636093643a57ddd5d235246a9736e3352f3bd3 (patch) | |
tree | fe05e7daf1b2c5784746aacfd26b8021c63ec205 /desktop/source/app/updater.cxx | |
parent | 784371488b759420fb84bc93ce21ec84cc0b0643 (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/source/app/updater.cxx')
-rw-r--r-- | desktop/source/app/updater.cxx | 19 |
1 files changed, 14 insertions, 5 deletions
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]; } |