diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 11:48:25 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 11:48:25 +0000 |
commit | 9c0049cfae49c8e4ddef9125a69db2ad134c10c6 (patch) | |
tree | 812a86c0eee63dfc5ace12f2622ed3ce9cd3d680 /desktop/source/app | |
parent | Releasing progress-linux version 4:24.2.3-2~progress7.99u1. (diff) | |
download | libreoffice-9c0049cfae49c8e4ddef9125a69db2ad134c10c6.tar.xz libreoffice-9c0049cfae49c8e4ddef9125a69db2ad134c10c6.zip |
Merging upstream version 4:24.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'desktop/source/app')
-rw-r--r-- | desktop/source/app/updater.cxx | 48 | ||||
-rw-r--r-- | desktop/source/app/updater.hxx | 3 |
2 files changed, 13 insertions, 38 deletions
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index 12bb4969a6..d60c006f6b 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -29,7 +29,9 @@ #include <unotools/tempfile.hxx> #include <unotools/configmgr.hxx> #include <o3tl/char16_t2wchar_t.hxx> +#include <o3tl/runtimetooustring.hxx> #include <osl/file.hxx> +#include <osl/thread.h> #include <rtl/process.h> #include <sal/log.hxx> #include <tools/stream.hxx> @@ -553,7 +555,7 @@ size_t WriteCallbackFile(void *ptr, size_t size, std::string download_content(const OString& rURL, bool bFile, OUString& rHash) { - Updater::log("Download: " + rURL); + Updater::log("Download: " + OStringToOUString(rURL, osl_getThreadTextEncoding())); std::unique_ptr<CURL, std::function<void(CURL *)>> curl( curl_easy_init(), [](CURL * p) { curl_easy_cleanup(p); }); @@ -729,7 +731,7 @@ void update_checker() OUString aDownloadCheckURL = aDownloadCheckBaseURL + "update/check/1/" + aProductName + "/" + aBuildID + "/" + aBuildTarget + "/" + aChannel; OString aURL = OUStringToOString(aDownloadCheckURL, RTL_TEXTENCODING_UTF8); - Updater::log("Update check: " + aURL); + Updater::log("Update check: " + OStringToOUString(aURL, osl_getThreadTextEncoding())); try { @@ -779,38 +781,30 @@ void update_checker() catch (const invalid_update_info&) { SAL_WARN("desktop.updater", "invalid update information"); - Updater::log(OString("warning: invalid update info")); + Updater::log("warning: invalid update info"); } catch (const error_updater& e) { SAL_WARN("desktop.updater", "error during the update check: " << e.what()); - Updater::log(OString("warning: error by the updater") + e.what()); + Updater::log("warning: error by the updater" + o3tl::runtimeToOUString(e.what())); } catch (const invalid_size& e) { SAL_WARN("desktop.updater", e.what()); - Updater::log(OString("warning: invalid size")); + Updater::log("warning: invalid size"); } catch (const invalid_hash& e) { SAL_WARN("desktop.updater", e.what()); - Updater::log(OString("warning: invalid hash")); + Updater::log("warning: invalid hash"); } catch (...) { SAL_WARN("desktop.updater", "unknown error during the update check"); - Updater::log(OString("warning: unknown exception")); + Updater::log("warning: unknown exception"); } } -OUString Updater::getUpdateInfoLog() -{ - OUString aUpdateInfoURL("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/updates/updating.log"); - rtl::Bootstrap::expandMacros(aUpdateInfoURL); - - return aUpdateInfoURL; -} - OUString Updater::getPatchDirURL() { OUString aPatchDirURL("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/updates/0/"); @@ -843,30 +837,14 @@ OUString Updater::getExecutableDirURL() void Updater::log(const OUString& rMessage) { SAL_INFO("desktop.updater", rMessage); - OUString aUpdateLog = getUpdateInfoLog(); - SvFileStream aLog(aUpdateLog, StreamMode::STD_READWRITE); + OUString dir("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/updates"); + rtl::Bootstrap::expandMacros(dir); + osl::Directory::create(dir); + SvFileStream aLog(dir + "/updating.log", StreamMode::STD_READWRITE); aLog.Seek(aLog.Tell() + aLog.remainingSize()); // make sure we are at the end aLog.WriteLine(OUStringToOString(rMessage, RTL_TEXTENCODING_UTF8)); } -void Updater::log(const OString& rMessage) -{ - SAL_INFO("desktop.updater", rMessage); - OUString aUpdateLog = getUpdateInfoLog(); - SvFileStream aLog(aUpdateLog, StreamMode::STD_READWRITE); - aLog.Seek(aLog.Tell() + aLog.remainingSize()); // make sure we are at the end - aLog.WriteLine(rMessage); -} - -void Updater::log(const char* pMessage) -{ - SAL_INFO("desktop.updater", pMessage); - OUString aUpdateLog = getUpdateInfoLog(); - SvFileStream aLog(aUpdateLog, StreamMode::STD_READWRITE); - aLog.Seek(aLog.Tell() + aLog.remainingSize()); // make sure we are at the end - aLog.WriteOString(pMessage); -} - OUString Updater::getBuildID() { OUString aBuildID("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("version") ":buildid}"); diff --git a/desktop/source/app/updater.hxx b/desktop/source/app/updater.hxx index 7f1ea920fb..3fc7677480 100644 --- a/desktop/source/app/updater.hxx +++ b/desktop/source/app/updater.hxx @@ -18,7 +18,6 @@ void update_checker(); class Updater { public: - static OUString getUpdateInfoLog(); static OUString getPatchDirURL(); static OUString getUpdateFileURL(); static OUString getExecutableDirURL(); @@ -28,8 +27,6 @@ public: static OUString getUpdateChannel(); static void log(const OUString& rMessage); - static void log(const OString& rMessage); - static void log(const char* pMessage); static void removeUpdateFiles(); }; |