office-gobmx/external/onlineupdate/lo.patch

399 lines
14 KiB
Diff
Raw Normal View History

Fix `make create-update-info` (for Windows, at least) * The shell scripts that had once been copied from Mozilla to bin/update/*.sh are now included in onlineupdate-c003be8b9727672e7d30972983b375f4c200233f-2.tar.xz (which is still generated from the same <https://github.com/mozilla/gecko-dev/commit/c003be8b9727672e7d30972983b375f4c200233f> that was used for the original tarball in 3a445cb49795fabe0d8caaf12bfc38eb9e12d5fc "Turn onlineupdate into external/onlineupdate"). * The additional modifications in external/onlineupdate/lo.patch are: ** Allowing to pass the list of files into the mar tool via -f instead of on the command line, to avoid "command line too long" errors on Windows, inspired by the modifications once made directly in our old downstream sources with 4165dd4e465a86ba6abe9afb3abfda5ef72493ea "add a way to create mar file from file", 8e4d49340bd235a7db8fde1d24dd1d63ddc4d571 "use the new file based approach for the mar creation", and fb13ed6955cd66017e5348b915af371a184ea633 "add the manifest file to the mar file". (To keep things simple for now, it still uses a hard-coded maximum of 10000 lines in the file, marked with a TODO.) ** Not failing when "precomplete file is missing!" (There is a comment // Applications aren't required to have a precomplete manifest. The mar // generation scripts enforce the presence of a precomplete manifest. in workdir/UnpackedTarball/onlineupdate/onlineupdate/source/update/updater/updater.cpp and it appears to be OK that we don't have such a precomplete manifest file and just skip that test.) * In the Makefile.gbuild create-update-info, the create_full_mar.py script needs to be called with a Unix pathname on Windows, or else the #!/usr/bin/env python3 shebang in that script would get confused. * The related Makefile.gbuild targets upload-update-info and create-partial-info have not been addressed yet. Change-Id: Iab4e083ddbe99e07d846e202f20c6031e2983e1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161656 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-04 05:00:27 -06:00
--- onlineupdate/source/libmar/tool/mar.c
+++ onlineupdate/source/libmar/tool/mar.c
@@ -14,7 +14,9 @@
# include <windows.h>
# include <direct.h>
# define chdir _chdir
+# define PATH_MAX MAX_PATH
#else
+# include <limits.h>
# include <unistd.h>
#endif
@@ -39,7 +41,7 @@
printf("Create a MAR file:\n");
printf(
" mar -H MARChannelID -V ProductVersion [-C workingDir] "
- "-c archive.mar [files...]\n");
+ "-c archive.mar [files...|-f files]\n");
printf("Extract a MAR file:\n");
printf(" mar [-C workingDir] -x archive.mar\n");
@@ -244,6 +246,8 @@
switch (argv[1][1]) {
case 'c': {
+ int numfiles;
+ char** files;
struct ProductInformationBlock infoBlock;
if (!productVersion) {
fprintf(stderr,
@@ -256,9 +260,61 @@
"<mar-channel-id>`).\n");
return -1;
}
+ if (argc == 5 && !strcmp(argv[3], "-f")) {
+ FILE* in;
+ in = fopen(argv[4], "r");
+ if (!in) {
+ fprintf(stderr,
+ "ERROR: Cannot open file `%s` for reading.\n", argv[4]);
+ return -1;
+ }
+ numfiles = 0;
+ files = malloc(sizeof(char*) * 10000); /*TODO*/
+ if (!files) {
+ fprintf(stderr,
+ "ERROR: Cannot allocate memory");
+ return -1;
+ }
+ for (;;) {
+ char buf[PATH_MAX + 1];
+ size_t len;
+ if (!fgets(buf, PATH_MAX + 1, in)) {
+ if (feof(in)) {
+ break;
+ }
+ fprintf(stderr,
+ "ERROR: Cannot read from file `%s`.\n", argv[4]);
+ return -1;
+ }
+ len = strlen(buf);
+ if (len != 0 && buf[len - 1] == '\n') {
+ buf[len - 1] = '\0';
+ } else if (!feof(in)) {
+ fprintf(stderr,
+ "ERROR: Too long line in file `%s`.\n", argv[4]);
+ return -1;
+ }
+ if (numfiles == 10000) { /*TODO*/
+ fprintf(stderr,
+ "ERROR: Too many lines in file `%s`.\n", argv[4]);
+ return -1;
+ }
+ files[numfiles] = strdup(buf);
+ if (!files[numfiles]) {
+ fprintf(stderr,
+ "ERROR: Cannot allocate memory");
+ return -1;
+ }
+ ++numfiles;
+ }
+ fclose(in);
+ } else {
+ numfiles = argc - 3;
+ files = argv + 3;
+ }
infoBlock.MARChannelID = MARChannelID;
infoBlock.productVersion = productVersion;
- return mar_create(argv[2], argc - 3, argv + 3, &infoBlock);
+ return mar_create(argv[2], numfiles, files, &infoBlock);
}
case 'i': {
if (!productVersion) {
Improve --enable-online-update-mar Windows MOZ_MAINTENANCE_SERVICE feature To get the MOZ_MAINTENANCE_SERVICE mode going at all, update.status needs to contain a "pending-service" token. For Mozilla, code in its toolkit/mozapps/update/UpdateService.sys.mjs takes care of writing that. For us, lets always write that in update_checker() (even on Linux, where it's apparently harmless). Then, the MOZ_MAINTENANCE_SERVICE code is rather picky with its various sanity checks: Among other things, it expects argv[0] to be a full path to the updater executable, and it expects the update.mar (and its status and log files) to be in a directory hierarchy named updates/0/ rather than patch/. So get all that fixed in desktop/source/app/updater.cxx. And patch in external/onlineupdate/lo.patch where it expects to find the updater executable (just updater.exe vs. our program/updater.exe). And we shouldn't interfere with the upstream Mozilla maintenance service, so also rename that in external/onlineupdate/lo.patch. And `update_service install` wants to read version resources from the update_service.exe, so provide that (via gb_Executable_add_default_nativeres). Also, `update_service install` wants to read a MozillaMaintenanceDescription value from an updater.ini, so provide one (with contents of that value inspired by Mozilla's browser/locales/en-US/updater/updater.ini). As we now have an updater.ini anyway (and which apparently works fine with Unix line ends on both Linux and Windows), also use it on Linux and drop the onlineupdate/source/update/updater/progressui_gtk.cpp again from external/onlineupdate/lo.patch. And update external/onlineupdate/README.md how to manually execute that test against an updater.ini. Change-Id: I0e3e5e5311be61e1224cda700af2e5d751113a99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160996 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-12-19 09:50:42 -06:00
--- onlineupdate/source/service/serviceinstall.cpp
+++ onlineupdate/source/service/serviceinstall.cpp
@@ -25,7 +25,7 @@
// This uninstall key is defined originally in maintenanceservice_installer.nsi
#define MAINT_UNINSTALL_KEY \
- L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MozillaMaintenan" \
+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\LibreOfficeMaintenan" \
L"ceService"
static BOOL UpdateUninstallerVersionString(LPWSTR versionString) {
@@ -201,7 +201,7 @@
size_t currentServicePathLen = wcslen(currentServicePath);
bool doesServiceHaveCorrectPath =
currentServicePathLen > 2 &&
- !wcsstr(currentServicePath, L"maintenanceservice_tmp.exe") &&
+ !wcsstr(currentServicePath, L"update_service_tmp.exe") &&
currentServicePath[0] == L'\"' &&
currentServicePath[currentServicePathLen - 1] == L'\"';
@@ -222,7 +222,7 @@
LOG_WARN(("Couldn't remove file spec. (%lu)", GetLastError()));
return FALSE;
}
- if (!PathAppendSafe(fixedPath, L"maintenanceservice.exe")) {
+ if (!PathAppendSafe(fixedPath, L"update_service.exe")) {
LOG_WARN(("Couldn't append file spec. (%lu)", GetLastError()));
return FALSE;
}
@@ -561,7 +561,7 @@
// The service can be in a stopped state but the exe still in use
// so make sure the process is really gone before proceeding
- WaitForProcessExit(L"maintenanceservice.exe", 30);
+ WaitForProcessExit(L"update_service.exe", 30);
LOG(("Done waiting for service stop, last service state: %lu", lastState));
return lastState == SERVICE_STOPPED;
--- onlineupdate/source/service/serviceinstall.h
+++ onlineupdate/source/service/serviceinstall.h
@@ -4,7 +4,7 @@
#include "readstrings.h"
-#define SVC_DISPLAY_NAME L"Mozilla Maintenance Service"
+#define SVC_DISPLAY_NAME L"LibreOffice Maintenance Service"
enum SvcInstallAction { UpgradeSvc, InstallSvc, ForceInstallSvc };
BOOL SvcInstall(SvcInstallAction action);
--- onlineupdate/source/update/common/pathhash.cpp
+++ onlineupdate/source/update/common/pathhash.cpp
@@ -119,7 +119,7 @@
delete[] lowercasePath;
LPCWSTR baseRegPath =
- L"SOFTWARE\\Mozilla\\"
+ L"SOFTWARE\\LibreOffice\\"
L"MaintenanceService\\";
wcsncpy(registryPath, baseRegPath, MAX_PATH);
BinaryDataToHexString(hash, hashSize, registryPath + wcslen(baseRegPath));
--- onlineupdate/source/update/common/updatehelper.cpp
+++ onlineupdate/source/update/common/updatehelper.cpp
@@ -78,7 +78,7 @@
wcsncpy(outBuf, progFilesX86, MAX_PATH + 1);
CoTaskMemFree(progFilesX86);
Turn onlineupdate into external/onlineupdate ...and update to latest Mozilla sources. Originally, this was a non-external onlineupdate module (plus correspsonding top-level include/onlineupdate/ directory) that apparently contained sources originally copied from Mozilla and subsequently modified in-place (plus, mixed in, presumably some sources that were not copied from Mozilla but were our own inventions). To clean up this mess, this has been turned into a proper external/onlineupdate module with a tarball containing the pristine external Mozilla sources. The sources for the onlineupdate-c003be8b9727672e7d30972983b375f4c200233f.tar.xz tarball are taken, somewhat arbitrarily, from a recent <https://github.com/mozilla/gecko-dev/commit/c003be8b9727672e7d30972983b375f4c200233f> ("Bug 1867784 - Force reflow all kids in the last column balancing reflow. r=layout-reviewers,dholbert") trunk state, by running `external/onlineupdate/generate-sources.sh ~/github.com/mozilla/gecko-dev` on a Fedora 39 machine. The layout of the tarball still mostly follows the old onlineupdate/ layout, even if that deviates heavily from the actual source layout at <https://github.com/mozilla/gecko-dev/>. (And some files, which apparently are not needed, anyway, lacked sources, see the "Missing source for" in external/onlineupdate/generate-sources.sh. And win_dirent.h/.cpp has meanwhile been superseded by updateutils_win.h/.cpp.) Merely newly included source files are laid out in the tarball according to the actual source layout. Any LO-specific modifications are made via patch files (rather than modifying the sources inline, as was done in the past): external/onlineupdate/lo.patch contains whatever modifications are needed to adapt the functionality, while external/onlineupdate/gtk3deprecated.patch fixes > workdir/UnpackedTarball/onlineupdate/onlineupdate/source/update/updater/progressui_gtk.cpp:97:21: error: use of undeclared identifier 'gtk_vbox_new'; did you mean 'gtk_box_new'? > 97 | GtkWidget* vbox = gtk_vbox_new(TRUE, 6); > | ^~~~~~~~~~~~ > | gtk_box_new to not use the deprecated gtk_vbox_new, which is hidden because we include -DGTK_DISABLE_DEPRECATED in our GTK3_CFLAGS as per our configure.ac. On Windows, the definition of __BYTE_ORDER__ etc. is needed because workdir/UnpackedTarball/onlineupdate/include/mozilla/ says "Our supported compilers provide architecture-independent macros for this", but MSVC doesn't actually, so define here what would implicitly be defined by GCC. Similarly, on Windows -U_WIN32_WINNT is needed to undo -D_WIN32_WINNT=0x0601 in solenv/gbuild/platform/windows.mk, which would cause > workdir\UnpackedTarball\onlineupdate\include\mozilla/WinHeaderOnlyUtils.h(537): error C2065: 'FILE_ID_INFO': undeclared identifier etc., despite the #include <windws.h> there. Curiously, the original gb_CustomTarget_CustomTarget,onlineupdate/generated from onlineupdate/CustomTarget_generated.mk had to be renamed to gb_CustomTarget_CustomTarget,external/onlineupdate/generated when the file was moved to external/onlineupdate/CustomTarget_generated.mk, as otherwise a top-level `make CustomTarget_onlineupdate/generated` would have failed with "No rule to make target..." Also, as there is no gb_CustomTarget_use_unpacked, its effect has been poorly mimicked for now in external/onlineupdate/CustomTarget_generated.mk. Similarly, as there is no gb_WinResTarget_use_unpacked, its effect has been poorly mimicked for now in external/onlineupdate/WinResTarget_updater.mk. The original onlineupdate/workben/test_dialog.cxx, which is actually code written by us, has been moved to external/onlineupdate/workben/test_dialog.cxx. The original onlineupdate/qa/ sources (which were apparently not used during the build) have been preserved for now as external/onlineupdate/qa/, for documentation purposes. The original onlineupdate/astyle.options (which was apparently not used during the build) has been removed. Change-Id: I5ea606202e7837269e7b128e45af2f0b8c277f9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160492 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-12-08 09:39:43 -06:00
Improve --enable-online-update-mar Windows MOZ_MAINTENANCE_SERVICE feature To get the MOZ_MAINTENANCE_SERVICE mode going at all, update.status needs to contain a "pending-service" token. For Mozilla, code in its toolkit/mozapps/update/UpdateService.sys.mjs takes care of writing that. For us, lets always write that in update_checker() (even on Linux, where it's apparently harmless). Then, the MOZ_MAINTENANCE_SERVICE code is rather picky with its various sanity checks: Among other things, it expects argv[0] to be a full path to the updater executable, and it expects the update.mar (and its status and log files) to be in a directory hierarchy named updates/0/ rather than patch/. So get all that fixed in desktop/source/app/updater.cxx. And patch in external/onlineupdate/lo.patch where it expects to find the updater executable (just updater.exe vs. our program/updater.exe). And we shouldn't interfere with the upstream Mozilla maintenance service, so also rename that in external/onlineupdate/lo.patch. And `update_service install` wants to read version resources from the update_service.exe, so provide that (via gb_Executable_add_default_nativeres). Also, `update_service install` wants to read a MozillaMaintenanceDescription value from an updater.ini, so provide one (with contents of that value inspired by Mozilla's browser/locales/en-US/updater/updater.ini). As we now have an updater.ini anyway (and which apparently works fine with Unix line ends on both Linux and Windows), also use it on Linux and drop the onlineupdate/source/update/updater/progressui_gtk.cpp again from external/onlineupdate/lo.patch. And update external/onlineupdate/README.md how to manually execute that test against an updater.ini. Change-Id: I0e3e5e5311be61e1224cda700af2e5d751113a99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160996 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-12-19 09:50:42 -06:00
- if (!PathAppendSafe(outBuf, L"Mozilla Maintenance Service")) {
+ if (!PathAppendSafe(outBuf, L"LibreOffice Maintenance Service")) {
return FALSE;
}
@@ -311,7 +311,7 @@
// Obtain the temp path of the maintenance service binary
WCHAR tmpService[MAX_PATH + 1] = {L'\0'};
if (!PathGetSiblingFilePath(tmpService, serviceConfig.lpBinaryPathName,
- L"maintenanceservice_tmp.exe")) {
+ L"update_service_tmp.exe")) {
return FALSE;
}
@@ -322,7 +322,7 @@
// Get the new maintenance service path from the install dir
WCHAR newMaintServicePath[MAX_PATH + 1] = {L'\0'};
wcsncpy(newMaintServicePath, installDir, MAX_PATH);
- PathAppendSafe(newMaintServicePath, L"maintenanceservice.exe");
+ PathAppendSafe(newMaintServicePath, L"update_service.exe");
// Copy the temp file in alongside the maintenace service.
// This is a requirement for maintenance service upgrades.
@@ -429,7 +429,7 @@
// 2) The command being executed, which is "software-update"
// 3) The path to updater.exe (from argv[0])
LPCWSTR* updaterServiceArgv = new LPCWSTR[argc + 2];
- updaterServiceArgv[0] = L"MozillaMaintenance";
+ updaterServiceArgv[0] = L"LibreOfficeMaintenance";
updaterServiceArgv[1] = L"software-update";
for (int i = 0; i < argc; ++i) {
--- onlineupdate/source/update/common/updatehelper.h
+++ onlineupdate/source/update/common/updatehelper.h
@@ -24,9 +24,9 @@
#define PATCH_DIR_PATH L"\\updates\\0"
#ifdef MOZ_MAINTENANCE_SERVICE
-# define SVC_NAME L"MozillaMaintenance"
+# define SVC_NAME L"LibreOfficeMaintenance"
-# define BASE_SERVICE_REG_KEY L"SOFTWARE\\Mozilla\\MaintenanceService"
+# define BASE_SERVICE_REG_KEY L"SOFTWARE\\LibreOffice\\MaintenanceService"
// The test only fallback key, as its name implies, is only present on machines
// that will use automated tests. Since automated tests always run from a
--- onlineupdate/source/service/workmonitor.cpp
+++ onlineupdate/source/service/workmonitor.cpp
@@ -328,7 +328,7 @@
// The installation dir that we are installing to is installDir.
WCHAR installDirUpdater[MAX_PATH + 1] = {L'\0'};
wcsncpy(installDirUpdater, installDir, MAX_PATH);
- if (!PathAppendSafe(installDirUpdater, L"updater.exe")) {
+ if (!PathAppendSafe(installDirUpdater, L"program\\updater.exe")) {
LOG_WARN(("Install directory updater could not be determined."));
return false;
}
@@ -746,7 +746,7 @@
WCHAR installDirUpdater[MAX_PATH + 1] = {L'\0'};
wcsncpy(installDirUpdater, installDir, MAX_PATH);
- if (!PathAppendSafe(installDirUpdater, L"updater.exe")) {
+ if (!PathAppendSafe(installDirUpdater, L"program\\updater.exe")) {
LOG_WARN(("Install directory updater could not be determined."));
result = FALSE;
}
MAR update, too big to (not) fail On Windows, when a MAR update generated by create-partial-info contains very many patches (as easily happens with LibreOffice), applying it would fail with "failed: 7" (aka WRITE_ERROR, see workdir/UnpackedTarball/onlineupdate/onlineupdate/source/update/common/updatererror.h) because in workdir/UnpackedTarball/onlineupdate/onlineupdate/source/update/updater/updater.cpp PatchFile::mPatchStream holds open one FILE instance per patch from PatchFile::Prepare to PatchFile::Execute (and which can't easily be reworked because of the Lock/UnlockFile done on the underlying HANDLE "so it can't be messed with [in] between"), so calling NS_tfopen in PatchFile::Prepare will eventually start to fail with EMFILE. To avoid that, try to raise the limit to its maximum (but don't fail immediately if that fails, in case the given MAR update wouldn't run into the issue of too many patches, anyway), and keep fingers crossed. (See <https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/setmaxstdio?view=msvc-170> "_setmaxstdio" for details: "By default, up to 512 files can be open simultaneously at the stream I/O level. This level includes files opened and accessed using the fopen, fgetc, and fputc family of functions. The limit of 512 open files at the stream I/O level can be increased to a maximum of 8,192 by use of the _setmaxstdio function.") Change-Id: I6b3499f0f6c2060628418a15f5e36021bfe7dd18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162442 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-23 07:20:51 -06:00
--- onlineupdate/source/update/updater/updater.cpp
+++ onlineupdate/source/update/updater/updater.cpp
@@ -4174,6 +4174,10 @@
NS_tmkdir(gDeleteDirPath, 0755);
}
}
+
+ if (_setmaxstdio(8192) == -1) {
+ LOG(("_setmaxstdio failed"));
+ }
#endif /* XP_WIN */
// Run update process on a background thread. ShowProgressUI may return
Make create-update-info handle conditional content That make target operates on an archive, but generates data to be applied to an msi installation, so suffers from any mismatch between archive and msi install sets. Two such mismatches, at least on Windows, are: 1 Files that msi will install outside the LibreOffice installation itself (but which for an archive install set are included under LibreOffice/). This covers (at least) .Net assemblies and associated files that are installed in the GAC (scp2 styles ASSEMBLY and ASSIGNCOMPONENT) and fonts (scp2 style FONT). 2 Files that msi will only install conditionally. This covers optional components (many of which in scp2 are assigned to gid_Module_Optional_... modules) and user interface languages (which in scp2 are assigned to gid_Module_Langpack_... modules). The approach taken here is to create a workdir/installation/LibreOffice/archive/install/metadata file while building an archive install set, and to record any files matching 1 (as "skip" lines) or 2 (as "cond" lines). Then, the create-update-info target uses that metadata file to act accordingly on those files: 1 Files from "skip" lines are simply removed for now from the extracted archive that is passed to Mozilla's make_full_update.sh script. (TODO: That means that changes to such files will not be updated with the MAR update mechanism. This would apparently need some extra processing during the MAR update.) 2 Files from "cond" lines shall be recorded as add-if in the mar file manifest. Mozilla's make_full_update.sh script already has support for emitting add-if vs. plain add, but only for files under distribution/extensions/, which doesn't match our needs. So we generate from the metadata file an ifs file that we pass into the make_full_update.sh script, and patch that script to also take that ifs file into account. (Each line in the ifs file is of the form "testfile" "file" which works as long as none of the pathnames contains double quote characters. The Mozilla script code appears to be confused about the arguments to make_add_instruction(), where this ifs file will be needed: There are calls to make_add_instruction() with two or three arguments across make_full_update.sh and make_incremental_update.sh, but make_add_instruction() checks $1, $2, and $4 (but not $3), so leave that mess alone and pass the ifs file as a global IFSFILE variable instead.) The mar file manifest `add-if "testfile" "file"` adds "file" only if "testfile" is already present, and those two can be different files. TODO: However, for simplicity, for now I always use "file" also as the "testfile" (so that an add-if file only gets updated if it was already present). That avoids having to identify a specific "key file" for each optional component and for each user interface language, where that key file would be used as the add-if testfile. But on the other hand, it means that if an optional component or a user interface language will bring along a completely new file in the future, we will not install that file during a MAR update. What obviously remains to be done is to properly assign each add-if file to a specific key file. (And the current way of identifying add-if files by gid_Module_... names appears to be too simplistic too. For example, there are some gid_Module_Optional_... that are installed unconditionally for msi; but it should be harmless that those files are recorded as add-if rather than as plain add.) Change-Id: I2fdeed92604f3a2d8a0b500b9e3fa421cfb6a9cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161917 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-11 01:52:22 -06:00
--- tools/update-packaging/common.sh
+++ tools/update-packaging/common.sh
Create MAR updates from msi rather than from archive ...as the former is more convenient for release engineering (see the discussion in the comments at <https://gerrit.libreoffice.org/c/core/+/162157/1#message-8d7ebbcc64a87ee8e4a073ae1a05e3b74f5a3d6a> "Also enable --with-package-format=archive for LibreOfficeWin64.conf"). Instead of ONLINEUPDATE_MAR_OLDARCHIVE and ONLINEUPDATE_MAR_OLDMETADATA make variables, the create-partial-info target now only needs an ONLINEUPDATE_MAR_OLDMSI make variable. TODO: There are two issues when comparing the content of msi files (extracted with msiexec /a), which the old code comparing the content of archives had tried to somewhat (but not fully) address with the metadata files that I had invented (and now reverted): For one, msiexec /a also extracts content that would normally be installed somewhere else in the system (e.g., it extracts Fonts, System, and System64 directories). Differences in those directories will cause a MAR update to create those directories in the installation directory, rather than to update the corresponding files in their actual locations. For another, optional components are not recognized as such, but their content must be added to the MAR file as add/patch-if, not as plain add/patch. To work around that, for now *all* files are added as add/patch-if, conditional on the files themselves. Thus, addition of files will cause a MAR update to miss them. (As they now exclusively operate on msi files, the create-update-info and create-partial-info targets are no longer meaningful for non-Windows platforms, so drop the non-Windows bin/update/create_full_mar_for_languages.py part.) Change-Id: Ifb55b5e7d1a201b4f50a27cb449a634b96c2e29b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162399 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-22 04:49:45 -06:00
@@ -76,17 +76,8 @@
Make create-update-info handle conditional content That make target operates on an archive, but generates data to be applied to an msi installation, so suffers from any mismatch between archive and msi install sets. Two such mismatches, at least on Windows, are: 1 Files that msi will install outside the LibreOffice installation itself (but which for an archive install set are included under LibreOffice/). This covers (at least) .Net assemblies and associated files that are installed in the GAC (scp2 styles ASSEMBLY and ASSIGNCOMPONENT) and fonts (scp2 style FONT). 2 Files that msi will only install conditionally. This covers optional components (many of which in scp2 are assigned to gid_Module_Optional_... modules) and user interface languages (which in scp2 are assigned to gid_Module_Langpack_... modules). The approach taken here is to create a workdir/installation/LibreOffice/archive/install/metadata file while building an archive install set, and to record any files matching 1 (as "skip" lines) or 2 (as "cond" lines). Then, the create-update-info target uses that metadata file to act accordingly on those files: 1 Files from "skip" lines are simply removed for now from the extracted archive that is passed to Mozilla's make_full_update.sh script. (TODO: That means that changes to such files will not be updated with the MAR update mechanism. This would apparently need some extra processing during the MAR update.) 2 Files from "cond" lines shall be recorded as add-if in the mar file manifest. Mozilla's make_full_update.sh script already has support for emitting add-if vs. plain add, but only for files under distribution/extensions/, which doesn't match our needs. So we generate from the metadata file an ifs file that we pass into the make_full_update.sh script, and patch that script to also take that ifs file into account. (Each line in the ifs file is of the form "testfile" "file" which works as long as none of the pathnames contains double quote characters. The Mozilla script code appears to be confused about the arguments to make_add_instruction(), where this ifs file will be needed: There are calls to make_add_instruction() with two or three arguments across make_full_update.sh and make_incremental_update.sh, but make_add_instruction() checks $1, $2, and $4 (but not $3), so leave that mess alone and pass the ifs file as a global IFSFILE variable instead.) The mar file manifest `add-if "testfile" "file"` adds "file" only if "testfile" is already present, and those two can be different files. TODO: However, for simplicity, for now I always use "file" also as the "testfile" (so that an add-if file only gets updated if it was already present). That avoids having to identify a specific "key file" for each optional component and for each user interface language, where that key file would be used as the add-if testfile. But on the other hand, it means that if an optional component or a user interface language will bring along a completely new file in the future, we will not install that file during a MAR update. What obviously remains to be done is to properly assign each add-if file to a specific key file. (And the current way of identifying add-if files by gid_Module_... names appears to be too simplistic too. For example, there are some gid_Module_Optional_... that are installed unconditionally for msi; but it should be harmless that those files are recorded as add-if rather than as plain add.) Change-Id: I2fdeed92604f3a2d8a0b500b9e3fa421cfb6a9cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161917 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-11 01:52:22 -06:00
forced=
fi
Create MAR updates from msi rather than from archive ...as the former is more convenient for release engineering (see the discussion in the comments at <https://gerrit.libreoffice.org/c/core/+/162157/1#message-8d7ebbcc64a87ee8e4a073ae1a05e3b74f5a3d6a> "Also enable --with-package-format=archive for LibreOfficeWin64.conf"). Instead of ONLINEUPDATE_MAR_OLDARCHIVE and ONLINEUPDATE_MAR_OLDMETADATA make variables, the create-partial-info target now only needs an ONLINEUPDATE_MAR_OLDMSI make variable. TODO: There are two issues when comparing the content of msi files (extracted with msiexec /a), which the old code comparing the content of archives had tried to somewhat (but not fully) address with the metadata files that I had invented (and now reverted): For one, msiexec /a also extracts content that would normally be installed somewhere else in the system (e.g., it extracts Fonts, System, and System64 directories). Differences in those directories will cause a MAR update to create those directories in the installation directory, rather than to update the corresponding files in their actual locations. For another, optional components are not recognized as such, but their content must be added to the MAR file as add/patch-if, not as plain add/patch. To work around that, for now *all* files are added as add/patch-if, conditional on the files themselves. Thus, addition of files will cause a MAR update to miss them. (As they now exclusively operate on msi files, the create-update-info and create-partial-info targets are no longer meaningful for non-Windows platforms, so drop the non-Windows bin/update/create_full_mar_for_languages.py part.) Change-Id: Ifb55b5e7d1a201b4f50a27cb449a634b96c2e29b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162399 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-22 04:49:45 -06:00
- is_extension=$(echo "$f" | grep -c 'distribution/extensions/.*/')
- if [ $is_extension = "1" ]; then
- # Use the subdirectory of the extensions folder as the file to test
- # before performing this add instruction.
- testdir=$(echo "$f" | sed 's/\(.*distribution\/extensions\/[^\/]*\)\/.*/\1/')
- verbose_notice " add-if \"$testdir\" \"$f\""
- echo "add-if \"$testdir\" \"$f\"" >> "$filev3"
- else
- verbose_notice " add \"$f\"$forced"
- echo "add \"$f\"" >> "$filev3"
- fi
+ verbose_notice " add-if \"$f\" \"$f\"$forced"
+ echo "add-if \"$f\" \"$f\"" >> "$filev3"
}
check_for_add_if_not_update() {
@@ -113,17 +104,8 @@
f="$1"
filev3="$2"
Create MAR updates from msi rather than from archive ...as the former is more convenient for release engineering (see the discussion in the comments at <https://gerrit.libreoffice.org/c/core/+/162157/1#message-8d7ebbcc64a87ee8e4a073ae1a05e3b74f5a3d6a> "Also enable --with-package-format=archive for LibreOfficeWin64.conf"). Instead of ONLINEUPDATE_MAR_OLDARCHIVE and ONLINEUPDATE_MAR_OLDMETADATA make variables, the create-partial-info target now only needs an ONLINEUPDATE_MAR_OLDMSI make variable. TODO: There are two issues when comparing the content of msi files (extracted with msiexec /a), which the old code comparing the content of archives had tried to somewhat (but not fully) address with the metadata files that I had invented (and now reverted): For one, msiexec /a also extracts content that would normally be installed somewhere else in the system (e.g., it extracts Fonts, System, and System64 directories). Differences in those directories will cause a MAR update to create those directories in the installation directory, rather than to update the corresponding files in their actual locations. For another, optional components are not recognized as such, but their content must be added to the MAR file as add/patch-if, not as plain add/patch. To work around that, for now *all* files are added as add/patch-if, conditional on the files themselves. Thus, addition of files will cause a MAR update to miss them. (As they now exclusively operate on msi files, the create-update-info and create-partial-info targets are no longer meaningful for non-Windows platforms, so drop the non-Windows bin/update/create_full_mar_for_languages.py part.) Change-Id: Ifb55b5e7d1a201b4f50a27cb449a634b96c2e29b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162399 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-22 04:49:45 -06:00
- is_extension=$(echo "$f" | grep -c 'distribution/extensions/.*/')
- if [ $is_extension = "1" ]; then
- # Use the subdirectory of the extensions folder as the file to test
- # before performing this add instruction.
- testdir=$(echo "$f" | sed 's/\(.*distribution\/extensions\/[^\/]*\)\/.*/\1/')
- verbose_notice " patch-if \"$testdir\" \"$f.patch\" \"$f\""
- echo "patch-if \"$testdir\" \"$f.patch\" \"$f\"" >> "$filev3"
- else
- verbose_notice " patch \"$f.patch\" \"$f\""
- echo "patch \"$f.patch\" \"$f\"" >> "$filev3"
- fi
+ verbose_notice " patch-if \"$f\" \"$f.patch\" \"$f\""
+ echo "patch-if \"$f\" \"$f.patch\" \"$f\"" >> "$filev3"
}
append_remove_instructions() {
Fix `make create-update-info` (for Windows, at least) * The shell scripts that had once been copied from Mozilla to bin/update/*.sh are now included in onlineupdate-c003be8b9727672e7d30972983b375f4c200233f-2.tar.xz (which is still generated from the same <https://github.com/mozilla/gecko-dev/commit/c003be8b9727672e7d30972983b375f4c200233f> that was used for the original tarball in 3a445cb49795fabe0d8caaf12bfc38eb9e12d5fc "Turn onlineupdate into external/onlineupdate"). * The additional modifications in external/onlineupdate/lo.patch are: ** Allowing to pass the list of files into the mar tool via -f instead of on the command line, to avoid "command line too long" errors on Windows, inspired by the modifications once made directly in our old downstream sources with 4165dd4e465a86ba6abe9afb3abfda5ef72493ea "add a way to create mar file from file", 8e4d49340bd235a7db8fde1d24dd1d63ddc4d571 "use the new file based approach for the mar creation", and fb13ed6955cd66017e5348b915af371a184ea633 "add the manifest file to the mar file". (To keep things simple for now, it still uses a hard-coded maximum of 10000 lines in the file, marked with a TODO.) ** Not failing when "precomplete file is missing!" (There is a comment // Applications aren't required to have a precomplete manifest. The mar // generation scripts enforce the presence of a precomplete manifest. in workdir/UnpackedTarball/onlineupdate/onlineupdate/source/update/updater/updater.cpp and it appears to be OK that we don't have such a precomplete manifest file and just skip that test.) * In the Makefile.gbuild create-update-info, the create_full_mar.py script needs to be called with a Unix pathname on Windows, or else the #!/usr/bin/env python3 shebang in that script would get confused. * The related Makefile.gbuild targets upload-update-info and create-partial-info have not been addressed yet. Change-Id: Iab4e083ddbe99e07d846e202f20c6031e2983e1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161656 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-04 05:00:27 -06:00
--- tools/update-packaging/make_full_update.sh
+++ tools/update-packaging/make_full_update.sh
Create MAR updates from msi rather than from archive ...as the former is more convenient for release engineering (see the discussion in the comments at <https://gerrit.libreoffice.org/c/core/+/162157/1#message-8d7ebbcc64a87ee8e4a073ae1a05e3b74f5a3d6a> "Also enable --with-package-format=archive for LibreOfficeWin64.conf"). Instead of ONLINEUPDATE_MAR_OLDARCHIVE and ONLINEUPDATE_MAR_OLDMETADATA make variables, the create-partial-info target now only needs an ONLINEUPDATE_MAR_OLDMSI make variable. TODO: There are two issues when comparing the content of msi files (extracted with msiexec /a), which the old code comparing the content of archives had tried to somewhat (but not fully) address with the metadata files that I had invented (and now reverted): For one, msiexec /a also extracts content that would normally be installed somewhere else in the system (e.g., it extracts Fonts, System, and System64 directories). Differences in those directories will cause a MAR update to create those directories in the installation directory, rather than to update the corresponding files in their actual locations. For another, optional components are not recognized as such, but their content must be added to the MAR file as add/patch-if, not as plain add/patch. To work around that, for now *all* files are added as add/patch-if, conditional on the files themselves. Thus, addition of files will cause a MAR update to miss them. (As they now exclusively operate on msi files, the create-update-info and create-partial-info targets are no longer meaningful for non-Windows platforms, so drop the non-Windows bin/update/create_full_mar_for_languages.py part.) Change-Id: Ifb55b5e7d1a201b4f50a27cb449a634b96c2e29b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162399 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-22 04:49:45 -06:00
@@ -53,9 +53,10 @@
Fix `make create-update-info` (for Windows, at least) * The shell scripts that had once been copied from Mozilla to bin/update/*.sh are now included in onlineupdate-c003be8b9727672e7d30972983b375f4c200233f-2.tar.xz (which is still generated from the same <https://github.com/mozilla/gecko-dev/commit/c003be8b9727672e7d30972983b375f4c200233f> that was used for the original tarball in 3a445cb49795fabe0d8caaf12bfc38eb9e12d5fc "Turn onlineupdate into external/onlineupdate"). * The additional modifications in external/onlineupdate/lo.patch are: ** Allowing to pass the list of files into the mar tool via -f instead of on the command line, to avoid "command line too long" errors on Windows, inspired by the modifications once made directly in our old downstream sources with 4165dd4e465a86ba6abe9afb3abfda5ef72493ea "add a way to create mar file from file", 8e4d49340bd235a7db8fde1d24dd1d63ddc4d571 "use the new file based approach for the mar creation", and fb13ed6955cd66017e5348b915af371a184ea633 "add the manifest file to the mar file". (To keep things simple for now, it still uses a hard-coded maximum of 10000 lines in the file, marked with a TODO.) ** Not failing when "precomplete file is missing!" (There is a comment // Applications aren't required to have a precomplete manifest. The mar // generation scripts enforce the presence of a precomplete manifest. in workdir/UnpackedTarball/onlineupdate/onlineupdate/source/update/updater/updater.cpp and it appears to be OK that we don't have such a precomplete manifest file and just skip that test.) * In the Makefile.gbuild create-update-info, the create_full_mar.py script needs to be called with a Unix pathname on Windows, or else the #!/usr/bin/env python3 shebang in that script would get confused. * The related Makefile.gbuild targets upload-update-info and create-partial-info have not been addressed yet. Change-Id: Iab4e083ddbe99e07d846e202f20c6031e2983e1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161656 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-04 05:00:27 -06:00
fi
workdir="$targetdir.work"
updatemanifestv3="$workdir/updatev3.manifest"
-targetfiles="updatev3.manifest"
mkdir -p "$workdir"
+
+printf 'updatev3.manifest\n' >"$workdir/files.txt"
# Generate a list of all files in the target directory.
pushd "$targetdir"
Create MAR updates from msi rather than from archive ...as the former is more convenient for release engineering (see the discussion in the comments at <https://gerrit.libreoffice.org/c/core/+/162157/1#message-8d7ebbcc64a87ee8e4a073ae1a05e3b74f5a3d6a> "Also enable --with-package-format=archive for LibreOfficeWin64.conf"). Instead of ONLINEUPDATE_MAR_OLDARCHIVE and ONLINEUPDATE_MAR_OLDMETADATA make variables, the create-partial-info target now only needs an ONLINEUPDATE_MAR_OLDMSI make variable. TODO: There are two issues when comparing the content of msi files (extracted with msiexec /a), which the old code comparing the content of archives had tried to somewhat (but not fully) address with the metadata files that I had invented (and now reverted): For one, msiexec /a also extracts content that would normally be installed somewhere else in the system (e.g., it extracts Fonts, System, and System64 directories). Differences in those directories will cause a MAR update to create those directories in the installation directory, rather than to update the corresponding files in their actual locations. For another, optional components are not recognized as such, but their content must be added to the MAR file as add/patch-if, not as plain add/patch. To work around that, for now *all* files are added as add/patch-if, conditional on the files themselves. Thus, addition of files will cause a MAR update to miss them. (As they now exclusively operate on msi files, the create-update-info and create-partial-info targets are no longer meaningful for non-Windows platforms, so drop the non-Windows bin/update/create_full_mar_for_languages.py part.) Change-Id: Ifb55b5e7d1a201b4f50a27cb449a634b96c2e29b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162399 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-22 04:49:45 -06:00
@@ -66,7 +67,6 @@
Fix `make create-update-info` (for Windows, at least) * The shell scripts that had once been copied from Mozilla to bin/update/*.sh are now included in onlineupdate-c003be8b9727672e7d30972983b375f4c200233f-2.tar.xz (which is still generated from the same <https://github.com/mozilla/gecko-dev/commit/c003be8b9727672e7d30972983b375f4c200233f> that was used for the original tarball in 3a445cb49795fabe0d8caaf12bfc38eb9e12d5fc "Turn onlineupdate into external/onlineupdate"). * The additional modifications in external/onlineupdate/lo.patch are: ** Allowing to pass the list of files into the mar tool via -f instead of on the command line, to avoid "command line too long" errors on Windows, inspired by the modifications once made directly in our old downstream sources with 4165dd4e465a86ba6abe9afb3abfda5ef72493ea "add a way to create mar file from file", 8e4d49340bd235a7db8fde1d24dd1d63ddc4d571 "use the new file based approach for the mar creation", and fb13ed6955cd66017e5348b915af371a184ea633 "add the manifest file to the mar file". (To keep things simple for now, it still uses a hard-coded maximum of 10000 lines in the file, marked with a TODO.) ** Not failing when "precomplete file is missing!" (There is a comment // Applications aren't required to have a precomplete manifest. The mar // generation scripts enforce the presence of a precomplete manifest. in workdir/UnpackedTarball/onlineupdate/onlineupdate/source/update/updater/updater.cpp and it appears to be OK that we don't have such a precomplete manifest file and just skip that test.) * In the Makefile.gbuild create-update-info, the create_full_mar.py script needs to be called with a Unix pathname on Windows, or else the #!/usr/bin/env python3 shebang in that script would get confused. * The related Makefile.gbuild targets upload-update-info and create-partial-info have not been addressed yet. Change-Id: Iab4e083ddbe99e07d846e202f20c6031e2983e1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161656 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-04 05:00:27 -06:00
if [ ! -f "precomplete" ]; then
if [ ! -f "Contents/Resources/precomplete" ]; then
notice "precomplete file is missing!"
- exit 1
fi
fi
Create MAR updates from msi rather than from archive ...as the former is more convenient for release engineering (see the discussion in the comments at <https://gerrit.libreoffice.org/c/core/+/162157/1#message-8d7ebbcc64a87ee8e4a073ae1a05e3b74f5a3d6a> "Also enable --with-package-format=archive for LibreOfficeWin64.conf"). Instead of ONLINEUPDATE_MAR_OLDARCHIVE and ONLINEUPDATE_MAR_OLDMETADATA make variables, the create-partial-info target now only needs an ONLINEUPDATE_MAR_OLDMSI make variable. TODO: There are two issues when comparing the content of msi files (extracted with msiexec /a), which the old code comparing the content of archives had tried to somewhat (but not fully) address with the metadata files that I had invented (and now reverted): For one, msiexec /a also extracts content that would normally be installed somewhere else in the system (e.g., it extracts Fonts, System, and System64 directories). Differences in those directories will cause a MAR update to create those directories in the installation directory, rather than to update the corresponding files in their actual locations. For another, optional components are not recognized as such, but their content must be added to the MAR file as add/patch-if, not as plain add/patch. To work around that, for now *all* files are added as add/patch-if, conditional on the files themselves. Thus, addition of files will cause a MAR update to miss them. (As they now exclusively operate on msi files, the create-update-info and create-partial-info targets are no longer meaningful for non-Windows platforms, so drop the non-Windows bin/update/create_full_mar_for_languages.py part.) Change-Id: Ifb55b5e7d1a201b4f50a27cb449a634b96c2e29b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162399 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-22 04:49:45 -06:00
@@ -99,7 +99,7 @@
Fix `make create-update-info` (for Windows, at least) * The shell scripts that had once been copied from Mozilla to bin/update/*.sh are now included in onlineupdate-c003be8b9727672e7d30972983b375f4c200233f-2.tar.xz (which is still generated from the same <https://github.com/mozilla/gecko-dev/commit/c003be8b9727672e7d30972983b375f4c200233f> that was used for the original tarball in 3a445cb49795fabe0d8caaf12bfc38eb9e12d5fc "Turn onlineupdate into external/onlineupdate"). * The additional modifications in external/onlineupdate/lo.patch are: ** Allowing to pass the list of files into the mar tool via -f instead of on the command line, to avoid "command line too long" errors on Windows, inspired by the modifications once made directly in our old downstream sources with 4165dd4e465a86ba6abe9afb3abfda5ef72493ea "add a way to create mar file from file", 8e4d49340bd235a7db8fde1d24dd1d63ddc4d571 "use the new file based approach for the mar creation", and fb13ed6955cd66017e5348b915af371a184ea633 "add the manifest file to the mar file". (To keep things simple for now, it still uses a hard-coded maximum of 10000 lines in the file, marked with a TODO.) ** Not failing when "precomplete file is missing!" (There is a comment // Applications aren't required to have a precomplete manifest. The mar // generation scripts enforce the presence of a precomplete manifest. in workdir/UnpackedTarball/onlineupdate/onlineupdate/source/update/updater/updater.cpp and it appears to be OK that we don't have such a precomplete manifest file and just skip that test.) * In the Makefile.gbuild create-update-info, the create_full_mar.py script needs to be called with a Unix pathname on Windows, or else the #!/usr/bin/env python3 shebang in that script would get confused. * The related Makefile.gbuild targets upload-update-info and create-partial-info have not been addressed yet. Change-Id: Iab4e083ddbe99e07d846e202f20c6031e2983e1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161656 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-04 05:00:27 -06:00
$XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$targetdir/$f" > "$workdir/$f"
copy_perm "$targetdir/$f" "$workdir/$f"
- targetfiles="$targetfiles \"$f\""
+ printf '%s\n' "$f" >>"$workdir/files.txt"
done
# Append remove instructions for any dead files.
Create MAR updates from msi rather than from archive ...as the former is more convenient for release engineering (see the discussion in the comments at <https://gerrit.libreoffice.org/c/core/+/162157/1#message-8d7ebbcc64a87ee8e4a073ae1a05e3b74f5a3d6a> "Also enable --with-package-format=archive for LibreOfficeWin64.conf"). Instead of ONLINEUPDATE_MAR_OLDARCHIVE and ONLINEUPDATE_MAR_OLDMETADATA make variables, the create-partial-info target now only needs an ONLINEUPDATE_MAR_OLDMSI make variable. TODO: There are two issues when comparing the content of msi files (extracted with msiexec /a), which the old code comparing the content of archives had tried to somewhat (but not fully) address with the metadata files that I had invented (and now reverted): For one, msiexec /a also extracts content that would normally be installed somewhere else in the system (e.g., it extracts Fonts, System, and System64 directories). Differences in those directories will cause a MAR update to create those directories in the installation directory, rather than to update the corresponding files in their actual locations. For another, optional components are not recognized as such, but their content must be added to the MAR file as add/patch-if, not as plain add/patch. To work around that, for now *all* files are added as add/patch-if, conditional on the files themselves. Thus, addition of files will cause a MAR update to miss them. (As they now exclusively operate on msi files, the create-update-info and create-partial-info targets are no longer meaningful for non-Windows platforms, so drop the non-Windows bin/update/create_full_mar_for_languages.py part.) Change-Id: Ifb55b5e7d1a201b4f50a27cb449a634b96c2e29b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162399 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-22 04:49:45 -06:00
@@ -110,7 +110,7 @@
Fix `make create-update-info` (for Windows, at least) * The shell scripts that had once been copied from Mozilla to bin/update/*.sh are now included in onlineupdate-c003be8b9727672e7d30972983b375f4c200233f-2.tar.xz (which is still generated from the same <https://github.com/mozilla/gecko-dev/commit/c003be8b9727672e7d30972983b375f4c200233f> that was used for the original tarball in 3a445cb49795fabe0d8caaf12bfc38eb9e12d5fc "Turn onlineupdate into external/onlineupdate"). * The additional modifications in external/onlineupdate/lo.patch are: ** Allowing to pass the list of files into the mar tool via -f instead of on the command line, to avoid "command line too long" errors on Windows, inspired by the modifications once made directly in our old downstream sources with 4165dd4e465a86ba6abe9afb3abfda5ef72493ea "add a way to create mar file from file", 8e4d49340bd235a7db8fde1d24dd1d63ddc4d571 "use the new file based approach for the mar creation", and fb13ed6955cd66017e5348b915af371a184ea633 "add the manifest file to the mar file". (To keep things simple for now, it still uses a hard-coded maximum of 10000 lines in the file, marked with a TODO.) ** Not failing when "precomplete file is missing!" (There is a comment // Applications aren't required to have a precomplete manifest. The mar // generation scripts enforce the presence of a precomplete manifest. in workdir/UnpackedTarball/onlineupdate/onlineupdate/source/update/updater/updater.cpp and it appears to be OK that we don't have such a precomplete manifest file and just skip that test.) * In the Makefile.gbuild create-update-info, the create_full_mar.py script needs to be called with a Unix pathname on Windows, or else the #!/usr/bin/env python3 shebang in that script would get confused. * The related Makefile.gbuild targets upload-update-info and create-partial-info have not been addressed yet. Change-Id: Iab4e083ddbe99e07d846e202f20c6031e2983e1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161656 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-04 05:00:27 -06:00
$XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
mar_command="$mar_command -C \"$workdir\" -c output.mar"
-eval "$mar_command $targetfiles"
+eval "$mar_command -f $workdir/files.txt"
mv -f "$workdir/output.mar" "$archive"
# cleanup
--- tools/update-packaging/make_incremental_update.sh
+++ tools/update-packaging/make_incremental_update.sh
Create MAR updates from msi rather than from archive ...as the former is more convenient for release engineering (see the discussion in the comments at <https://gerrit.libreoffice.org/c/core/+/162157/1#message-8d7ebbcc64a87ee8e4a073ae1a05e3b74f5a3d6a> "Also enable --with-package-format=archive for LibreOfficeWin64.conf"). Instead of ONLINEUPDATE_MAR_OLDARCHIVE and ONLINEUPDATE_MAR_OLDMETADATA make variables, the create-partial-info target now only needs an ONLINEUPDATE_MAR_OLDMSI make variable. TODO: There are two issues when comparing the content of msi files (extracted with msiexec /a), which the old code comparing the content of archives had tried to somewhat (but not fully) address with the metadata files that I had invented (and now reverted): For one, msiexec /a also extracts content that would normally be installed somewhere else in the system (e.g., it extracts Fonts, System, and System64 directories). Differences in those directories will cause a MAR update to create those directories in the installation directory, rather than to update the corresponding files in their actual locations. For another, optional components are not recognized as such, but their content must be added to the MAR file as add/patch-if, not as plain add/patch. To work around that, for now *all* files are added as add/patch-if, conditional on the files themselves. Thus, addition of files will cause a MAR update to miss them. (As they now exclusively operate on msi files, the create-update-info and create-partial-info targets are no longer meaningful for non-Windows platforms, so drop the non-Windows bin/update/create_full_mar_for_languages.py part.) Change-Id: Ifb55b5e7d1a201b4f50a27cb449a634b96c2e29b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162399 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-22 04:49:45 -06:00
@@ -112,9 +112,10 @@
fi
workdir="$(mktemp -d)"
updatemanifestv3="$workdir/updatev3.manifest"
-archivefiles="updatev3.manifest"
mkdir -p "$workdir"
+
+printf 'updatev3.manifest\n' >"$workdir/files.txt"
# Generate a list of all files in the target directory.
pushd "$olddir"
Create MAR updates from msi rather than from archive ...as the former is more convenient for release engineering (see the discussion in the comments at <https://gerrit.libreoffice.org/c/core/+/162157/1#message-8d7ebbcc64a87ee8e4a073ae1a05e3b74f5a3d6a> "Also enable --with-package-format=archive for LibreOfficeWin64.conf"). Instead of ONLINEUPDATE_MAR_OLDARCHIVE and ONLINEUPDATE_MAR_OLDMETADATA make variables, the create-partial-info target now only needs an ONLINEUPDATE_MAR_OLDMSI make variable. TODO: There are two issues when comparing the content of msi files (extracted with msiexec /a), which the old code comparing the content of archives had tried to somewhat (but not fully) address with the metadata files that I had invented (and now reverted): For one, msiexec /a also extracts content that would normally be installed somewhere else in the system (e.g., it extracts Fonts, System, and System64 directories). Differences in those directories will cause a MAR update to create those directories in the installation directory, rather than to update the corresponding files in their actual locations. For another, optional components are not recognized as such, but their content must be added to the MAR file as add/patch-if, not as plain add/patch. To work around that, for now *all* files are added as add/patch-if, conditional on the files themselves. Thus, addition of files will cause a MAR update to miss them. (As they now exclusively operate on msi files, the create-update-info and create-partial-info targets are no longer meaningful for non-Windows platforms, so drop the non-Windows bin/update/create_full_mar_for_languages.py part.) Change-Id: Ifb55b5e7d1a201b4f50a27cb449a634b96c2e29b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162399 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-22 04:49:45 -06:00
@@ -135,7 +136,6 @@
if [ ! -f "precomplete" ]; then
if [ ! -f "Contents/Resources/precomplete" ]; then
notice "precomplete file is missing!"
- exit 1
fi
fi
Create MAR updates from msi rather than from archive ...as the former is more convenient for release engineering (see the discussion in the comments at <https://gerrit.libreoffice.org/c/core/+/162157/1#message-8d7ebbcc64a87ee8e4a073ae1a05e3b74f5a3d6a> "Also enable --with-package-format=archive for LibreOfficeWin64.conf"). Instead of ONLINEUPDATE_MAR_OLDARCHIVE and ONLINEUPDATE_MAR_OLDMETADATA make variables, the create-partial-info target now only needs an ONLINEUPDATE_MAR_OLDMSI make variable. TODO: There are two issues when comparing the content of msi files (extracted with msiexec /a), which the old code comparing the content of archives had tried to somewhat (but not fully) address with the metadata files that I had invented (and now reverted): For one, msiexec /a also extracts content that would normally be installed somewhere else in the system (e.g., it extracts Fonts, System, and System64 directories). Differences in those directories will cause a MAR update to create those directories in the installation directory, rather than to update the corresponding files in their actual locations. For another, optional components are not recognized as such, but their content must be added to the MAR file as add/patch-if, not as plain add/patch. To work around that, for now *all* files are added as add/patch-if, conditional on the files themselves. Thus, addition of files will cause a MAR update to miss them. (As they now exclusively operate on msi files, the create-update-info and create-partial-info targets are no longer meaningful for non-Windows platforms, so drop the non-Windows bin/update/create_full_mar_for_languages.py part.) Change-Id: Ifb55b5e7d1a201b4f50a27cb449a634b96c2e29b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162399 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-22 04:49:45 -06:00
@@ -170,7 +170,7 @@
$XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
copy_perm "$newdir/$f" "$workdir/$f"
make_add_if_not_instruction "$f" "$updatemanifestv3"
- archivefiles="$archivefiles \"$f\""
+ printf '%s\n' "$f" >>"$workdir/files.txt"
continue 1
fi
Create MAR updates from msi rather than from archive ...as the former is more convenient for release engineering (see the discussion in the comments at <https://gerrit.libreoffice.org/c/core/+/162157/1#message-8d7ebbcc64a87ee8e4a073ae1a05e3b74f5a3d6a> "Also enable --with-package-format=archive for LibreOfficeWin64.conf"). Instead of ONLINEUPDATE_MAR_OLDARCHIVE and ONLINEUPDATE_MAR_OLDMETADATA make variables, the create-partial-info target now only needs an ONLINEUPDATE_MAR_OLDMSI make variable. TODO: There are two issues when comparing the content of msi files (extracted with msiexec /a), which the old code comparing the content of archives had tried to somewhat (but not fully) address with the metadata files that I had invented (and now reverted): For one, msiexec /a also extracts content that would normally be installed somewhere else in the system (e.g., it extracts Fonts, System, and System64 directories). Differences in those directories will cause a MAR update to create those directories in the installation directory, rather than to update the corresponding files in their actual locations. For another, optional components are not recognized as such, but their content must be added to the MAR file as add/patch-if, not as plain add/patch. To work around that, for now *all* files are added as add/patch-if, conditional on the files themselves. Thus, addition of files will cause a MAR update to miss them. (As they now exclusively operate on msi files, the create-update-info and create-partial-info targets are no longer meaningful for non-Windows platforms, so drop the non-Windows bin/update/create_full_mar_for_languages.py part.) Change-Id: Ifb55b5e7d1a201b4f50a27cb449a634b96c2e29b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162399 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-22 04:49:45 -06:00
@@ -180,7 +180,7 @@
$XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
copy_perm "$newdir/$f" "$workdir/$f"
make_add_instruction "$f" "$updatemanifestv3" 1
- archivefiles="$archivefiles \"$f\""
+ printf '%s\n' "$f" >>"$workdir/files.txt"
continue 1
fi
Create MAR updates from msi rather than from archive ...as the former is more convenient for release engineering (see the discussion in the comments at <https://gerrit.libreoffice.org/c/core/+/162157/1#message-8d7ebbcc64a87ee8e4a073ae1a05e3b74f5a3d6a> "Also enable --with-package-format=archive for LibreOfficeWin64.conf"). Instead of ONLINEUPDATE_MAR_OLDARCHIVE and ONLINEUPDATE_MAR_OLDMETADATA make variables, the create-partial-info target now only needs an ONLINEUPDATE_MAR_OLDMSI make variable. TODO: There are two issues when comparing the content of msi files (extracted with msiexec /a), which the old code comparing the content of archives had tried to somewhat (but not fully) address with the metadata files that I had invented (and now reverted): For one, msiexec /a also extracts content that would normally be installed somewhere else in the system (e.g., it extracts Fonts, System, and System64 directories). Differences in those directories will cause a MAR update to create those directories in the installation directory, rather than to update the corresponding files in their actual locations. For another, optional components are not recognized as such, but their content must be added to the MAR file as add/patch-if, not as plain add/patch. To work around that, for now *all* files are added as add/patch-if, conditional on the files themselves. Thus, addition of files will cause a MAR update to miss them. (As they now exclusively operate on msi files, the create-update-info and create-partial-info targets are no longer meaningful for non-Windows platforms, so drop the non-Windows bin/update/create_full_mar_for_languages.py part.) Change-Id: Ifb55b5e7d1a201b4f50a27cb449a634b96c2e29b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162399 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-22 04:49:45 -06:00
@@ -227,11 +227,11 @@
make_patch_instruction "$f" "$updatemanifestv3"
mv -f "$patchfile" "$workdir/$f.patch"
rm -f "$workdir/$f"
- archivefiles="$archivefiles \"$f.patch\""
+ printf '%s\n' "$f.patch" >>"$workdir/files.txt"
else
make_add_instruction "$f" "$updatemanifestv3"
rm -f "$patchfile"
- archivefiles="$archivefiles \"$f\""
+ printf '%s\n' "$f" >>"$workdir/files.txt"
fi
fi
else
tdf#161292: Fix create-partial-info for newly added files 084c64982ef6187292fd73e6deaa4448e0b6f3de "Create MAR updates from msi rather than from archive" had patched make_add_instruction (in workdir/UnpackedTarball/onlineupdate/tools/update-packagin/common.sh) to unconditionally use add-if (with the file itself as test file) rather than plain add (because we can't reuse Mozilla's extension logic there to determine optional installation parts), and it noted in its commit message that "addition of files will cause a MAR update to miss them". Which turned out to be a problem with <https://update-mar.libreoffice.org/24.2.2.2/LibreOffice_24.2.2.2_Windows_X86_64_d56cc158d8a96260b836f100ef4b4ef25d6f1a01_from_bf759d854b5ab45b6ef0bfd22e51c6dc4fb8b882_partial.mar>, updating from 24.2.2.1 with instdir/program/python-core-3.8.18/ to 24.2.2.2 with instdir/program/python-core-3.8.19/: All the files in python-core-3.8.19 were recorded as add-if testing on themselves, so were never added. So a better approach is, for newly added files to make them add (so they get added unconditionally, even if they are part of some optional component that happens to not be installed; this hopefully won't cause further issues) instead of add-if. (Existing files that are added instead of patched still use add-if, though.) This does not address the create-update-info target for full mar updates (which is not used currently?), just the create-partial-info target. (The existing calls to make_add_instruction in the upstream Mozilla code already have a seemingly rotten mix of two-argument calls and calls with three arguments where the third argument is ignored, and would check for a fourth "forced" argument but which is never passed in. So avoid extending that mess further, and just replace this never-use-add-if call to make_add_instruction directly with that function's (accordingly tweaked) body.) Change-Id: Ib596f3aa72c3ab9f896b20f7d623bc574eb15fd8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168285 Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Tested-by: Jenkins
2024-05-31 03:35:06 -05:00
@@ -266,11 +266,12 @@
if check_for_add_if_not_update "$f"; then
make_add_if_not_instruction "$f" "$updatemanifestv3"
else
- make_add_instruction "$f" "$updatemanifestv3"
+ verbose_notice " add \"$f\""
+ echo "add \"$f\"" >> "$updatemanifestv3"
fi
- archivefiles="$archivefiles \"$f\""
+ printf '%s\n' "$f" >>"$workdir/files.txt"
done
notice ""
Create MAR updates from msi rather than from archive ...as the former is more convenient for release engineering (see the discussion in the comments at <https://gerrit.libreoffice.org/c/core/+/162157/1#message-8d7ebbcc64a87ee8e4a073ae1a05e3b74f5a3d6a> "Also enable --with-package-format=archive for LibreOfficeWin64.conf"). Instead of ONLINEUPDATE_MAR_OLDARCHIVE and ONLINEUPDATE_MAR_OLDMETADATA make variables, the create-partial-info target now only needs an ONLINEUPDATE_MAR_OLDMSI make variable. TODO: There are two issues when comparing the content of msi files (extracted with msiexec /a), which the old code comparing the content of archives had tried to somewhat (but not fully) address with the metadata files that I had invented (and now reverted): For one, msiexec /a also extracts content that would normally be installed somewhere else in the system (e.g., it extracts Fonts, System, and System64 directories). Differences in those directories will cause a MAR update to create those directories in the installation directory, rather than to update the corresponding files in their actual locations. For another, optional components are not recognized as such, but their content must be added to the MAR file as add/patch-if, not as plain add/patch. To work around that, for now *all* files are added as add/patch-if, conditional on the files themselves. Thus, addition of files will cause a MAR update to miss them. (As they now exclusively operate on msi files, the create-update-info and create-partial-info targets are no longer meaningful for non-Windows platforms, so drop the non-Windows bin/update/create_full_mar_for_languages.py part.) Change-Id: Ifb55b5e7d1a201b4f50a27cb449a634b96c2e29b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162399 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-22 04:49:45 -06:00
@@ -302,7 +302,7 @@
$XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
mar_command="$mar_command -C \"$workdir\" -c output.mar"
-eval "$mar_command $archivefiles"
+eval "$mar_command -f $workdir/files.txt"
mv -f "$workdir/output.mar" "$archive"
# cleanup