From 48190a8f3783135c65538977cd38f34ba733f071 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 30 May 2024 13:44:49 +0200 Subject: Make sure updates dir exists when writing updating.log Change-Id: Ib652fedde970d01b701ad4b61e75028cd43974f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168258 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- desktop/source/app/updater.cxx | 14 ++++---------- desktop/source/app/updater.hxx | 1 - 2 files changed, 4 insertions(+), 11 deletions(-) (limited to 'desktop/source') diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index 676cc54f148e..d60c006f6b6f 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -805,14 +805,6 @@ void update_checker() } } -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/"); @@ -845,8 +837,10 @@ 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)); } diff --git a/desktop/source/app/updater.hxx b/desktop/source/app/updater.hxx index 2ab4d4ea8eae..3fc767748094 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(); -- cgit