From edad71275757c50a8f662f48dcd6c818e7382258 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Tue, 30 Apr 2024 08:40:40 +0200 Subject: [PATCH] Update pacman --- pacman/0033-fixup-change-shebang.patch | 22 +++++++ .../0034-Revert-makepkg-bash-v4-compat.patch | 27 +++++++++ ...up-Set-fixed-paths-for-various-tools.patch | 22 +++++++ pacman/0036-fixup-Core-update.patch | 23 ++++++++ pacman/0037-Revert-More-debugging-info.patch | 58 +++++++++++++++++++ pacman/PKGBUILD | 23 ++++++-- 6 files changed, 171 insertions(+), 4 deletions(-) create mode 100644 pacman/0033-fixup-change-shebang.patch create mode 100644 pacman/0034-Revert-makepkg-bash-v4-compat.patch create mode 100644 pacman/0035-fixup-Set-fixed-paths-for-various-tools.patch create mode 100644 pacman/0036-fixup-Core-update.patch create mode 100644 pacman/0037-Revert-More-debugging-info.patch diff --git a/pacman/0033-fixup-change-shebang.patch b/pacman/0033-fixup-change-shebang.patch new file mode 100644 index 00000000..81af9d9c --- /dev/null +++ b/pacman/0033-fixup-change-shebang.patch @@ -0,0 +1,22 @@ +From fb822167d46322f4d1f00093f8a1e3ff1e2380a1 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sun, 28 Apr 2024 13:20:59 +0200 +Subject: [PATCH 33/N] fixup! change shebang + +--- + scripts/pacman-db-upgrade.sh.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/scripts/pacman-db-upgrade.sh.in b/scripts/pacman-db-upgrade.sh.in +index c1cb200..216dc25 100644 +--- a/scripts/pacman-db-upgrade.sh.in ++++ b/scripts/pacman-db-upgrade.sh.in +@@ -18,6 +18,8 @@ + # along with this program. If not, see . + # + ++set -e ++ + # Avoid creating world-unreadable files + umask 022 + diff --git a/pacman/0034-Revert-makepkg-bash-v4-compat.patch b/pacman/0034-Revert-makepkg-bash-v4-compat.patch new file mode 100644 index 00000000..3468e53c --- /dev/null +++ b/pacman/0034-Revert-makepkg-bash-v4-compat.patch @@ -0,0 +1,27 @@ +From 47d0b2bf45f2ce363e63f83f914b64218f35748b Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sun, 28 Apr 2024 13:22:39 +0200 +Subject: [PATCH 34/N] Revert "makepkg: bash v4 compat" + +This reverts commit 1fbb46db545fad72daab79d769f19a4ae4cea6e3. + +We are on bash v5 for a long time now + +See #29 +--- + scripts/makepkg.sh.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in +index a5728fa..1585982 100644 +--- a/scripts/makepkg.sh.in ++++ b/scripts/makepkg.sh.in +@@ -424,7 +424,7 @@ run_function() { + + $pkgfunc &>"$logpipe" + +- wait $teepid ++ wait -f $teepid + rm "$logpipe" + else + "$pkgfunc" diff --git a/pacman/0035-fixup-Set-fixed-paths-for-various-tools.patch b/pacman/0035-fixup-Set-fixed-paths-for-various-tools.patch new file mode 100644 index 00000000..58cc0474 --- /dev/null +++ b/pacman/0035-fixup-Set-fixed-paths-for-various-tools.patch @@ -0,0 +1,22 @@ +From 1f023f9f1f88c4201cbe46d5a2ae8e5aa95f723d Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sun, 28 Apr 2024 13:26:17 +0200 +Subject: [PATCH 35/N] fixup! Set fixed paths for various tools + +--- + scripts/pacman-key.sh.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in +index 50965a5..7be282a 100644 +--- a/scripts/pacman-key.sh.in ++++ b/scripts/pacman-key.sh.in +@@ -436,7 +436,7 @@ import_trustdb() { + local ret=0 + for importdir in "$@"; do + if [[ -f "${importdir}/trustdb.gpg" ]]; then +- /bin/gpg --homedir "${importdir}" --export-ownertrust | \ ++ /usr/bin/gpg --homedir "${importdir}" --export-ownertrust | \ + "${GPG_PACMAN[@]}" --import-ownertrust - + if (( PIPESTATUS )); then + error "$(gettext "%s could not be imported.")" "${importdir}/trustdb.gpg" diff --git a/pacman/0036-fixup-Core-update.patch b/pacman/0036-fixup-Core-update.patch new file mode 100644 index 00000000..33083a01 --- /dev/null +++ b/pacman/0036-fixup-Core-update.patch @@ -0,0 +1,23 @@ +From bfe70fa6232a6ada9ff23130a9020e36d718344c Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Tue, 30 Apr 2024 07:45:40 +0200 +Subject: [PATCH 36/N] fixup! Core update + +Fixes #39 +--- + lib/libalpm/package.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c +index 8f592ad..4feeaf1 100644 +--- a/lib/libalpm/package.c ++++ b/lib/libalpm/package.c +@@ -815,6 +815,8 @@ int SYMEXPORT alpm_pkg_is_core_package(const alpm_pkg_t *pkg) + strcmp(pkg->name, "mintty") == 0 || + strcmp(pkg->name, "msys2-runtime") == 0 || + strcmp(pkg->name, "msys2-runtime-devel") == 0 || ++ strncmp(pkg->name, "msys2-runtime-", ++ strlen("msys2-runtime-")) == 0 || + strcmp(pkg->name, "pacman") == 0 || + strcmp(pkg->name, "pacman-mirrors") == 0; + } diff --git a/pacman/0037-Revert-More-debugging-info.patch b/pacman/0037-Revert-More-debugging-info.patch new file mode 100644 index 00000000..0e98cba9 --- /dev/null +++ b/pacman/0037-Revert-More-debugging-info.patch @@ -0,0 +1,58 @@ +From 2ab815f2a9a57a7727e2947c78272a2a240e90d0 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Tue, 30 Apr 2024 07:47:20 +0200 +Subject: [PATCH 37/N] Revert "More debugging info" + +This reverts commit 235ea43e9a0d3d4a373a37970a62be8dfd32282b. + +See #29 +--- + lib/libalpm/util.c | 21 ++------------------- + 1 file changed, 2 insertions(+), 19 deletions(-) + +diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c +index ce28fd8..bdfb5c0 100644 +--- a/lib/libalpm/util.c ++++ b/lib/libalpm/util.c +@@ -306,23 +306,6 @@ int _alpm_unpack_single(alpm_handle_t *handle, const char *archive, + return ret; + } + +-char *get_command_line(const char* cmd, char *const argv[]) +-{ +- size_t len = strlen(cmd) + 1; +- size_t nargs = 0; +- while (argv[nargs] != NULL) { +- len += strlen(argv[nargs++]) + 1; +- } +- char *result = malloc(len) + 1; +- strcpy(result, cmd); +- strcat(result, " "); +- for (size_t arg = 0; arg < nargs; ++arg) { +- strcat(result, argv[arg]); +- strcat(result, " "); +- } +- return result; +-} +- + /** Unpack a list of files in an archive. + * @param handle the context handle + * @param path the archive to unpack +@@ -706,7 +689,7 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[], + _alpm_reset_signals(); + execv(cmd, argv); + /* execv only returns if there was an error */ +- fprintf(stderr, _("call to execv (%s) failed (%s)\n"), get_command_line(cmd, argv), strerror(errno)); ++ fprintf(stderr, _("call to execv failed (%s)\n"), strerror(errno)); + exit(1); + } else { + /* this code runs for the parent only (wait on the child) */ +@@ -795,7 +778,7 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[], + if(WIFEXITED(status)) { + _alpm_log(handle, ALPM_LOG_DEBUG, "call to waitpid succeeded\n"); + if(WEXITSTATUS(status) != 0) { +- _alpm_log(handle, ALPM_LOG_ERROR, _("command (%s) failed to execute correctly\n"), get_command_line(cmd, argv)); ++ _alpm_log(handle, ALPM_LOG_ERROR, _("command failed to execute correctly\n")); + retval = 1; + } + } else if(WIFSIGNALED(status) != 0) { diff --git a/pacman/PKGBUILD b/pacman/PKGBUILD index a09e65f2..a60f285b 100644 --- a/pacman/PKGBUILD +++ b/pacman/PKGBUILD @@ -4,7 +4,7 @@ pkgname=pacman pkgver=6.0.2 -pkgrel=14 +pkgrel=15 pkgdesc="A library-based package manager with dependency support (MSYS2 port)" arch=('i686' 'x86_64') url="https://www.archlinux.org/pacman/" @@ -77,7 +77,12 @@ source=(pacman-${pkgver}::git+https://gitlab.archlinux.org/pacman/pacman.git#com 0029-Fix-building-staticlibs-with-LTO.patch 0030-Make-lint_pkgbuild-opt-in-via-MAKEPKG_LINT_PKGBUILD-.patch 0031-libmakepkg-fix-compatibility-with-bash-5.2-patsub_re.patch - 0032-pacman-key-pass-allow-weak-key-signatures-during-imp.patch) + 0032-pacman-key-pass-allow-weak-key-signatures-during-imp.patch + 0033-fixup-change-shebang.patch + 0034-Revert-makepkg-bash-v4-compat.patch + 0035-fixup-Set-fixed-paths-for-various-tools.patch + 0036-fixup-Core-update.patch + 0037-Revert-More-debugging-info.patch) validpgpkeys=('6645B0A8C7005E78DB1D7864F99FFE0FEAE999BD' # Allan McRae 'B8151B117037781095514CA7BBDFFC92306B1121') # Andrew Gregory (pacman) sha256sums=('SKIP' @@ -116,7 +121,12 @@ sha256sums=('SKIP' '80796220c074856f55a63d4ef576f5b5d45cfa4fdc5701b5c7f384e5d92d72bd' '7b8588bb8ac9c2c74bc5b537e3e17ea90c81d8cf70ea2bd8ff48e3583c24d67f' 'c5cd177455d2f403f1d7d6dc7f9d19925c8b7662f1984ed9eae91af0f49697b2' - 'a2a77d0f37133874b4ee2636569afccebcc1b972833b215cd9c756a4c202ea30') + 'a2a77d0f37133874b4ee2636569afccebcc1b972833b215cd9c756a4c202ea30' + 'cf8c23f0885d433bb6970b3e736355b568a983f261ec30ee8f6bf0cea426e801' + '6f320e2ae6e0e933f19c36def4da94770c1aa6a2f677fd7d7afb05d5489dca06' + 'ab7871829523a91f158490768c82ed5748e1513c8496db42669261fe36bd47e4' + '8df6d95de570474fd43fa77c54ee2d2feaeafa896ff90f9fe88129fa321cad62' + '99e64232f5ad85a9331e21a7c07b32b92bf99658a2274cf13c30ee080d60f1b9') apply_git_with_msg() { for _patch in "$@" @@ -164,7 +174,12 @@ prepare() { 0029-Fix-building-staticlibs-with-LTO.patch \ 0030-Make-lint_pkgbuild-opt-in-via-MAKEPKG_LINT_PKGBUILD-.patch \ 0031-libmakepkg-fix-compatibility-with-bash-5.2-patsub_re.patch \ - 0032-pacman-key-pass-allow-weak-key-signatures-during-imp.patch + 0032-pacman-key-pass-allow-weak-key-signatures-during-imp.patch \ + 0033-fixup-change-shebang.patch \ + 0034-Revert-makepkg-bash-v4-compat.patch \ + 0035-fixup-Set-fixed-paths-for-various-tools.patch \ + 0036-fixup-Core-update.patch \ + 0037-Revert-More-debugging-info.patch } build() {