summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2024-05-30 13:44:49 +0200
committerStephan Bergmann <stephan.bergmann@allotropia.de>2024-05-31 16:15:25 +0200
commit48190a8f3783135c65538977cd38f34ba733f071 (patch)
treedfcfdf18ae760779185e7d887f0f2a0a9f740e3d /desktop/source
parent068befc95ab8d7c368e76f08447827dbdea21014 (diff)
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 <stephan.bergmann@allotropia.de>
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/app/updater.cxx14
-rw-r--r--desktop/source/app/updater.hxx1
2 files changed, 4 insertions, 11 deletions
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();