office-gobmx/external/onlineupdate/lo.patch

388 lines
13 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;
}
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
@@ -76,6 +76,15 @@
forced=
fi
+ if [ -n "$IFSFILE" ]; then
+ ifsline=$(grep -F " \"$f\"" "$IFSFILE")
+ if [ -n "$ifsline" ]; then
+ testfile=$(printf '%s' "$ifsline" | cut -f 2 -d '"')
+ verbose_notice " add-if \"$testfile\" \"$f\""
+ echo "add-if \"$testfile\" \"$f\"" >> "$filev3"
+ return
+ fi
+ fi
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
@@ -113,6 +122,15 @@
f="$1"
filev3="$2"
+ if [ -n "$IFSFILE" ]; then
+ ifsline=$(grep -F " \"$f\"" "$IFSFILE")
+ if [ -n "$ifsline" ]; then
+ testfile=$(printf '%s' "$ifsline" | cut -f 2 -d '"')
+ verbose_notice " patch-if \"$testfile\" \"$f.patch\" \"$f\""
+ echo "patch-if \"$testfile\" \"$f.patch\" \"$f\"" >> "$filev3"
+ return
+ fi
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
+ fi
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
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
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
@@ -45,6 +45,7 @@
archive="$1"
targetdir="$2"
+IFSFILE=$3
# Prevent the workdir from being inside the targetdir so it isn't included in
# the update mar.
if [ $(echo "$targetdir" | grep -c '\/$') = 1 ]; then
@@ -53,9 +54,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"
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
@@ -66,7 +68,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
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
@@ -99,7 +100,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.
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
@@ -110,7 +111,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
@@ -104,6 +104,7 @@
archive="$1"
olddir="$2"
newdir="$3"
+IFSFILE=$4
# Prevent the workdir from being inside the targetdir so it isn't included in
# the update mar.
if [ $(echo "$newdir" | grep -c '\/$') = 1 ]; then
@@ -112,9 +113,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"
@@ -135,7 +137,6 @@
if [ ! -f "precomplete" ]; then
if [ ! -f "Contents/Resources/precomplete" ]; then
notice "precomplete file is missing!"
- exit 1
fi
fi
@@ -170,7 +171,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
@@ -180,7 +181,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
@@ -227,11 +228,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
@@ -270,7 +271,7 @@
fi
- archivefiles="$archivefiles \"$f\""
+ printf '%s\n' "$f" >>"$workdir/files.txt"
done
notice ""
@@ -302,7 +303,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