Makefile.gbuild | 6 ++-- Repository.mk | 5 ++- config_host.mk.in | 1 configure.ac | 9 ------ distro-configs/Jenkins/LibreOfficeLinuxUpdater.conf | 1 distro-configs/LibreOfficeWin64.conf | 1 external/onlineupdate/CustomTarget_generated.mk | 23 ++-------------- external/onlineupdate/Executable_test_updater_dialog.mk | 2 - external/onlineupdate/Executable_updater.mk | 6 ++-- external/onlineupdate/Module_onlineupdate.mk | 1 external/onlineupdate/Package_update-settings_ini.mk | 16 +++++++++++ external/onlineupdate/StaticLibrary_updatehelper.mk | 2 - external/onlineupdate/generate.py | 21 ++++++++++++++ external/onlineupdate/update-settings.ini | 10 ++++++ instsetoo_native/CustomTarget_setup.mk | 2 - solenv/bin/modules/installer/scriptitems.pm | 2 - 16 files changed, 66 insertions(+), 42 deletions(-)
New commits: commit 57092e6eadecec93e85c2d81d0e8601f6ec1106e Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Tue Jan 2 09:51:02 2024 +0100 Commit: Stephan Bergmann <stephan.bergm...@allotropia.de> CommitDate: Tue Jan 2 22:29:27 2024 +0100 Re-enable MOZ_VERIFY_MAR_SIGNATURE feature ...that 3a445cb49795fabe0d8caaf12bfc38eb9e12d5fc "Turn onlineupdate into external/onlineupdate" had accidentally turned off Change-Id: I345d02a305a33fc641566d122c8cdb55c09599a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161546 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> (cherry picked from commit 1e5fedf1a34e4609d4cf9f7fb70bc8797692d521) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161557 diff --git a/Repository.mk b/Repository.mk index a53d923f36b5..d9361db15403 100644 --- a/Repository.mk +++ b/Repository.mk @@ -1097,7 +1097,10 @@ $(eval $(call gb_Helper_register_packages_for_install,brand,\ readlicense_oo_files \ readlicense_oo_license \ $(call gb_Helper_optional,DESKTOP,setup_native_packinfo) \ - $(if $(ENABLE_ONLINE_UPDATE_MAR),updater_ini) \ + $(if $(ENABLE_ONLINE_UPDATE_MAR), \ + update-settings_ini \ + updater_ini \ + ) \ )) ifeq ($(USING_X11), TRUE) diff --git a/external/onlineupdate/CustomTarget_generated.mk b/external/onlineupdate/CustomTarget_generated.mk index dba8274497e6..ffdfffd4312a 100644 --- a/external/onlineupdate/CustomTarget_generated.mk +++ b/external/onlineupdate/CustomTarget_generated.mk @@ -9,31 +9,14 @@ $(eval $(call gb_CustomTarget_CustomTarget,external/onlineupdate/generated)) -onlineupdate_INC := $(call gb_CustomTarget_get_workdir,external/onlineupdate/generated)/onlineupdate +onlineupdate_INC := $(call gb_CustomTarget_get_workdir,external/onlineupdate/generated) -# For debug purposes, ONLINEUPDATE_MAR_CERTIFICATEDER can be empty, but gen_cert_header.py always -# expects an existing certificate-der=... pathname, so as a hack fall back to the generated -# update.ini itself as the pathname of the certificate DER file (though that will cause -# gen_cert_header.py to generate nonsense data, of course): -$(call gb_CustomTarget_get_workdir,onlineupdate/generated)/update.ini: | \ - $(call gb_CustomTarget_get_workdir,onlineupdate/generated)/.dir - printf '[Updater] certificate-der=%s ' '$(or $(ONLINEUPDATE_MAR_CERTIFICATEDER),$@)' > $@ - -$(onlineupdate_INC)/primaryCert.h : \ - $(call gb_ExternalExecutable_get_dependencies,python) \ - $(call gb_CustomTarget_get_workdir,onlineupdate/generated)/update.ini \ - | $(call gb_UnpackedTarball_get_target,onlineupdate) - $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,,1) - mkdir -p $(dir $@) - $(call gb_ExternalExecutable_get_command,python) $(call gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/updater/gen_cert_header.py "primaryCertData" $(call gb_CustomTarget_get_workdir,onlineupdate/generated)/update.ini > $(onlineupdate_INC)/primaryCert.h - -$(onlineupdate_INC)/secondaryCert.h : \ +$(onlineupdate_INC)/primaryCert.h $(onlineupdate_INC)/secondaryCert.h : \ $(call gb_ExternalExecutable_get_dependencies,python) \ - $(call gb_CustomTarget_get_workdir,onlineupdate/generated)/update.ini \ | $(call gb_UnpackedTarball_get_target,onlineupdate) $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,,1) mkdir -p $(dir $@) - $(call gb_ExternalExecutable_get_command,python) $(call gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/updater/gen_cert_header.py "secondaryCertData" $(call gb_CustomTarget_get_workdir,onlineupdate/generated)/update.ini > $(onlineupdate_INC)/secondaryCert.h + PYPATH=$${PYPATH:+$$PYPATH$(gb_CLASSPATHSEP)}'$(call gb_UnpackedTarball_get_dir,onlineupdate)/onlineupdate/source/update/updater' $(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/onlineupdate/generate.py $@ '$(ONLINEUPDATE_MAR_CERTIFICATEDER)' $(call gb_CustomTarget_get_target,external/onlineupdate/generated) : \ $(onlineupdate_INC)/primaryCert.h \ diff --git a/external/onlineupdate/Executable_test_updater_dialog.mk b/external/onlineupdate/Executable_test_updater_dialog.mk index 9c9c0038c8da..4d31c7f24f30 100644 --- a/external/onlineupdate/Executable_test_updater_dialog.mk +++ b/external/onlineupdate/Executable_test_updater_dialog.mk @@ -53,7 +53,7 @@ $(eval $(call gb_Executable_add_ldflags,test_updater_dialog,\ else $(eval $(call gb_Executable_add_defs,test_updater_dialog,\ - -DVERIFY_MAR_SIGNATURE \ + -DMOZ_VERIFY_MAR_SIGNATURE \ -DNSS3 \ )) diff --git a/external/onlineupdate/Executable_updater.mk b/external/onlineupdate/Executable_updater.mk index 0aa0bbe2c9b3..2196ff5df579 100644 --- a/external/onlineupdate/Executable_updater.mk +++ b/external/onlineupdate/Executable_updater.mk @@ -64,7 +64,8 @@ $(eval $(call gb_Executable_add_ldflags,updater,\ )) $(eval $(call gb_Executable_add_defs,updater,\ - -DVERIFY_MAR_SIGNATURE \ + -DMOZ_APP_VERSION=\"$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)\" \ + -DMOZ_VERIFY_MAR_SIGNATURE \ -DNS_NO_XPCOM \ -DMOZ_MAINTENANCE_SERVICE \ -DXP_WIN \ @@ -84,7 +85,8 @@ $(eval $(call gb_Executable_add_defs,updater,\ else $(eval $(call gb_Executable_add_defs,updater,\ - -DVERIFY_MAR_SIGNATURE \ + -DMOZ_APP_VERSION=\"$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)\" \ + -DMOZ_VERIFY_MAR_SIGNATURE \ -DNSS3 \ -DNS_NO_XPCOM \ -DXP_UNIX \ diff --git a/external/onlineupdate/Module_onlineupdate.mk b/external/onlineupdate/Module_onlineupdate.mk index 97f7d5c3f7bd..6b037bd9713c 100644 --- a/external/onlineupdate/Module_onlineupdate.mk +++ b/external/onlineupdate/Module_onlineupdate.mk @@ -25,6 +25,7 @@ $(eval $(call gb_Module_add_targets,onlineupdate,\ Executable_updater \ Executable_mbsdiff \ CustomTarget_generated \ + Package_update-settings_ini \ Package_updater_ini \ )) endif diff --git a/external/onlineupdate/Package_update-settings_ini.mk b/external/onlineupdate/Package_update-settings_ini.mk new file mode 100644 index 000000000000..bbb438e40d29 --- /dev/null +++ b/external/onlineupdate/Package_update-settings_ini.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Package_Package,update-settings_ini,$(SRCDIR)/external/onlineupdate)) + +$(eval $(call gb_Package_add_files,update-settings_ini,$(if $(filter MACOSX,$(OS)),Contents/Resources,.), \ + update-settings.ini \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/onlineupdate/StaticLibrary_updatehelper.mk b/external/onlineupdate/StaticLibrary_updatehelper.mk index 742d4d1c648d..79da4f809ca7 100644 --- a/external/onlineupdate/StaticLibrary_updatehelper.mk +++ b/external/onlineupdate/StaticLibrary_updatehelper.mk @@ -26,7 +26,7 @@ $(eval $(call gb_StaticLibrary_set_include,updatehelper,\ $(eval $(call gb_StaticLibrary_add_defs,updatehelper,\ -DMOZ_MAINTENANCE_SERVICE \ -DNSS3 \ - -DVERIFY_MAR_SIGNATURE \ + -DMOZ_VERIFY_MAR_SIGNATURE \ -DXP_$(if $(filter WNT,$(OS)),WIN,UNIX) \ $(if $(filter WNT,$(OS)),-U_WIN32_WINNT) \ )) diff --git a/external/onlineupdate/generate.py b/external/onlineupdate/generate.py new file mode 100644 index 000000000000..8454d7efd91a --- /dev/null +++ b/external/onlineupdate/generate.py @@ -0,0 +1,21 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +import sys + +from gen_cert_header import create_header + +with open(sys.argv[1], mode='w') as f: + # For debug purposes, ONLINEUPDATE_MAR_CERTIFICATEDER (passed in as sys.argv[2]) can be empty, + # but create_header always expects an existing file argument, so as a hack fall back to this + # script itself (i.e., sys.argv[0]) as the pathname of the certificate DER file (though that + # will cause create_header to generate nonsense data, of course): + create_header(f, sys.argv[2] or sys.argv[0]) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/external/onlineupdate/update-settings.ini b/external/onlineupdate/update-settings.ini new file mode 100644 index 000000000000..60a657f90423 --- /dev/null +++ b/external/onlineupdate/update-settings.ini @@ -0,0 +1,10 @@ +; +; This file is part of the LibreOffice project. +; +; This Source Code Form is subject to the terms of the Mozilla Public +; License, v. 2.0. If a copy of the MPL was not distributed with this +; file, You can obtain one at http://mozilla.org/MPL/2.0/. +; + +[Settings] +ACCEPTED_MAR_CHANNEL_IDS=LOOnlineUpdater commit 953ffde0ec80581c56c17bfec71e1b2817a3592d Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Tue Jan 2 15:19:02 2024 +0100 Commit: Stephan Bergmann <stephan.bergm...@allotropia.de> CommitDate: Tue Jan 2 22:29:13 2024 +0100 Hard-code --with-online-update-mar-channel=LOOnlineUpdater (An upcoming change will add an instset/update-settings.ini file containing that value, but using a GeneratedPackage for a single file instead of a directory seems unsupported, so it will use the hard-coded value and a plain Package instead.) Change-Id: I12ffef4db71ce36be9096df674588b39c660e4de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161545 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> (cherry picked from commit 6910b1e3511701de5f0541fcaa98babf530f55ce) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161556 diff --git a/Makefile.gbuild b/Makefile.gbuild index 77100c07be3e..2dfbce13cba0 100644 --- a/Makefile.gbuild +++ b/Makefile.gbuild @@ -51,8 +51,8 @@ upload-update-info: $(eval PLATFORM := $(RTL_OS)_$(RTL_ARCH)) $(eval UPDATE_DIR := $(WORKDIR)/update-info) $(eval VERSION := $(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)$(LIBO_VERSION_SUFFIX)$(LIBO_VERSION_SUFFIX_SUFFIX)) - MAR=$(INSTDIR)/program/mar $(SRCDIR)/bin/update/create_build_config.py "$(PRODUCTNAME)" "$(VERSION)" "$(BUILDID)" "$(PLATFORM)" "$(UPDATE_DIR)" "$(ONLINEUPDATE_MAR_CHANNEL)" - MAR=$(INSTDIR)/program/mar $(SRCDIR)/bin/update/upload_builds.py "$(PRODUCTNAME)" "$(BUILDID)" "$(PLATFORM)" "$(UPDATE_DIR)" "$(ONLINEUPDATE_MAR_UPLOADURL)" "$(ONLINEUPDATE_MAR_CHANNEL)" + MAR=$(INSTDIR)/program/mar $(SRCDIR)/bin/update/create_build_config.py "$(PRODUCTNAME)" "$(VERSION)" "$(BUILDID)" "$(PLATFORM)" "$(UPDATE_DIR)" LOOnlineUpdater + MAR=$(INSTDIR)/program/mar $(SRCDIR)/bin/update/upload_builds.py "$(PRODUCTNAME)" "$(BUILDID)" "$(PLATFORM)" "$(UPDATE_DIR)" "$(ONLINEUPDATE_MAR_UPLOADURL)" LOOnlineUpdater MAR=$(INSTDIR)/program/mar $(SRCDIR)/bin/update/upload_build_config.py "$(UPDATE_DIR)" TODO create-partial-info: @@ -60,7 +60,7 @@ create-partial-info: $(eval VERSION := $(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)$(LIBO_VERSION_SUFFIX)$(LIBO_VERSION_SUFFIX_SUFFIX)) $(eval PLATFORM := $(RTL_OS)_$(RTL_ARCH)) $(eval MAR_NAME_PREFIX := $(PRODUCTNAME)_$(VERSION)_$(PLATFORM)_$(BUILDID)) - MBSDIFF=$(WORKDIR)/LinkTarget/Executable/mbsdiff MAR=$(INSTDIR)/program/mar $(SRCDIR)/bin/update/create_partial_update.py "$(WORKDIR)" "$(MAR_NAME_PREFIX)" "$(ONLINEUPDATE_MAR_SERVERURL)" "$(ONLINEUPDATE_MAR_CHANNEL)" "$(ONLINEUPDATE_MAR_CERTIFICATEPATH)" "$(ONLINEUPDATE_MAR_CERTIFICATENAME)" "$(ONLINEUPDATE_MAR_BASEURL)" "$(PLATFORM)" "$(BUILDID)" + MBSDIFF=$(WORKDIR)/LinkTarget/Executable/mbsdiff MAR=$(INSTDIR)/program/mar $(SRCDIR)/bin/update/create_partial_update.py "$(WORKDIR)" "$(MAR_NAME_PREFIX)" "$(ONLINEUPDATE_MAR_SERVERURL)" LOOnlineUpdater "$(ONLINEUPDATE_MAR_CERTIFICATEPATH)" "$(ONLINEUPDATE_MAR_CERTIFICATENAME)" "$(ONLINEUPDATE_MAR_BASEURL)" "$(PLATFORM)" "$(BUILDID)" # also possible to bypass the dependencies/the gbuild processing by just running # LD_LIBRARY_PATH=instdir/program make cmd cmd='ALL_LANGS="$(ALL_LANGS)" workdir/LinkTarget/Executable/pocheck' diff --git a/config_host.mk.in b/config_host.mk.in index e30574ff4945..de08cbcac90e 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -514,7 +514,6 @@ export ONLINEUPDATE_MAR_BASEURL=@ONLINEUPDATE_MAR_BASEURL@ export ONLINEUPDATE_MAR_CERTIFICATEDER=@ONLINEUPDATE_MAR_CERTIFICATEDER@ export ONLINEUPDATE_MAR_CERTIFICATENAME=@ONLINEUPDATE_MAR_CERTIFICATENAME@ export ONLINEUPDATE_MAR_CERTIFICATEPATH=@ONLINEUPDATE_MAR_CERTIFICATEPATH@ -export ONLINEUPDATE_MAR_CHANNEL=@ONLINEUPDATE_MAR_CHANNEL@ export ONLINEUPDATE_MAR_SERVERURL=@ONLINEUPDATE_MAR_SERVERURL@ export ONLINEUPDATE_MAR_UPLOADURL=@ONLINEUPDATE_MAR_UPLOADURL@ export OOO_JUNIT_JAR=@OOO_JUNIT_JAR@ diff --git a/configure.ac b/configure.ac index ef27ed166df5..a54aae3d14bd 100644 --- a/configure.ac +++ b/configure.ac @@ -13697,15 +13697,6 @@ else fi AC_SUBST(ONLINEUPDATE_MAR_CERTIFICATEPATH) -AC_MSG_CHECKING([for mar online update channel]) -ONLINEUPDATE_MAR_CHANNEL=$with_online_update_mar_channel -if test -n "$ONLINEUPDATE_MAR_CHANNEL"; then - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi -AC_SUBST(ONLINEUPDATE_MAR_CHANNEL) - AC_MSG_CHECKING([for mar online update serverurl]) ONLINEUPDATE_MAR_SERVERURL=$with_online_update_mar_serverurl if test -n "$ONLINEUPDATE_MAR_SERVERURL"; then diff --git a/distro-configs/Jenkins/LibreOfficeLinuxUpdater.conf b/distro-configs/Jenkins/LibreOfficeLinuxUpdater.conf index d198cdb1b427..e6b7448ccd43 100644 --- a/distro-configs/Jenkins/LibreOfficeLinuxUpdater.conf +++ b/distro-configs/Jenkins/LibreOfficeLinuxUpdater.conf @@ -36,7 +36,6 @@ --with-online-update-mar-certificateder=TODO --with-online-update-mar-certificatename=TODO --with-online-update-mar-certificatepath=TODO ---with-online-update-mar-channel=TODO --with-online-update-mar-serverurl=TODO --with-online-update-mar-uploadurl=TODO --with-jdk-home=/etc/alternatives/java_sdk_17 diff --git a/distro-configs/LibreOfficeWin64.conf b/distro-configs/LibreOfficeWin64.conf index a8efd0430a31..8ace248e80d4 100644 --- a/distro-configs/LibreOfficeWin64.conf +++ b/distro-configs/LibreOfficeWin64.conf @@ -8,7 +8,6 @@ --enable-ext-nlpsolver --enable-online-update --enable-online-update-mar ---with-online-update-mar-channel=LOOnlineUpdater --enable-breakpad --with-help=html --with-myspell-dicts diff --git a/instsetoo_native/CustomTarget_setup.mk b/instsetoo_native/CustomTarget_setup.mk index 2861155c8d31..48efab143c82 100644 --- a/instsetoo_native/CustomTarget_setup.mk +++ b/instsetoo_native/CustomTarget_setup.mk @@ -182,7 +182,7 @@ define instsetoo_native_genversionini AllLanguages=$(if $(gb_WITH_LANG),$(gb_WITH_LANG),en-US) buildid=$(shell cd $(SRCDIR) && git log -1 --format=%H) ExtensionUpdateURL=https://updateexte.libreoffice.org/ExtensionUpdateService/check.Update -UpdateChannel=$(if $(ENABLE_ONLINE_UPDATE_MAR),$(ONLINEUPDATE_MAR_CHANNEL)) +UpdateChannel=$(if $(ENABLE_ONLINE_UPDATE_MAR),LOOnlineUpdater) ReferenceOOoMajorMinor=4.1 UpdateID=$(PRODUCTNAME)_$(LIBO_VERSION_MAJOR)_en-US UpdateURL=$(if $(ENABLE_ONLINE_UPDATE),https://update.libreoffice.org/check.php$(if $(filter-out WNT,$(OS)),?pkgfmt=$(PKGFORMAT))) diff --git a/solenv/bin/modules/installer/scriptitems.pm b/solenv/bin/modules/installer/scriptitems.pm index df76cb6704c1..18ccd81d2c87 100644 --- a/solenv/bin/modules/installer/scriptitems.pm +++ b/solenv/bin/modules/installer/scriptitems.pm @@ -655,7 +655,7 @@ sub replace_setup_variables my $updateid = $productname . "_" . $libo_version_major . "_" . $$languagestringref; $updateid =~ s/ /_/g; - my $updatechannel = $ENV{'ONLINEUPDATE_MAR_CHANNEL'}; + my $updatechannel = 'LOOnlineUpdater'; for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ ) {