Kaydet (Commit) 42aac9ef authored tarafından Markus Mohrhard's avatar Markus Mohrhard

better updater logging

Change-Id: I6012f2159d058cbb2afb4b685badb8c870adf07b
Reviewed-on: https://gerrit.libreoffice.org/38679Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst c2b1ff4a
...@@ -144,17 +144,20 @@ char** createCommandLine() ...@@ -144,17 +144,20 @@ char** createCommandLine()
OUString aPatchDir = Updater::getPatchDirURL(); OUString aPatchDir = Updater::getPatchDirURL();
rtl::Bootstrap::expandMacros(aPatchDir); rtl::Bootstrap::expandMacros(aPatchDir);
OUString aTempDirPath = getPathFromURL(aPatchDir); OUString aTempDirPath = getPathFromURL(aPatchDir);
Updater::log("Patch Dir: " + aTempDirPath);
createStr(aTempDirPath, pArgs, 1); createStr(aTempDirPath, pArgs, 1);
} }
{ {
// the actual update directory // the actual update directory
OUString aInstallPath = getPathFromURL(aLibExecDirURL); OUString aInstallPath = getPathFromURL(aLibExecDirURL);
Updater::log("Install Dir: " + aInstallPath);
createStr(aInstallPath, pArgs, 2); createStr(aInstallPath, pArgs, 2);
} }
{ {
// the temporary updated build // the temporary updated build
OUString aUpdateDirURL = Updater::getUpdateDirURL(); OUString aUpdateDirURL = Updater::getUpdateDirURL();
OUString aWorkingDir = getPathFromURL(aUpdateDirURL); OUString aWorkingDir = getPathFromURL(aUpdateDirURL);
Updater::log("Working Dir: " + aWorkingDir);
createStr(aWorkingDir, pArgs, 3); createStr(aWorkingDir, pArgs, 3);
} }
{ {
...@@ -164,6 +167,7 @@ char** createCommandLine() ...@@ -164,6 +167,7 @@ char** createCommandLine()
{ {
OUString aExeDir = Updater::getExecutableDirURL(); OUString aExeDir = Updater::getExecutableDirURL();
OUString aSofficePath = getPathFromURL(aExeDir); OUString aSofficePath = getPathFromURL(aExeDir);
Updater::log("soffice Path: " + aSofficePath);
createStr(aSofficePath, pArgs, 5); createStr(aSofficePath, pArgs, 5);
} }
{ {
...@@ -215,8 +219,10 @@ void update() ...@@ -215,8 +219,10 @@ void update()
OUString aTempDirPath = getPathFromURL(aTempDirURL); OUString aTempDirPath = getPathFromURL(aTempDirURL);
OString aPath = OUStringToOString(aTempDirPath + "/" + OUString::fromUtf8(pUpdaterName), RTL_TEXTENCODING_UTF8); OString aPath = OUStringToOString(aTempDirPath + "/" + OUString::fromUtf8(pUpdaterName), RTL_TEXTENCODING_UTF8);
Updater::log("Calling the updater with parameters: ");
char** pArgs = createCommandLine(); char** pArgs = createCommandLine();
#if UNX #if UNX
if (execv(aPath.getStr(), pArgs)) if (execv(aPath.getStr(), pArgs))
{ {
...@@ -730,4 +736,12 @@ void Updater::log(const OString& rMessage) ...@@ -730,4 +736,12 @@ void Updater::log(const OString& rMessage)
aLog.WriteLine(rMessage); aLog.WriteLine(rMessage);
} }
void Updater::log(const char* pMessage)
{
OUString aUpdateLog = getUpdateInfoLog();
SvFileStream aLog(aUpdateLog, StreamMode::STD_READWRITE);
aLog.Seek(aLog.Tell() + aLog.remainingSize()); // make sure we are at the end
aLog.WriteCharPtr(pMessage);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -30,6 +30,7 @@ public: ...@@ -30,6 +30,7 @@ public:
static void log(const OUString& rMessage); static void log(const OUString& rMessage);
static void log(const OString& rMessage); static void log(const OString& rMessage);
static void log(const char* pMessage);
}; };
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment