diff --git a/pacman/0000-pacman-msysize.patch b/pacman/0001-Msysize.patch similarity index 80% rename from pacman/0000-pacman-msysize.patch rename to pacman/0001-Msysize.patch index 35b60dd4..50665b38 100644 --- a/pacman/0000-pacman-msysize.patch +++ b/pacman/0001-Msysize.patch @@ -1,26 +1,51 @@ -diff -Naur pacman-5.1.0-orig/lib/libalpm/add.c pacman-5.1.0/lib/libalpm/add.c ---- pacman-5.1.0-orig/lib/libalpm/add.c 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/lib/libalpm/add.c 2018-06-21 12:53:58.832056200 +0300 -@@ -261,6 +261,7 @@ +From 91067406c454929239a5eebf043ed2eb0a485762 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 21 May 2021 22:47:29 +0200 +Subject: [PATCH 01/N] Msysize + +--- + lib/libalpm/add.c | 2 + + .../lint_package/build_references.sh.in | 8 + + scripts/libmakepkg/tidy/staticlibs.sh.in | 4 +- + scripts/libmakepkg/tidy/strip.sh.in | 167 ++++++++++++----- + scripts/libmakepkg/utils_fixed_path.sh.in | 34 ++++ + scripts/makepkg.sh.in | 177 +++++++----------- + scripts/pacman-db-upgrade.sh.in | 12 +- + scripts/pacman-key.sh.in | 22 +-- + scripts/repo-add.sh.in | 11 +- + scripts/wrapper.sh.in | 2 +- + src/pacman/callback.c | 7 +- + src/pacman/check.c | 2 + + src/pacman/pacman.c | 4 + + test/pacman/pmtest.py | 19 +- + 14 files changed, 275 insertions(+), 196 deletions(-) + create mode 100644 scripts/libmakepkg/utils_fixed_path.sh.in + +diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c +index f84e96a..1e330ca 100644 +--- a/lib/libalpm/add.c ++++ b/lib/libalpm/add.c +@@ -266,6 +266,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, "filesystem: %o package: %o\n", filename, lsbuf.st_mode & mask, entrymode & mask); } +#ifndef __MSYS__ - + #if 0 /* Disable this warning until our user management in packages has improved. -@@ -278,6 +279,7 @@ +@@ -283,6 +284,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, } #endif - + +#endif _alpm_log(handle, ALPM_LOG_DEBUG, "extract: skipping dir extraction of %s\n", filename); archive_read_data_skip(archive); -diff -Naur pacman-5.1.0-orig/scripts/libmakepkg/lint_package/build_references.sh.in pacman-5.1.0/scripts/libmakepkg/lint_package/build_references.sh.in ---- pacman-5.1.0-orig/scripts/libmakepkg/lint_package/build_references.sh.in 2018-03-18 05:51:17.000000000 +0300 -+++ pacman-5.1.0/scripts/libmakepkg/lint_package/build_references.sh.in 2018-06-21 13:23:05.248501400 +0300 -@@ -37,5 +37,13 @@ +diff --git a/scripts/libmakepkg/lint_package/build_references.sh.in b/scripts/libmakepkg/lint_package/build_references.sh.in +index bcaf71c..a897adc 100644 +--- a/scripts/libmakepkg/lint_package/build_references.sh.in ++++ b/scripts/libmakepkg/lint_package/build_references.sh.in +@@ -37,5 +37,13 @@ warn_build_references() { printf '%s\n' "${refs[@]#"$pkgdir/"}" >&2 fi done @@ -34,10 +59,11 @@ diff -Naur pacman-5.1.0-orig/scripts/libmakepkg/lint_package/build_references.sh + fi return 0 } -diff -Naur pacman-5.1.0-orig/scripts/libmakepkg/tidy/staticlibs.sh.in pacman-5.1.0/scripts/libmakepkg/tidy/staticlibs.sh.in ---- pacman-5.1.0-orig/scripts/libmakepkg/tidy/staticlibs.sh.in 2018-03-18 05:51:17.000000000 +0300 -+++ pacman-5.1.0/scripts/libmakepkg/tidy/staticlibs.sh.in 2018-06-21 12:53:58.862056200 +0300 -@@ -35,9 +35,9 @@ +diff --git a/scripts/libmakepkg/tidy/staticlibs.sh.in b/scripts/libmakepkg/tidy/staticlibs.sh.in +index 7993c09..a685efe 100644 +--- a/scripts/libmakepkg/tidy/staticlibs.sh.in ++++ b/scripts/libmakepkg/tidy/staticlibs.sh.in +@@ -35,9 +35,9 @@ tidy_staticlibs() { msg2 "$(gettext "Removing static library files...")" local l while IFS= read -rd '' l; do @@ -49,13 +75,14 @@ diff -Naur pacman-5.1.0-orig/scripts/libmakepkg/tidy/staticlibs.sh.in pacman-5.1 + done < <(find . ! -type d \( -name "*.a" ! -name "*.dll.a" \) -print0) fi } -diff -Naur pacman-5.1.0-orig/scripts/libmakepkg/tidy/strip.sh.in pacman-5.1.0/scripts/libmakepkg/tidy/strip.sh.in ---- pacman-5.1.0-orig/scripts/libmakepkg/tidy/strip.sh.in 2018-05-12 16:15:04.000000000 +0300 -+++ pacman-5.1.0/scripts/libmakepkg/tidy/strip.sh.in 2018-06-21 13:31:44.509228300 +0300 -@@ -31,10 +31,6 @@ +diff --git a/scripts/libmakepkg/tidy/strip.sh.in b/scripts/libmakepkg/tidy/strip.sh.in +index b04426c..4cc9db6 100644 +--- a/scripts/libmakepkg/tidy/strip.sh.in ++++ b/scripts/libmakepkg/tidy/strip.sh.in +@@ -31,10 +31,6 @@ packaging_options+=('strip' 'debug') tidy_modify+=('tidy_strip') - - + + -build_id() { - LANG=C readelf -n "$1" | sed -n '/Build ID/ { s/.*: //p; q; }' -} @@ -63,10 +90,10 @@ diff -Naur pacman-5.1.0-orig/scripts/libmakepkg/tidy/strip.sh.in pacman-5.1.0/sc source_files() { LANG=C readelf "$1" --debug-dump | \ awk '/DW_AT_name +:/{name=$8}/DW_AT_comp_dir +:/{{if (name == "") next}{if (name !~ /^[<\/]/) {printf "%s/", $8}}{print name}}' -@@ -43,55 +39,57 @@ +@@ -43,55 +39,57 @@ source_files() { strip_file() { local binary=$1; shift - + - if check_option "debug" "y"; then - local bid=$(build_id "$binary") - @@ -82,7 +109,7 @@ diff -Naur pacman-5.1.0-orig/scripts/libmakepkg/tidy/strip.sh.in pacman-5.1.0/sc - elif [[ -f "$dbgdir/$binary.debug" ]]; then - return - fi -- + - # copy source files to debug directory - local file dest t - while IFS= read -r t; do @@ -115,9 +142,6 @@ diff -Naur pacman-5.1.0-orig/scripts/libmakepkg/tidy/strip.sh.in pacman-5.1.0/sc - target="${target/..\/..\/usr\/lib\/}" - target="${target/..\/usr\/}" - ln -s "$target" "$dbgdir/.build-id/${bid:0:2}/${bid:2}" - -- target="../../${binary#./}.debug" -- ln -s "$target" "$dbgdir/.build-id/${bid:0:2}/${bid:2}.debug" + # copy source files to debug directory + local file dest t + while IFS= read -r t; do @@ -158,25 +182,27 @@ diff -Naur pacman-5.1.0-orig/scripts/libmakepkg/tidy/strip.sh.in pacman-5.1.0/sc + ln "$dbgdir/${binary}.debug" "$dbgdir/${file}.debug" + fi + done < <(find . -type f -perm -u+w -print0 2>/dev/null) -+ + +- target="../../${binary#./}.debug" +- ln -s "$target" "$dbgdir/.build-id/${bid:0:2}/${bid:2}.debug" fi - fi + ;; + esac - + strip $@ "$binary" } -@@ -103,15 +101,84 @@ - +@@ -106,15 +104,84 @@ tidy_strip() { + if check_option "debug" "y"; then - + - dbgdir="$pkgdirbase/$pkgbase-@DEBUGSUFFIX@/usr/lib/debug" + dbgdir="$pkgdirbase/$pkgbase-@DEBUGSUFFIX@" dbgsrcdir="${DBGSRCDIR:-/usr/src/debug}" dbgsrc="$pkgdirbase/$pkgbase-@DEBUGSUFFIX@$dbgsrcdir" mkdir -p "$dbgdir" "$dbgsrc" fi - + local binary strip_flags - find . -type f -perm -u+w -print0 2>/dev/null | while IFS= read -rd '' binary ; do + # *.so: Apache2 modules, OCaml stublibs, Ruby modules @@ -253,9 +279,11 @@ diff -Naur pacman-5.1.0-orig/scripts/libmakepkg/tidy/strip.sh.in pacman-5.1.0/sc *application/x-sharedlib*) # Libraries (.so) strip_flags="$STRIP_SHARED";; *application/x-archive*) # Libraries (.a) -diff -Naur pacman-5.1.0-orig/scripts/libmakepkg/utils_fixed_path.sh.in pacman-5.1.0/scripts/libmakepkg/utils_fixed_path.sh.in ---- pacman-5.1.0-orig/scripts/libmakepkg/utils_fixed_path.sh.in 1970-01-01 03:00:00.000000000 +0300 -+++ pacman-5.1.0/scripts/libmakepkg/utils_fixed_path.sh.in 2018-06-21 12:53:58.872056200 +0300 +diff --git a/scripts/libmakepkg/utils_fixed_path.sh.in b/scripts/libmakepkg/utils_fixed_path.sh.in +new file mode 100644 +index 0000000..e3a06bc +--- /dev/null ++++ b/scripts/libmakepkg/utils_fixed_path.sh.in @@ -0,0 +1,34 @@ +if [[ -n "$MSYSTEM" ]]; then + readonly -a UTILS_NAME=('bsdtar' @@ -291,9 +319,10 @@ diff -Naur pacman-5.1.0-orig/scripts/libmakepkg/utils_fixed_path.sh.in pacman-5. + }' + done +fi -diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg.sh.in ---- pacman-5.1.0-orig/scripts/makepkg.sh.in 2018-05-23 08:27:19.000000000 +0300 -+++ pacman-5.1.0/scripts/makepkg.sh.in 2018-06-21 13:21:37.158378000 +0300 +diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in +index c9e381d..86616de 100644 +--- a/scripts/makepkg.sh.in ++++ b/scripts/makepkg.sh.in @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash @@ -301,15 +330,15 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. # makepkg - make packages compatible for use with pacman # @configure_input@ @@ -27,7 +27,7 @@ - + # makepkg uses quite a few external programs during its execution. You # need to have at least the following installed for makepkg to function: -# awk, bsdtar (libarchive), bzip2, coreutils, fakeroot, file, find (findutils), +# awk, bsdtar (libarchive), bzip2, coreutils, file, find (findutils), # gettext, gpg, grep, gzip, sed, tput (ncurses), xz - + # gettext initialization -@@ -60,7 +60,6 @@ +@@ -60,7 +60,6 @@ FORCE=0 GENINTEG=0 HOLDVER=0 IGNOREARCH=0 @@ -317,10 +346,10 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. INSTALL=0 LOGGING=0 NEEDED=0 -@@ -106,10 +105,9 @@ +@@ -106,10 +105,9 @@ done trap_exit() { local signal=$1; shift - + - if (( ! INFAKEROOT )); then - echo - error "$@" @@ -329,12 +358,12 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. + error "$@" + [[ -n $srclinks ]] && rm -rf "$srclinks" - + # unset the trap for this signal, and then call the default handler -@@ -124,11 +122,6 @@ +@@ -124,11 +122,6 @@ trap_exit() { clean_up() { local EXIT_CODE=$? - + - if (( INFAKEROOT )); then - # Don't clean up when leaving fakeroot, we're not done yet. - return 0 @@ -343,8 +372,8 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. if [[ -p $logpipe ]]; then rm "$logpipe" fi -@@ -138,7 +131,7 @@ - +@@ -138,7 +131,7 @@ clean_up() { + # If it's a clean exit and -c/--clean has been passed... msg "$(gettext "Cleaning up...")" - rm -rf "$pkgdirbase" "$srcdir" @@ -352,10 +381,10 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. if [[ -n $pkgbase ]]; then local fullver=$(get_full_version) # Can't do this unless the BUILDSCRIPT has been sourced. -@@ -180,11 +173,6 @@ +@@ -180,11 +173,6 @@ clean_up() { fi } - + -enter_fakeroot() { - msg "$(gettext "Entering %s environment...")" "fakeroot" - fakeroot -- bash -$- "${BASH_SOURCE[0]}" -F "${ARGLIST[@]}" || exit $? @@ -364,7 +393,7 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. # Automatically update pkgver variable if a pkgver() function is provided # Re-sources the PKGBUILD afterwards to allow for other variables that use $pkgver update_pkgver() { -@@ -229,11 +217,6 @@ +@@ -229,11 +217,6 @@ run_pacman() { cmd=("$PACMAN_PATH" "$@") else cmd=("$PACMAN_PATH" "${PACMAN_OPTS[@]}" "$@") @@ -376,17 +405,17 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. local lockfile="$(pacman-conf DBPath)/db.lck" while [[ -f $lockfile ]]; do local timer=0 -@@ -432,7 +415,7 @@ - +@@ -432,7 +415,7 @@ run_function() { + $pkgfunc &>"$logpipe" - + - wait -f $teepid + wait $teepid rm "$logpipe" else "$pkgfunc" -@@ -460,7 +443,7 @@ - +@@ -460,7 +443,7 @@ find_libdepends() { + sodepends=0 for d in "${depends[@]}"; do - if [[ $d = *.so ]]; then @@ -394,14 +423,14 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. sodepends=1 break fi -@@ -471,28 +454,33 @@ +@@ -471,28 +454,33 @@ find_libdepends() { return 0 fi - + - local libdeps filename soarch sofile soname soversion + local libdeps filename soarch sofile soname declare -A libdeps - + while IFS= read -rd '' filename; do - # get architecture of the file; if soarch is empty it's not an ELF binary - soarch=$(LC_ALL=C readelf -h "$filename" 2>/dev/null | sed -n 's/.*Class.*ELF\(32\|64\)/\1/p') @@ -416,7 +445,7 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. + soarch=x86_64 + ;; + esac - + # process all libraries needed by the binary - for sofile in $(LC_ALL=C readelf -d "$filename" 2>/dev/null | sed -nr 's/.*Shared library: \[(.*)\].*/\1/p') + for sofile in $(LC_ALL=C objdump -x "$filename" 2>/dev/null | sed -nr 's/.*DLL Name: (.*).*/\1/p') @@ -426,7 +455,7 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. - # extract the major version: 1 - soversion="${sofile##*\.so\.}" + soname=${sofile} - + if [[ ${libdeps[$soname]} ]]; then - if [[ ${libdeps[$soname]} != *${soversion}-${soarch}* ]]; then - libdeps[$soname]+=" ${soversion}-${soarch}" @@ -439,7 +468,7 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. fi done done < <(find "$pkgdir" -type f -perm -u+x -print0) -@@ -500,7 +488,7 @@ +@@ -500,7 +488,7 @@ find_libdepends() { local libdepends v for d in "${depends[@]}"; do case "$d" in @@ -448,7 +477,7 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. if [[ ${libdeps[$d]} ]]; then for v in ${libdeps[$d]}; do libdepends+=("$d=$v") -@@ -525,32 +513,23 @@ +@@ -525,32 +513,23 @@ find_libprovides() { for p in "${provides[@]}"; do missing=0 case "$p" in @@ -495,25 +524,25 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. done else libprovides+=("$p") -@@ -589,7 +568,6 @@ +@@ -589,7 +568,6 @@ write_pkginfo() { merge_arch_attrs - + printf "# Generated by makepkg %s\n" "$makepkg_version" - printf "# using %s\n" "$(fakeroot -v)" - + write_kv_pair "pkgname" "$pkgname" write_kv_pair "pkgbase" "$pkgbase" -@@ -739,7 +717,7 @@ +@@ -739,7 +717,7 @@ create_debug_package() { local pkgdir="$pkgdirbase/$pkgbase-@DEBUGSUFFIX@" - + # check if we have any debug symbols to package - if dir_is_empty "$pkgdir/usr/lib/debug"; then + if dir_is_empty "$pkgdir"; then return 0 fi - -@@ -924,6 +902,11 @@ - + +@@ -928,6 +906,11 @@ restore_package_variables() { + run_single_packaging() { local pkgdir="$pkgdirbase/$pkgname" + # clean existing pkg directory @@ -524,7 +553,7 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. mkdir "$pkgdir" if [[ -n $1 ]] || (( PKGFUNC )); then run_package $1 -@@ -1017,12 +1000,16 @@ +@@ -1021,12 +1004,16 @@ if ! type -p gettext >/dev/null; then gettext() { printf "%s\n" "$@" } @@ -533,16 +562,16 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. + /usr/bin/gettext "$@" + } fi - + ARGLIST=("$@") - + # Parse Command Line Options. -OPT_SHORT="AcCdefFghiLmop:rRsSV" +OPT_SHORT="AcCdefghiLmop:rRsSV" OPT_LONG=('allsource' 'check' 'clean' 'cleanbuild' 'config:' 'force' 'geninteg' 'help' 'holdver' 'ignorearch' 'install' 'key:' 'log' 'noarchive' 'nobuild' 'nocolor' 'nocheck' 'nodeps' 'noextract' 'noprepare' 'nosign' 'packagelist' -@@ -1056,7 +1043,6 @@ +@@ -1060,7 +1047,6 @@ while true; do -d|--nodeps) NODEPS=1 ;; -e|--noextract) NOEXTRACT=1 ;; -f|--force) FORCE=1 ;; @@ -550,10 +579,10 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. # generating integrity checks does not depend on architecture -g|--geninteg) BUILDPKG=0 GENINTEG=1 IGNOREARCH=1;; --holdver) HOLDVER=1 ;; -@@ -1171,19 +1157,6 @@ +@@ -1175,19 +1161,6 @@ if (( LOGGING )) && ! ensure_writable_dir "LOGDEST" "$LOGDEST"; then exit $E_FS_PERMISSIONS fi - + -if (( ! INFAKEROOT )); then - if (( EUID == 0 )); then - error "$(gettext "Running %s as root is not allowed as it can cause permanent,\n\ @@ -570,10 +599,10 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. unset pkgname "${pkgbuild_schema_strings[@]}" "${pkgbuild_schema_arrays[@]}" unset "${known_hash_algos[@]/%/sums}" unset -f pkgver prepare build check package "${!package_@}" -@@ -1304,29 +1277,6 @@ +@@ -1308,29 +1281,6 @@ if (( ! PKGVERFUNC )); then check_build_status fi - + -# Run the bare minimum in fakeroot -if (( INFAKEROOT )); then - if (( SOURCEONLY )); then @@ -598,31 +627,31 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. -fi - msg "$(gettext "Making package: %s")" "$pkgbase $basever ($(date +%c))" - + # if we are creating a source-only package, go no further -@@ -1350,7 +1300,7 @@ +@@ -1354,7 +1304,7 @@ if (( SOURCEONLY )); then check_source_integrity all cd_safe "$startdir" - + - enter_fakeroot + create_srcpackage - + if [[ $SIGNPKG = 'y' ]]; then msg "$(gettext "Signing package...")" -@@ -1400,6 +1350,9 @@ +@@ -1404,6 +1354,9 @@ mkdir -p "$srcdir" chmod a-s "$srcdir" cd_safe "$srcdir" - + +export MINGW_CHOST MINGW_PREFIX MINGW_PACKAGE_PREFIX +export DXSDK_DIR ACLOCAL_PATH PKG_CONFIG_PATH + if (( !REPKG )); then if (( NOEXTRACT && ! VERIFYSOURCE )); then warning "$(gettext "Using existing %s tree")" "\$srcdir/" -@@ -1452,17 +1405,25 @@ +@@ -1456,17 +1409,25 @@ else cd_safe "$startdir" fi - + - enter_fakeroot + # if inhibiting archive creation, go no further + if (( NOARCHIVE )); then @@ -639,10 +668,10 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. + fi + + create_debug_package - + create_package_signatures || exit $E_PRETTY_BAD_PRIVACY fi - + -# if inhibiting archive creation, go no further -if (( NOARCHIVE )); then - msg "$(gettext "Package directory is ready.")" @@ -650,20 +679,21 @@ diff -Naur pacman-5.1.0-orig/scripts/makepkg.sh.in pacman-5.1.0/scripts/makepkg. -fi - msg "$(gettext "Finished making: %s")" "$pkgbase $basever ($(date +%c))" - + install_package && exit $E_OK || exit $E_INSTALL_FAILED -diff -Naur pacman-5.1.0-orig/scripts/pacman-db-upgrade.sh.in pacman-5.1.0/scripts/pacman-db-upgrade.sh.in ---- pacman-5.1.0-orig/scripts/pacman-db-upgrade.sh.in 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/scripts/pacman-db-upgrade.sh.in 2018-06-21 12:53:58.892056200 +0300 +diff --git a/scripts/pacman-db-upgrade.sh.in b/scripts/pacman-db-upgrade.sh.in +index af3b17c..d3e2e13 100644 +--- a/scripts/pacman-db-upgrade.sh.in ++++ b/scripts/pacman-db-upgrade.sh.in @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash # # pacman-db-upgrade - upgrade the local pacman db to a newer format # @configure_input@ -@@ -79,9 +79,13 @@ +@@ -79,9 +79,13 @@ resolve_dir() { # PROGRAM START - + # determine whether we have gettext; make it a no-op if we do not -if ! type gettext &>/dev/null; then +if ! type -p gettext >/dev/null; then @@ -676,9 +706,9 @@ diff -Naur pacman-5.1.0-orig/scripts/pacman-db-upgrade.sh.in pacman-5.1.0/script + /usr/bin/gettext "$@" } fi - -@@ -133,7 +137,7 @@ - + +@@ -138,7 +142,7 @@ lockfile="${dbroot}/db.lck" + # make sure pacman isn't running if [[ -f $lockfile ]]; then - die "$(gettext "Pacman lock file was found. Cannot run while pacman is running.")" @@ -686,33 +716,34 @@ diff -Naur pacman-5.1.0-orig/scripts/pacman-db-upgrade.sh.in pacman-5.1.0/script fi # do not let pacman run while we do this touch "$lockfile" -diff -Naur pacman-5.1.0-orig/scripts/pacman-key.sh.in pacman-5.1.0/scripts/pacman-key.sh.in ---- pacman-5.1.0-orig/scripts/pacman-key.sh.in 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/scripts/pacman-key.sh.in 2018-06-21 12:53:58.902056300 +0300 +diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in +index 3962a57..1bdc5d7 100644 +--- a/scripts/pacman-key.sh.in ++++ b/scripts/pacman-key.sh.in @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # pacman-key - manages pacman's keyring # Based on apt-key, from Debian -@@ -31,6 +31,7 @@ +@@ -31,6 +31,7 @@ LIBRARY=${LIBRARY:-'@libmakepkgdir@'} # Import libmakepkg source "$LIBRARY"/util/message.sh source "$LIBRARY"/util/parseopts.sh +source "$LIBRARY"/utils_fixed_path.sh - + # Options ADD=0 -@@ -231,7 +233,7 @@ +@@ -237,7 +238,7 @@ check_keyring() { exit 1 fi - + - if (( (EXPORT || FINGER || LIST || VERIFY) && EUID != 0 )); then + if (( EXPORT || FINGER || LIST || VERIFY )); then if ! grep -q "^[[:space:]]*lock-never[[:space:]]*$" ${PACMAN_KEYRING_DIR}/gpg.conf &>/dev/null; then error "$(gettext "You do not have sufficient permissions to run this command.")" msg "$(gettext "Use '%s' to correct the keyring permissions.")" "pacman-key --init" -@@ -384,7 +386,7 @@ +@@ -390,7 +391,7 @@ import_trustdb() { local ret=0 for importdir in "$@"; do if [[ -f "${importdir}/trustdb.gpg" ]]; then @@ -721,28 +752,28 @@ diff -Naur pacman-5.1.0-orig/scripts/pacman-key.sh.in pacman-5.1.0/scripts/pacma "${GPG_PACMAN[@]}" --import-ownertrust - if (( PIPESTATUS )); then error "$(gettext "%s could not be imported.")" "${importdir}/trustdb.gpg" -@@ -508,10 +510,14 @@ +@@ -530,10 +531,14 @@ updatedb() { fi } - + -# PROGRAM START -if ! type gettext &>/dev/null; then +# determine whether we have gettext; make it a no-op if we do not +if ! type -p gettext >/dev/null; then -+ gettext() { + gettext() { +- echo "$@" + printf "%s\n" "$@" + } +else - gettext() { -- echo "$@" ++ gettext() { + /usr/bin/gettext "$@" } fi - -@@ -569,11 +575,6 @@ + +@@ -596,11 +601,6 @@ if ! type -p gpg >/dev/null; then exit 1 fi - + -if (( (ADD || DELETE || EDITKEY || IMPORT || IMPORT_TRUSTDB || INIT || LSIGNKEY || POPULATE || RECEIVE || REFRESH || UPDATEDB) && EUID != 0 )); then - error "$(gettext "%s needs to be run as root for this operation.")" "pacman-key" - exit 1 @@ -751,26 +782,27 @@ diff -Naur pacman-5.1.0-orig/scripts/pacman-key.sh.in pacman-5.1.0/scripts/pacma CONFIG=${CONFIG:-@sysconfdir@/pacman.conf} if [[ ! -r "${CONFIG}" ]]; then error "$(gettext "%s configuration file '%s' not found.")" "pacman" "$CONFIG" -diff -Naur pacman-5.1.0-orig/scripts/repo-add.sh.in pacman-5.1.0/scripts/repo-add.sh.in ---- pacman-5.1.0-orig/scripts/repo-add.sh.in 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/scripts/repo-add.sh.in 2018-06-21 12:53:58.902056300 +0300 +diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in +index b0b3505..d8a539e 100644 +--- a/scripts/repo-add.sh.in ++++ b/scripts/repo-add.sh.in @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # repo-add - add a package to a given repo database file # repo-remove - remove a package entry from a given repo database file -@@ -46,6 +46,7 @@ - +@@ -46,6 +46,7 @@ PREVENT_DOWNGRADE=0 + # Import libmakepkg source "$LIBRARY"/util/message.sh +source "$LIBRARY"/utils_fixed_path.sh - + # ensure we have a sane umask set umask 0022 -@@ -707,9 +708,13 @@ +@@ -571,9 +572,13 @@ clean_up() { # PROGRAM START - + # determine whether we have gettext; make it a no-op if we do not -if ! type gettext &>/dev/null; then +if ! type -p gettext &>/dev/null; then @@ -783,20 +815,22 @@ diff -Naur pacman-5.1.0-orig/scripts/repo-add.sh.in pacman-5.1.0/scripts/repo-ad + /usr/bin/gettext "$@" } fi - -diff -Naur pacman-5.1.0-orig/scripts/wrapper.sh.in pacman-5.1.0/scripts/wrapper.sh.in ---- pacman-5.1.0-orig/scripts/wrapper.sh.in 2018-03-18 05:51:17.000000000 +0300 -+++ pacman-5.1.0/scripts/wrapper.sh.in 2018-06-21 13:33:09.509347300 +0300 + +diff --git a/scripts/wrapper.sh.in b/scripts/wrapper.sh.in +index 2a041d5..5c9f111 100644 +--- a/scripts/wrapper.sh.in ++++ b/scripts/wrapper.sh.in @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # @PROGNAME@ - a wrapper for running the real @PROGNAME@ in the source tree # -diff -Naur pacman-5.1.0-orig/src/pacman/callback.c pacman-5.1.0/src/pacman/callback.c ---- pacman-5.1.0-orig/src/pacman/callback.c 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/src/pacman/callback.c 2018-06-21 12:53:58.912056300 +0300 -@@ -98,8 +98,11 @@ +diff --git a/src/pacman/callback.c b/src/pacman/callback.c +index 548e2df..a46f406 100644 +--- a/src/pacman/callback.c ++++ b/src/pacman/callback.c +@@ -98,8 +98,11 @@ static int64_t get_update_timediff(int first_call) static void fill_progress(const int bar_percent, const int disp_percent, const int proglen) { @@ -810,42 +844,44 @@ diff -Naur pacman-5.1.0-orig/src/pacman/callback.c pacman-5.1.0/src/pacman/callb const int hash = bar_percent * hashlen / 100; static int lasthash = 0, mouth = 0; int i; -diff -Naur pacman-5.1.0-orig/src/pacman/check.c pacman-5.1.0/src/pacman/check.c ---- pacman-5.1.0-orig/src/pacman/check.c 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/src/pacman/check.c 2018-06-21 12:53:58.912056300 +0300 -@@ -75,6 +75,7 @@ +diff --git a/src/pacman/check.c b/src/pacman/check.c +index 6b4fdcb..543dd31 100644 +--- a/src/pacman/check.c ++++ b/src/pacman/check.c +@@ -75,6 +75,7 @@ static int check_file_permissions(const char *pkgname, const char *filepath, int errors = 0; mode_t fsmode; - + +#ifndef __MSYS__ /* uid */ if(st->st_uid != archive_entry_uid(entry)) { errors++; -@@ -92,6 +93,7 @@ +@@ -92,6 +93,7 @@ static int check_file_permissions(const char *pkgname, const char *filepath, pkgname, filepath); } } +#endif - + /* mode */ fsmode = st->st_mode & (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO); -diff -Naur pacman-5.1.0-orig/src/pacman/pacman.c pacman-5.1.0/src/pacman/pacman.c ---- pacman-5.1.0-orig/src/pacman/pacman.c 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/src/pacman/pacman.c 2018-06-21 13:34:11.939434700 +0300 -@@ -1119,7 +1119,9 @@ +diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c +index d58c428..c5d629c 100644 +--- a/src/pacman/pacman.c ++++ b/src/pacman/pacman.c +@@ -1082,7 +1082,9 @@ static void cl_to_log(int argc, char *argv[]) int main(int argc, char *argv[]) { int ret = 0; +#ifndef __MSYS__ uid_t myuid = getuid(); +#endif - + install_segv_handler(); - -@@ -1162,11 +1164,13 @@ + +@@ -1125,11 +1127,13 @@ int main(int argc, char *argv[]) cleanup(ret); } - + +#ifndef __MSYS__ /* check if we have sufficient permission for the requested operation */ if(myuid > 0 && needs_root()) { @@ -853,15 +889,16 @@ diff -Naur pacman-5.1.0-orig/src/pacman/pacman.c pacman-5.1.0/src/pacman/pacman. cleanup(EXIT_FAILURE); } +#endif - + if(config->sysroot && (chroot(config->sysroot) != 0 || chdir("/") != 0)) { pm_printf(ALPM_LOG_ERROR, -diff -Naur pacman-5.1.0-orig/test/pacman/pmtest.py pacman-5.1.0/test/pacman/pmtest.py ---- pacman-5.1.0-orig/test/pacman/pmtest.py 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/test/pacman/pmtest.py 2018-06-21 12:53:58.942056300 +0300 -@@ -228,19 +222,6 @@ +diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py +index ed6eab6..5ce752e 100644 +--- a/test/pacman/pmtest.py ++++ b/test/pacman/pmtest.py +@@ -234,19 +234,6 @@ class pmtest(object): vprint("\tpacman %s" % self.args) - + cmd = [] - if os.geteuid() != 0: - fakeroot = util.which("fakeroot") @@ -879,7 +916,7 @@ diff -Naur pacman-5.1.0-orig/test/pacman/pmtest.py pacman-5.1.0/test/pacman/pmte if pacman["gdb"]: cmd.extend(["libtool", "execute", "gdb", "--args"]) if pacman["valgrind"]: -@@ -281,8 +262,10 @@ +@@ -287,8 +274,10 @@ class pmtest(object): # Change to the tmp dir before running pacman, so that local package # archives are made available more easily. time_start = time.time() @@ -891,3 +928,7 @@ diff -Naur pacman-5.1.0-orig/test/pacman/pmtest.py pacman-5.1.0/test/pacman/pmte + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) time_end = time.time() vprint("\ttime elapsed: %.2fs" % (time_end - time_start)) + +-- +2.31.1 + diff --git a/pacman/0001-more-debugging-info.patch b/pacman/0002-More-debugging-info.patch similarity index 63% rename from pacman/0001-more-debugging-info.patch rename to pacman/0002-More-debugging-info.patch index 6161c122..022ca403 100644 --- a/pacman/0001-more-debugging-info.patch +++ b/pacman/0002-More-debugging-info.patch @@ -1,7 +1,17 @@ -diff -Naur pacman-5.0.1-orig/lib/libalpm/util.c pacman-5.0.1/lib/libalpm/util.c ---- pacman-5.0.1-orig/lib/libalpm/util.c 2016-07-15 09:42:21.400037400 +0300 -+++ pacman-5.0.1/lib/libalpm/util.c 2016-07-15 09:42:22.245037400 +0300 -@@ -300,6 +300,23 @@ +From 0ebccf0918aa77de75972754d43e02b717e308cd Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 21 May 2021 22:47:49 +0200 +Subject: [PATCH 02/N] More debugging info + +--- + lib/libalpm/util.c | 21 +++++++++++++++++++-- + 1 file changed, 19 insertions(+), 2 deletions(-) + +diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c +index 00a6acb..6f6cd2e 100644 +--- a/lib/libalpm/util.c ++++ b/lib/libalpm/util.c +@@ -303,6 +303,23 @@ int _alpm_unpack_single(alpm_handle_t *handle, const char *archive, return ret; } @@ -25,8 +35,8 @@ diff -Naur pacman-5.0.1-orig/lib/libalpm/util.c pacman-5.0.1/lib/libalpm/util.c /** Unpack a list of files in an archive. * @param handle the context handle * @param path the archive to unpack -@@ -629,7 +646,7 @@ - umask(0022); +@@ -655,7 +672,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 failed (%s)\n"), strerror(errno)); @@ -34,7 +44,7 @@ diff -Naur pacman-5.0.1-orig/lib/libalpm/util.c pacman-5.0.1/lib/libalpm/util.c exit(1); } else { /* this code runs for the parent only (wait on the child) */ -@@ -708,7 +725,7 @@ +@@ -744,7 +761,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) { @@ -43,3 +53,6 @@ diff -Naur pacman-5.0.1-orig/lib/libalpm/util.c pacman-5.0.1/lib/libalpm/util.c retval = 1; } } else if(WIFSIGNALED(status) != 0) { +-- +2.31.1 + diff --git a/pacman/0002-pacman-core-update.patch b/pacman/0003-Core-update.patch similarity index 78% rename from pacman/0002-pacman-core-update.patch rename to pacman/0003-Core-update.patch index 3fd8d76c..76474e76 100644 --- a/pacman/0002-pacman-core-update.patch +++ b/pacman/0003-Core-update.patch @@ -1,18 +1,126 @@ -diff -Naur pacman-5.1.0-orig/src/pacman/sighandler.c pacman-5.1.0/src/pacman/sighandler.c ---- pacman-5.1.0-orig/src/pacman/sighandler.c 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/src/pacman/sighandler.c 2018-06-21 12:53:58.922056300 +0300 +From 16ca714fdcce63c7bc5b51616ccb4a56e19ec537 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 21 May 2021 22:52:38 +0200 +Subject: [PATCH 03/N] Core update + +--- + lib/libalpm/alpm.h | 9 +++ + lib/libalpm/package.c | 16 +++++ + lib/libalpm/sync.c | 24 +++++++ + src/pacman/sighandler.c | 14 ++++ + src/pacman/sync.c | 140 ++++++++++++++++++++++++++++++++++++++++ + 5 files changed, 203 insertions(+) + +diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h +index fd207b5..2219f5e 100644 +--- a/lib/libalpm/alpm.h ++++ b/lib/libalpm/alpm.h +@@ -1506,6 +1506,15 @@ int alpm_trans_release(alpm_handle_t *handle); + * @return 0 on success, -1 on error (pm_errno is set accordingly) + */ + int alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade); ++#ifdef __MSYS__ ++int alpm_sync_sysupgrade_core(alpm_handle_t *handle, int enable_downgrade); ++ ++/** Informs whether a package is a core package. ++ * @param pkg the package to check ++ * @return non-zero if this is a core package, zero otherwise ++ */ ++int alpm_pkg_is_core_package(const alpm_pkg_t *pkg); ++#endif + + /** Add a package to the transaction. + * If the package was loaded by alpm_pkg_load(), it will be freed upon +diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c +index 510d812..ed46c28 100644 +--- a/lib/libalpm/package.c ++++ b/lib/libalpm/package.c +@@ -793,3 +793,19 @@ int SYMEXPORT alpm_pkg_should_ignore(alpm_handle_t *handle, alpm_pkg_t *pkg) + + return 0; + } ++ ++#ifdef __MSYS__ ++int SYMEXPORT alpm_pkg_is_core_package(const alpm_pkg_t *pkg) ++{ ++ if (pkg == NULL) ++ return 0; ++ return ++ strcmp(pkg->name, "bash") == 0 || ++ strcmp(pkg->name, "filesystem") == 0 || ++ strcmp(pkg->name, "mintty") == 0 || ++ strcmp(pkg->name, "msys2-runtime") == 0 || ++ strcmp(pkg->name, "msys2-runtime-devel") == 0 || ++ strcmp(pkg->name, "pacman") == 0 || ++ strcmp(pkg->name, "pacman-mirrors") == 0; ++} ++#endif +diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c +index a596945..bb95570 100644 +--- a/lib/libalpm/sync.c ++++ b/lib/libalpm/sync.c +@@ -201,7 +201,12 @@ static alpm_list_t *check_replacers(alpm_handle_t *handle, alpm_pkg_t *lpkg, + } + + /** Search for packages to upgrade and add them to the transaction. */ ++#ifdef __MSYS__ ++static ++int SYMEXPORT do_alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade, int core_update) ++#else + int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) ++#endif + { + alpm_list_t *i, *j; + alpm_trans_t *trans; +@@ -215,6 +220,13 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) + for(i = _alpm_db_get_pkgcache(handle->db_local); i; i = i->next) { + alpm_pkg_t *lpkg = i->data; + ++#ifdef __MSYS__ ++ /* Skip regular packages in core update, and core packages in regular update */ ++ if(core_update != alpm_pkg_is_core_package(lpkg)) { ++ continue; ++ } ++#endif ++ + if(alpm_pkg_find(trans->remove, lpkg->name)) { + _alpm_log(handle, ALPM_LOG_DEBUG, "%s is marked for removal -- skipping\n", lpkg->name); + continue; +@@ -256,6 +268,18 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) + return 0; + } + ++#ifdef __MSYS__ ++int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) ++{ ++ return do_alpm_sync_sysupgrade(handle, enable_downgrade, 0); ++} ++ ++int SYMEXPORT alpm_sync_sysupgrade_core(alpm_handle_t *handle, int enable_downgrade) ++{ ++ return do_alpm_sync_sysupgrade(handle, enable_downgrade, 1); ++} ++#endif ++ + /** Find group members across a list of databases. + * If a member exists in several databases, only the first database is used. + * IgnorePkg is also handled. +diff --git a/src/pacman/sighandler.c b/src/pacman/sighandler.c +index 46e6481..c152eea 100644 +--- a/src/pacman/sighandler.c ++++ b/src/pacman/sighandler.c @@ -21,6 +21,10 @@ #include #include - + +#ifdef __MSYS__ +#include +#endif + #include - + #include "conf.h" -@@ -44,6 +48,9 @@ +@@ -53,6 +57,9 @@ static void _reset_handler(int signum) */ static void soft_interrupt_handler(int signum) { @@ -22,7 +130,7 @@ diff -Naur pacman-5.1.0-orig/src/pacman/sighandler.c pacman-5.1.0/src/pacman/sig if(signum == SIGINT) { const char msg[] = "\nInterrupt signal received\n"; xwrite(STDERR_FILENO, msg, ARRAYSIZE(msg) - 1); -@@ -56,6 +63,13 @@ +@@ -65,6 +72,13 @@ static void soft_interrupt_handler(int signum) return; } alpm_unlock(config->handle); @@ -36,13 +144,14 @@ diff -Naur pacman-5.1.0-orig/src/pacman/sighandler.c pacman-5.1.0/src/pacman/sig /* output a newline to be sure we clear any line we may be on */ xwrite(STDOUT_FILENO, "\n", 1); _Exit(128 + signum); -diff -Naur pacman-5.1.0-orig/src/pacman/sync.c pacman-5.1.0/src/pacman/sync.c ---- pacman-5.1.0-orig/src/pacman/sync.c 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/src/pacman/sync.c 2018-06-21 13:35:38.316684900 +0300 +diff --git a/src/pacman/sync.c b/src/pacman/sync.c +index 0473f4e..0d39a37 100644 +--- a/src/pacman/sync.c ++++ b/src/pacman/sync.c @@ -28,6 +28,12 @@ #include #include - + +#ifdef __MSYS__ +#include +#include @@ -51,8 +160,8 @@ diff -Naur pacman-5.1.0-orig/src/pacman/sync.c pacman-5.1.0/src/pacman/sync.c + #include #include - -@@ -680,8 +686,134 @@ + +@@ -680,8 +686,134 @@ cleanup: return ret; } @@ -187,9 +296,9 @@ diff -Naur pacman-5.1.0-orig/src/pacman/sync.c pacman-5.1.0/src/pacman/sync.c int retval = 0; alpm_list_t *i; -@@ -695,6 +767,14 @@ +@@ -704,6 +836,14 @@ static int sync_trans(alpm_list_t *targets) } - + if(config->op_s_upgrade) { +#ifdef __MSYS__ + if((retval = core_update(&found_core_updates))) { @@ -202,94 +311,6 @@ diff -Naur pacman-5.1.0-orig/src/pacman/sync.c pacman-5.1.0/src/pacman/sync.c if(!config->print) { colon_printf(_("Starting full system upgrade...\n")); alpm_logaction(config->handle, PACMAN_CALLER_PREFIX, -diff -Naur pacman-5.1.0-orig/lib/libalpm/alpm.h pacman-5.1.0/lib/libalpm/alpm.h ---- pacman-5.1.0-orig/lib/libalpm/alpm.h 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/lib/libalpm/alpm.h 2018-06-21 12:53:58.842056200 +0300 -@@ -1558,6 +1558,15 @@ - * @return 0 on success, -1 on error (pm_errno is set accordingly) - */ - int alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade); -+#ifdef __MSYS__ -+int alpm_sync_sysupgrade_core(alpm_handle_t *handle, int enable_downgrade); -+ -+/** Informs whether a package is a core package. -+ * @param pkg the package to check -+ * @return non-zero if this is a core package, zero otherwise -+ */ -+int alpm_pkg_is_core_package(const alpm_pkg_t *pkg); -+#endif +-- +2.31.1 - /** Add a package to the transaction. - * If the package was loaded by alpm_pkg_load(), it will be freed upon -diff -Naur pacman-5.1.0-orig/lib/libalpm/package.c pacman-5.1.0/lib/libalpm/package.c ---- pacman-5.1.0-orig/lib/libalpm/package.c 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/lib/libalpm/package.c 2018-06-21 12:59:13.842497200 +0300 -@@ -805,3 +805,19 @@ - - return 0; - } -+ -+#ifdef __MSYS__ -+int SYMEXPORT alpm_pkg_is_core_package(const alpm_pkg_t *pkg) -+{ -+ if (pkg == NULL) -+ return 0; -+ return -+ strcmp(pkg->name, "bash") == 0 || -+ strcmp(pkg->name, "filesystem") == 0 || -+ strcmp(pkg->name, "mintty") == 0 || -+ strcmp(pkg->name, "msys2-runtime") == 0 || -+ strcmp(pkg->name, "msys2-runtime-devel") == 0 || -+ strcmp(pkg->name, "pacman") == 0 || -+ strcmp(pkg->name, "pacman-mirrors") == 0; -+} -+#endif -diff -Naur pacman-5.1.0-orig/lib/libalpm/sync.c pacman-5.1.0/lib/libalpm/sync.c ---- pacman-5.1.0-orig/lib/libalpm/sync.c 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/lib/libalpm/sync.c 2018-06-21 12:53:58.852056200 +0300 -@@ -200,7 +200,12 @@ - } - - /** Search for packages to upgrade and add them to the transaction. */ -+#ifdef __MSYS__ -+static -+int SYMEXPORT do_alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade, int core_update) -+#else - int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) -+#endif - { - alpm_list_t *i, *j; - alpm_trans_t *trans; -@@ -214,6 +219,13 @@ - for(i = _alpm_db_get_pkgcache(handle->db_local); i; i = i->next) { - alpm_pkg_t *lpkg = i->data; - -+#ifdef __MSYS__ -+ /* Skip regular packages in core update, and core packages in regular update */ -+ if(core_update != alpm_pkg_is_core_package(lpkg)) { -+ continue; -+ } -+#endif -+ - if(alpm_pkg_find(trans->remove, lpkg->name)) { - _alpm_log(handle, ALPM_LOG_DEBUG, "%s is marked for removal -- skipping\n", lpkg->name); - continue; -@@ -255,6 +267,18 @@ - return 0; - } - -+#ifdef __MSYS__ -+int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) -+{ -+ return do_alpm_sync_sysupgrade(handle, enable_downgrade, 0); -+} -+ -+int SYMEXPORT alpm_sync_sysupgrade_core(alpm_handle_t *handle, int enable_downgrade) -+{ -+ return do_alpm_sync_sysupgrade(handle, enable_downgrade, 1); -+} -+#endif -+ - /** Find group members across a list of databases. - * If a member exists in several databases, only the first database is used. - * IgnorePkg is also handled. diff --git a/pacman/0003-remove-ldconfig.patch b/pacman/0004-Remove-ldconfig.patch similarity index 61% rename from pacman/0003-remove-ldconfig.patch rename to pacman/0004-Remove-ldconfig.patch index 48d893a0..da189248 100644 --- a/pacman/0003-remove-ldconfig.patch +++ b/pacman/0004-Remove-ldconfig.patch @@ -1,7 +1,31 @@ -diff -Naur pacman-5.1.0-orig/lib/libalpm/add.c pacman-5.1.0/lib/libalpm/add.c ---- pacman-5.1.0-orig/lib/libalpm/add.c 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/lib/libalpm/add.c 2018-06-21 12:53:58.832056200 +0300 -@@ -656,7 +658,10 @@ +From 66df8638f4b4b83905b939027de4fdae990c666e Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 21 May 2021 22:53:34 +0200 +Subject: [PATCH 04/N] Remove ldconfig + +--- + lib/libalpm/add.c | 9 ++++++++- + lib/libalpm/remove.c | 4 ++++ + lib/libalpm/util.c | 2 ++ + test/pacman/ldconfig.stub | 4 ---- + test/pacman/meson.build | 4 ---- + test/pacman/pactest.py | 4 ---- + test/pacman/pmtest.py | 8 +------- + test/pacman/tests/TESTS | 3 --- + test/pacman/tests/ldconfig001.py | 9 --------- + test/pacman/tests/ldconfig002.py | 13 ------------- + test/pacman/tests/ldconfig003.py | 9 --------- + 11 files changed, 15 insertions(+), 54 deletions(-) + delete mode 100755 test/pacman/ldconfig.stub + delete mode 100644 test/pacman/tests/ldconfig001.py + delete mode 100644 test/pacman/tests/ldconfig002.py + delete mode 100644 test/pacman/tests/ldconfig003.py + +diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c +index 1e330ca..d30777a 100644 +--- a/lib/libalpm/add.c ++++ b/lib/libalpm/add.c +@@ -663,7 +663,10 @@ cleanup: int _alpm_upgrade_packages(alpm_handle_t *handle) { size_t pkg_count, pkg_current; @@ -12,8 +36,8 @@ diff -Naur pacman-5.1.0-orig/lib/libalpm/add.c pacman-5.1.0/lib/libalpm/add.c + int ret = 0; alpm_list_t *targ; alpm_trans_t *trans = handle->trans; - -@@ -679,18 +684,22 @@ + +@@ -686,18 +689,22 @@ int _alpm_upgrade_packages(alpm_handle_t *handle) /* something screwed up on the commit, abort the trans */ trans->state = STATE_INTERRUPTED; handle->pm_errno = ALPM_ERR_TRANS_ABORT; @@ -23,23 +47,24 @@ diff -Naur pacman-5.1.0-orig/lib/libalpm/add.c pacman-5.1.0/lib/libalpm/add.c +#endif ret = -1; } - + pkg_current++; } - + +#ifndef __MSYS__ if(!skip_ldconfig) { /* run ldconfig if it exists */ _alpm_ldconfig(handle); } +#endif - + return ret; } -diff -Naur pacman-5.1.0-orig/lib/libalpm/remove.c pacman-5.1.0/lib/libalpm/remove.c ---- pacman-5.1.0-orig/lib/libalpm/remove.c 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/lib/libalpm/remove.c 2018-06-21 12:53:58.852056200 +0300 -@@ -772,18 +772,22 @@ +diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c +index e891550..e0617cf 100644 +--- a/lib/libalpm/remove.c ++++ b/lib/libalpm/remove.c +@@ -773,18 +773,22 @@ int _alpm_remove_packages(alpm_handle_t *handle, int run_ldconfig) if(_alpm_remove_single_package(handle, pkg, NULL, targ_count, pkg_count) == -1) { handle->pm_errno = ALPM_ERR_TRANS_ABORT; @@ -49,50 +74,76 @@ diff -Naur pacman-5.1.0-orig/lib/libalpm/remove.c pacman-5.1.0/lib/libalpm/remov +#endif ret = -1; } - + targ_count++; } - + +#ifndef __MSYS__ if(run_ldconfig) { /* run ldconfig if it exists */ _alpm_ldconfig(handle); } +#endif - + return ret; } -diff -Naur pacman-5.1.0-orig/lib/libalpm/util.c pacman-5.1.0/lib/libalpm/util.c ---- pacman-5.1.0-orig/lib/libalpm/util.c 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/lib/libalpm/util.c 2018-06-21 12:53:58.852056200 +0300 -@@ -743,6 +743,7 @@ +diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c +index 6f6cd2e..87c3acd 100644 +--- a/lib/libalpm/util.c ++++ b/lib/libalpm/util.c +@@ -788,6 +788,7 @@ cleanup: return retval; } - + +#ifndef __MSYS__ /** Run ldconfig in a chroot. * @param handle the context handle * @return 0 on success, 1 on error -@@ -766,6 +767,7 @@ - +@@ -811,6 +812,7 @@ int _alpm_ldconfig(alpm_handle_t *handle) + return 0; } +#endif - + /** Helper function for comparing strings using the alpm "compare func" * signature. -diff -Naur pacman-5.1.0-orig/test/pacman/ldconfig.stub pacman-5.1.0/test/pacman/ldconfig.stub ---- pacman-5.1.0-orig/test/pacman/ldconfig.stub 2017-12-13 13:47:39.000000000 +0300 -+++ pacman-5.1.0/test/pacman/ldconfig.stub 1970-01-01 03:00:00.000000000 +0300 +diff --git a/test/pacman/ldconfig.stub b/test/pacman/ldconfig.stub +deleted file mode 100755 +index d261a04..0000000 +--- a/test/pacman/ldconfig.stub ++++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# A simple stub to copy into the chroot to fake ldconfig. -# Simply appends a line to /etc/ld.so.cache if called. -echo "ldconfig called" >> /etc/ld.so.cache -diff -Naur pacman-5.1.0-orig/test/pacman/pactest.py pacman-5.1.0/test/pacman/pactest.py ---- pacman-5.1.0-orig/test/pacman/pactest.py 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/test/pacman/pactest.py 2018-06-21 13:36:21.136744900 +0300 -@@ -94,9 +94,6 @@ +diff --git a/test/pacman/meson.build b/test/pacman/meson.build +index 4e87b4f..dcc7800 100644 +--- a/test/pacman/meson.build ++++ b/test/pacman/meson.build +@@ -79,9 +79,6 @@ pacman_tests = [ + 'tests/ignore006.py', + 'tests/ignore007.py', + 'tests/ignore008.py', +- 'tests/ldconfig001.py', +- 'tests/ldconfig002.py', +- 'tests/ldconfig003.py', + 'tests/mode001.py', + 'tests/mode002.py', + 'tests/mode003.py', +@@ -336,7 +333,6 @@ foreach input : pacman_tests + join_paths(meson.current_source_dir(), 'pactest.py'), + '--scriptlet-shell', get_option('scriptlet-shell'), + '--bindir', meson.build_root(), +- '--ldconfig', LDCONFIG, + '--verbose', + join_paths(meson.current_source_dir(), input) + ] +diff --git a/test/pacman/pactest.py b/test/pacman/pactest.py +index bd53b05..ac21840 100755 +--- a/test/pacman/pactest.py ++++ b/test/pacman/pactest.py +@@ -104,9 +104,6 @@ def create_parser(): parser.add_option("--scriptlet-shell", type = "string", dest = "scriptletshell", default = "/bin/sh", help = "specify path to shell used for install scriptlets") @@ -102,7 +153,7 @@ diff -Naur pacman-5.1.0-orig/test/pacman/pactest.py pacman-5.1.0/test/pacman/pac parser.add_option("--review", action = "store_true", dest = "review", default = False, help = "review test files, test output, and saved logs") -@@ -135,7 +132,6 @@ +@@ -145,7 +142,6 @@ if __name__ == "__main__": env.pacman["valgrind"] = opts.valgrind env.pacman["manual-confirm"] = opts.manualconfirm env.pacman["scriptlet-shell"] = opts.scriptletshell @@ -110,10 +161,11 @@ diff -Naur pacman-5.1.0-orig/test/pacman/pactest.py pacman-5.1.0/test/pacman/pac env.config["gpg"] = not opts.missing_gpg env.config["nls"] = not opts.missing_nls env.config["curl"] = not opts.missing_curl -diff -Naur pacman-5.1.0-orig/test/pacman/pmtest.py pacman-5.1.0/test/pacman/pmtest.py ---- pacman-5.1.0-orig/test/pacman/pmtest.py 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/test/pacman/pmtest.py 2018-06-21 12:53:58.942056300 +0300 -@@ -127,12 +127,10 @@ +diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py +index 5ce752e..a0cc61b 100644 +--- a/test/pacman/pmtest.py ++++ b/test/pacman/pmtest.py +@@ -129,12 +129,10 @@ class pmtest(object): logdir = os.path.join(self.root, os.path.dirname(util.LOGFILE)) etcdir = os.path.join(self.root, os.path.dirname(util.PACCONF)) bindir = os.path.join(self.root, "bin") @@ -127,7 +179,7 @@ diff -Naur pacman-5.1.0-orig/test/pacman/pmtest.py pacman-5.1.0/test/pacman/pmte for sys_dir in sys_dirs: if not os.path.isdir(sys_dir): vprint("\t%s" % sys_dir[len(self.root)+1:]) -@@ -141,10 +139,6 @@ +@@ -143,10 +141,6 @@ class pmtest(object): shutil.copy("/bin/sh", bindir) if shell != "bin/sh": shutil.copy("/bin/sh", os.path.join(self.root, shell)) @@ -135,12 +187,28 @@ diff -Naur pacman-5.1.0-orig/test/pacman/pmtest.py pacman-5.1.0/test/pacman/pmte - os.path.join(ldconfigdir, ldconfig)) - ld_so_conf = open(os.path.join(etcdir, "ld.so.conf"), "w") - ld_so_conf.close() - + # Configuration file vprint(" Creating configuration file") -diff -Naur pacman-5.1.0-orig/test/pacman/tests/ldconfig001.py pacman-5.1.0/test/pacman/tests/ldconfig001.py ---- pacman-5.1.0-orig/test/pacman/tests/ldconfig001.py 2017-12-13 13:47:39.000000000 +0300 -+++ pacman-5.1.0/test/pacman/tests/ldconfig001.py 1970-01-01 03:00:00.000000000 +0300 +diff --git a/test/pacman/tests/TESTS b/test/pacman/tests/TESTS +index 74c8f67..b29181b 100644 +--- a/test/pacman/tests/TESTS ++++ b/test/pacman/tests/TESTS +@@ -78,9 +78,6 @@ TESTS += test/pacman/tests/ignore005.py + TESTS += test/pacman/tests/ignore006.py + TESTS += test/pacman/tests/ignore007.py + TESTS += test/pacman/tests/ignore008.py +-TESTS += test/pacman/tests/ldconfig001.py +-TESTS += test/pacman/tests/ldconfig002.py +-TESTS += test/pacman/tests/ldconfig003.py + TESTS += test/pacman/tests/mode001.py + TESTS += test/pacman/tests/mode002.py + TESTS += test/pacman/tests/mode003.py +diff --git a/test/pacman/tests/ldconfig001.py b/test/pacman/tests/ldconfig001.py +deleted file mode 100644 +index a97f28c..0000000 +--- a/test/pacman/tests/ldconfig001.py ++++ /dev/null @@ -1,9 +0,0 @@ -self.description = "Make sure ldconfig runs on an upgrade operation" - @@ -151,9 +219,11 @@ diff -Naur pacman-5.1.0-orig/test/pacman/tests/ldconfig001.py pacman-5.1.0/test/ - -self.addrule("PACMAN_RETCODE=0") -self.addrule("FILE_EXIST=etc/ld.so.cache") -diff -Naur pacman-5.1.0-orig/test/pacman/tests/ldconfig002.py pacman-5.1.0/test/pacman/tests/ldconfig002.py ---- pacman-5.1.0-orig/test/pacman/tests/ldconfig002.py 2017-12-13 13:47:39.000000000 +0300 -+++ pacman-5.1.0/test/pacman/tests/ldconfig002.py 1970-01-01 03:00:00.000000000 +0300 +diff --git a/test/pacman/tests/ldconfig002.py b/test/pacman/tests/ldconfig002.py +deleted file mode 100644 +index 07f2ec6..0000000 +--- a/test/pacman/tests/ldconfig002.py ++++ /dev/null @@ -1,13 +0,0 @@ -self.description = "Make sure ldconfig runs on an upgrade operation" - @@ -168,9 +238,11 @@ diff -Naur pacman-5.1.0-orig/test/pacman/tests/ldconfig002.py pacman-5.1.0/test/ -self.addrule("PACMAN_RETCODE=0") -self.addrule("PKG_VERSION=dummy|1.0-2") -self.addrule("FILE_EXIST=etc/ld.so.cache") -diff -Naur pacman-5.1.0-orig/test/pacman/tests/ldconfig003.py pacman-5.1.0/test/pacman/tests/ldconfig003.py ---- pacman-5.1.0-orig/test/pacman/tests/ldconfig003.py 2017-12-13 13:47:39.000000000 +0300 -+++ pacman-5.1.0/test/pacman/tests/ldconfig003.py 1970-01-01 03:00:00.000000000 +0300 +diff --git a/test/pacman/tests/ldconfig003.py b/test/pacman/tests/ldconfig003.py +deleted file mode 100644 +index 9b2967e..0000000 +--- a/test/pacman/tests/ldconfig003.py ++++ /dev/null @@ -1,9 +0,0 @@ -self.description = "Make sure ldconfig runs on a sync operation" - @@ -181,36 +253,6 @@ diff -Naur pacman-5.1.0-orig/test/pacman/tests/ldconfig003.py pacman-5.1.0/test/ - -self.addrule("PACMAN_RETCODE=0") -self.addrule("FILE_EXIST=etc/ld.so.cache") -diff -Naur pacman-5.1.0-orig/test/pacman/tests/TESTS pacman-5.1.0/test/pacman/tests/TESTS ---- pacman-5.1.0-orig/test/pacman/tests/TESTS 2018-03-18 05:51:17.000000000 +0300 -+++ pacman-5.1.0/test/pacman/tests/TESTS 2018-06-21 12:53:58.942056300 +0300 -@@ -78,9 +78,6 @@ - TESTS += test/pacman/tests/ignore006.py - TESTS += test/pacman/tests/ignore007.py - TESTS += test/pacman/tests/ignore008.py --TESTS += test/pacman/tests/ldconfig001.py --TESTS += test/pacman/tests/ldconfig002.py --TESTS += test/pacman/tests/ldconfig003.py - TESTS += test/pacman/tests/mode001.py - TESTS += test/pacman/tests/mode002.py - TESTS += test/pacman/tests/mode003.py ---- pacman-5.2.1/test/pacman/meson.build.orig 2019-08-12 03:26:54.000000000 +0200 -+++ pacman-5.2.1/test/pacman/meson.build 2020-05-16 17:14:19.986575000 +0200 -@@ -79,9 +79,6 @@ - 'tests/ignore006.py', - 'tests/ignore007.py', - 'tests/ignore008.py', -- 'tests/ldconfig001.py', -- 'tests/ldconfig002.py', -- 'tests/ldconfig003.py', - 'tests/mode001.py', - 'tests/mode002.py', - 'tests/mode003.py', -@@ -336,7 +333,6 @@ - join_paths(meson.current_source_dir(), 'pactest.py'), - '--scriptlet-shell', get_option('scriptlet-shell'), - '--bindir', meson.build_root(), -- '--ldconfig', LDCONFIG, - '--verbose', - join_paths(meson.current_source_dir(), input) - ] +-- +2.31.1 + diff --git a/pacman/0004-change-epoch-sep.patch b/pacman/0004-change-epoch-sep.patch deleted file mode 100644 index 4dcae9fc..00000000 --- a/pacman/0004-change-epoch-sep.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff -Naur pacman-5.1.0-orig/lib/libalpm/version.c pacman-5.1.0/lib/libalpm/version.c ---- pacman-5.1.0-orig/lib/libalpm/version.c 2018-05-14 03:02:18.000000000 +0300 -+++ pacman-5.1.0/lib/libalpm/version.c 2018-06-21 12:53:58.862056200 +0300 -@@ -50,7 +50,11 @@ - /* se points to version terminator */ - se = strrchr(s, '-'); - -+#ifdef __MSYS__ -+ if(*s == '~') { -+#else - if(*s == ':') { -+#endif - epoch = evr; - *s++ = '\0'; - version = s; -@@ -250,7 +254,7 @@ - return 0; - } - -- /* Parse both versions into [epoch:]version[-release] triplets. We probably -+ /* Parse both versions into [epoch:|~]version[-release] triplets. We probably - * don't need epoch and release to support all the same magic, but it is - * easier to just run it all through the same code. */ - full1 = strdup(a); -diff -Naur pacman-5.1.0-orig/scripts/libmakepkg/util/pkgbuild.sh.in pacman-5.1.0/scripts/libmakepkg/util/pkgbuild.sh.in ---- pacman-5.1.0-orig/scripts/libmakepkg/util/pkgbuild.sh.in 2018-05-12 16:15:04.000000000 +0300 -+++ pacman-5.1.0/scripts/libmakepkg/util/pkgbuild.sh.in 2018-06-21 12:53:58.872056200 +0300 -@@ -149,7 +149,11 @@ - ## - get_full_version() { - if (( epoch > 0 )); then -- printf "%s\n" "$epoch:$pkgver-$pkgrel" -+ if [[ -n $MSYSTEM ]]; then -+ printf "%s\n" "${epoch}~${pkgver}-${pkgrel}" -+ else -+ printf "%s\n" "$epoch:$pkgver-$pkgrel" -+ fi - else - printf "%s\n" "$pkgver-$pkgrel" - fi diff --git a/pacman/0005-Change-the-epoch-separator.patch b/pacman/0005-Change-the-epoch-separator.patch new file mode 100644 index 00000000..5d2a1703 --- /dev/null +++ b/pacman/0005-Change-the-epoch-separator.patch @@ -0,0 +1,55 @@ +From e4c5d56bfa4ca985b74563e26c00b6fd2c01807a Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 21 May 2021 22:54:23 +0200 +Subject: [PATCH 05/N] Change the epoch separator + +--- + lib/libalpm/version.c | 6 +++++- + scripts/libmakepkg/util/pkgbuild.sh.in | 6 +++++- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/lib/libalpm/version.c b/lib/libalpm/version.c +index a518a69..66b1db1 100644 +--- a/lib/libalpm/version.c ++++ b/lib/libalpm/version.c +@@ -50,7 +50,11 @@ static void parseEVR(char *evr, const char **ep, const char **vp, + /* se points to version terminator */ + se = strrchr(s, '-'); + ++#ifdef __MSYS__ ++ if(*s == '~') { ++#else + if(*s == ':') { ++#endif + epoch = evr; + *s++ = '\0'; + version = s; +@@ -250,7 +254,7 @@ int SYMEXPORT alpm_pkg_vercmp(const char *a, const char *b) + return 0; + } + +- /* Parse both versions into [epoch:]version[-release] triplets. We probably ++ /* Parse both versions into [epoch:|~]version[-release] triplets. We probably + * don't need epoch and release to support all the same magic, but it is + * easier to just run it all through the same code. */ + full1 = strdup(a); +diff --git a/scripts/libmakepkg/util/pkgbuild.sh.in b/scripts/libmakepkg/util/pkgbuild.sh.in +index 93bae4e..17f4f6f 100644 +--- a/scripts/libmakepkg/util/pkgbuild.sh.in ++++ b/scripts/libmakepkg/util/pkgbuild.sh.in +@@ -164,7 +164,11 @@ get_pkgbuild_all_split_attributes() { + ## + get_full_version() { + if (( epoch > 0 )); then +- printf "%s\n" "$epoch:$pkgver-$pkgrel" ++ if [[ -n $MSYSTEM ]]; then ++ printf "%s\n" "${epoch}~${pkgver}-${pkgrel}" ++ else ++ printf "%s\n" "$epoch:$pkgver-$pkgrel" ++ fi + else + printf "%s\n" "$pkgver-$pkgrel" + fi +-- +2.31.1 + diff --git a/pacman/0006-makepkg-avoid-creating-.tar-files-with-extended-attr.patch b/pacman/0006-makepkg-avoid-creating-.tar-files-with-extended-attr.patch index 82901d05..9d73b188 100644 --- a/pacman/0006-makepkg-avoid-creating-.tar-files-with-extended-attr.patch +++ b/pacman/0006-makepkg-avoid-creating-.tar-files-with-extended-attr.patch @@ -1,7 +1,8 @@ -From 3757cecebbf77f05742f0226c858edaad0e9654c Mon Sep 17 00:00:00 2001 +From e30c5a2fe51c570a93ea691033d4260426fb7733 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 29 Jun 2017 11:54:48 +0200 -Subject: [PATCH] makepkg: avoid creating .tar files with extended attributes +Subject: [PATCH 06/N] makepkg: avoid creating .tar files with extended + attributes Extended attributes are not necessary for pacman to work. Extended attributes may not even be supported by the file system to which we @@ -22,10 +23,10 @@ Signed-off-by: Johannes Schindelin 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in -index 0770640..513e4f1 100644 +index 86616de..6baeddf 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in -@@ -756,7 +756,7 @@ create_package() { +@@ -697,7 +697,7 @@ create_package() { msg2 "$(gettext "Compressing package...")" # TODO: Maybe this can be set globally for robustness shopt -s -o pipefail @@ -35,5 +36,5 @@ index 0770640..513e4f1 100644 shopt -u -o pipefail -- -2.13.0 +2.31.1 diff --git a/pacman/0007-exe-interp-ignore-file-conflict.patch b/pacman/0007-pacman-libalpm-ignore-file-conflicts-for-foo.exe-foo.patch similarity index 57% rename from pacman/0007-exe-interp-ignore-file-conflict.patch rename to pacman/0007-pacman-libalpm-ignore-file-conflicts-for-foo.exe-foo.patch index a0f64968..6e3e8afa 100644 --- a/pacman/0007-exe-interp-ignore-file-conflict.patch +++ b/pacman/0007-pacman-libalpm-ignore-file-conflicts-for-foo.exe-foo.patch @@ -1,6 +1,23 @@ ---- pacman-5.0.1/lib/libalpm/conflict.c.orig 2016-01-04 04:27:45.000000000 +0100 -+++ pacman-5.0.1/lib/libalpm/conflict.c 2017-09-27 15:11:44.461428600 +0200 -@@ -535,6 +535,32 @@ +From c82f2a24e92f71badcf0236e5aa7971116493519 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 21 May 2021 22:55:24 +0200 +Subject: [PATCH 07/N] pacman/libalpm: ignore file conflicts for foo.exe -> + foo renames + +In case a file "foo.exe" gets renamed to "foo" the msys2 .exe +interpolation makes pacman think an untracker file is replaced. +In case foo and foo.exe are the same file and foo.exe existed +in the old package version we can be sure it's handled by the +old package and ignore the conflict. +--- + lib/libalpm/conflict.c | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c +index 7e986f1..c5d006b 100644 +--- a/lib/libalpm/conflict.c ++++ b/lib/libalpm/conflict.c +@@ -535,6 +535,32 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, _alpm_log(handle, ALPM_LOG_DEBUG, "checking possible conflict: %s\n", path); @@ -33,3 +50,6 @@ pfile_isdir = path[pathlen - 1] == '/'; if(pfile_isdir) { if(S_ISDIR(lsbuf.st_mode)) { +-- +2.31.1 + diff --git a/pacman/0008-answer-yes-by-default.patch b/pacman/0008-Change-default-answer-of-all-queries-to-yes.patch similarity index 84% rename from pacman/0008-answer-yes-by-default.patch rename to pacman/0008-Change-default-answer-of-all-queries-to-yes.patch index e52cdf81..5198788b 100644 --- a/pacman/0008-answer-yes-by-default.patch +++ b/pacman/0008-Change-default-answer-of-all-queries-to-yes.patch @@ -1,7 +1,7 @@ -From 09ad07d05d61d3c15409eae9297493d633aaeecd Mon Sep 17 00:00:00 2001 +From 65cf1b7e2d10f35e0d0a00c3939e6ee71e12dba5 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sat, 10 Feb 2018 22:39:35 +0100 -Subject: [PATCH] Change default answer of all queries to yes +Subject: [PATCH 08/N] Change default answer of all queries to yes This allows to use pacman completely unattended using the --noconfirm switch which automatically accepts the default answer. @@ -14,10 +14,10 @@ See https://github.com/Alexpux/MSYS2-packages/issues/1141 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pacman/callback.c b/src/pacman/callback.c -index c1679e37..cbb01092 100644 +index a46f406..3d2fb44 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c -@@ -416,12 +416,12 @@ void cb_question(alpm_question_t *question) +@@ -398,12 +398,12 @@ void cb_question(alpm_question_t *question) /* print conflict only if it contains new information */ if(strcmp(q->conflict->package1, q->conflict->reason->name) == 0 || strcmp(q->conflict->package2, q->conflict->reason->name) == 0) { @@ -32,7 +32,7 @@ index c1679e37..cbb01092 100644 q->conflict->package1, q->conflict->package2, q->conflict->reason->name, -@@ -445,7 +445,7 @@ void cb_question(alpm_question_t *question) +@@ -427,7 +427,7 @@ void cb_question(alpm_question_t *question) count)); list_display(" ", namelist, getcols()); printf("\n"); @@ -42,10 +42,10 @@ index c1679e37..cbb01092 100644 "Do you want to skip the above packages for this upgrade?", count)); diff --git a/src/pacman/remove.c b/src/pacman/remove.c -index 73b48c36..a25d73af 100644 +index 9920f50..4c70d26 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c -@@ -146,7 +146,7 @@ int pacman_remove(alpm_list_t *targets) +@@ -140,7 +140,7 @@ int pacman_remove(alpm_list_t *targets) holdpkg = 1; } } @@ -55,7 +55,7 @@ index 73b48c36..a25d73af 100644 goto cleanup; } diff --git a/src/pacman/sync.c b/src/pacman/sync.c -index 0f41fad9..62749aae 100644 +index 0d39a37..41ee123 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -194,7 +194,7 @@ static int sync_cleancache(int level) @@ -68,5 +68,5 @@ index 0f41fad9..62749aae 100644 continue; } -- -2.16.1.windows.4 +2.31.1 diff --git a/pacman/0009-msys-use-pipe-instead-socket.patch b/pacman/0009-Use-pipe-instead-of-socket.patch similarity index 67% rename from pacman/0009-msys-use-pipe-instead-socket.patch rename to pacman/0009-Use-pipe-instead-of-socket.patch index 2e076c6e..f0be6958 100644 --- a/pacman/0009-msys-use-pipe-instead-socket.patch +++ b/pacman/0009-Use-pipe-instead-of-socket.patch @@ -1,5 +1,16 @@ ---- pacman-5.1.0/lib/libalpm/util.c.orig 2018-06-22 07:29:01.599597700 +0300 -+++ pacman-5.1.0/lib/libalpm/util.c 2018-06-22 07:33:21.219961100 +0300 +From 9d1ea56b893e8460587a0d9f613cf447265647fc Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 21 May 2021 22:56:23 +0200 +Subject: [PATCH 09/N] Use pipe instead of socket + +--- + lib/libalpm/util.c | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c +index 87c3acd..6452eca 100644 +--- a/lib/libalpm/util.c ++++ b/lib/libalpm/util.c @@ -30,7 +30,9 @@ #include #include @@ -10,7 +21,7 @@ #include #include -@@ -483,6 +483,9 @@ +@@ -481,6 +483,9 @@ static int _alpm_chroot_write_to_child(alpm_handle_t *handle, int fd, _alpm_cb_io out_cb, void *cb_ctx) { ssize_t nwrite; @@ -20,7 +31,7 @@ if(*buf_size == 0) { /* empty buffer, ask the callback for more */ -@@ -490,7 +492,20 @@ +@@ -490,7 +495,20 @@ static int _alpm_chroot_write_to_child(alpm_handle_t *handle, int fd, } } @@ -41,7 +52,7 @@ if(nwrite != -1) { /* write was successful, remove the written data from the buffer */ -@@ -603,13 +618,21 @@ +@@ -622,13 +640,21 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[], /* Flush open fds before fork() to avoid cloning buffers */ fflush(NULL); @@ -63,3 +74,6 @@ _alpm_log(handle, ALPM_LOG_ERROR, _("could not create pipe (%s)\n"), strerror(errno)); retval = 1; goto cleanup; +-- +2.31.1 + diff --git a/pacman/0010-filelist-strcasecmp.patch b/pacman/0010-pacman-make-file-list-comparisons-between-packages-c.patch similarity index 59% rename from pacman/0010-filelist-strcasecmp.patch rename to pacman/0010-pacman-make-file-list-comparisons-between-packages-c.patch index bde29349..c896078c 100644 --- a/pacman/0010-filelist-strcasecmp.patch +++ b/pacman/0010-pacman-make-file-list-comparisons-between-packages-c.patch @@ -1,9 +1,25 @@ -This makes _alpm_filelist_difference() and _alpm_filelist_intersection() take -into account that filenames are case insensitive (only for ASCII, unicode is -still broken). This fixes conflict detection in case two packages share the -same filename with a different case. ---- pacman-5.1.1-orig/lib/libalpm/filelist.c 2018-05-14 02:02:18.000000000 +0200 -+++ pacman-5.1.1/lib/libalpm/filelist.c 2018-09-28 13:05:47.398469000 +0200 +From bb14cd639cef1da7e51b9f2a4351725b3618082a Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 21 May 2021 22:57:25 +0200 +Subject: [PATCH 10/N] pacman: make file list comparisons between packages + case insensitive + +In case a package gets upgrade and a filename has changed case this allows +the upgrade to go through without any conflicts. + +Similarly in case two different packages contain the same file with +a different case this makes it correctly detect a conflict. + +This only handles ASCII parts of paths, so Unicode filenames still can +lead to invalid conflict detection. +--- + lib/libalpm/filelist.c | 47 +++++++++++++++++++++++++++++++++++++----- + 1 file changed, 42 insertions(+), 5 deletions(-) + +diff --git a/lib/libalpm/filelist.c b/lib/libalpm/filelist.c +index 4a534b0..34a771a 100644 +--- a/lib/libalpm/filelist.c ++++ b/lib/libalpm/filelist.c @@ -25,6 +25,43 @@ #include "filelist.h" #include "util.h" @@ -48,7 +64,7 @@ same filename with a different case. /* Returns the difference of the provided two lists of files. * Pre-condition: both lists are sorted! * When done, free the list but NOT the contained data. -@@ -39,7 +76,7 @@ +@@ -39,7 +76,7 @@ alpm_list_t *_alpm_filelist_difference(alpm_filelist_t *filesA, char *strA = filesA->files[ctrA].name; char *strB = filesB->files[ctrB].name; @@ -57,7 +73,7 @@ same filename with a different case. if(cmp < 0) { /* item only in filesA, qualifies as a difference */ ret = alpm_list_add(ret, strA); -@@ -63,7 +100,7 @@ +@@ -63,7 +100,7 @@ alpm_list_t *_alpm_filelist_difference(alpm_filelist_t *filesA, static int _alpm_filelist_pathcmp(const char *p1, const char *p2) { @@ -66,7 +82,7 @@ same filename with a different case. p1++; p2++; } -@@ -75,7 +112,7 @@ +@@ -75,7 +112,7 @@ static int _alpm_filelist_pathcmp(const char *p1, const char *p2) p1++; } @@ -75,7 +91,7 @@ same filename with a different case. } /* Returns the intersection of the provided two lists of files. -@@ -115,7 +152,7 @@ +@@ -115,7 +152,7 @@ static int _alpm_files_cmp(const void *f1, const void *f2) { const alpm_file_t *file1 = f1; const alpm_file_t *file2 = f2; @@ -84,7 +100,7 @@ same filename with a different case. } alpm_file_t SYMEXPORT *alpm_filelist_contains(alpm_filelist_t *filelist, -@@ -137,7 +174,7 @@ +@@ -137,7 +174,7 @@ void _alpm_filelist_sort(alpm_filelist_t *filelist) { size_t i; for(i = 1; i < filelist->count; i++) { @@ -93,3 +109,6 @@ same filename with a different case. /* filelist is not pre-sorted */ qsort(filelist->files, filelist->count, sizeof(alpm_file_t), _alpm_files_cmp); +-- +2.31.1 + diff --git a/pacman/0011-update-ja-po-for-msys2.patch b/pacman/0011-Translate-MSYS2-specific-messages-into-Japanese.patch similarity index 63% rename from pacman/0011-update-ja-po-for-msys2.patch rename to pacman/0011-Translate-MSYS2-specific-messages-into-Japanese.patch index 8ae9a80a..4272c3c8 100644 --- a/pacman/0011-update-ja-po-for-msys2.patch +++ b/pacman/0011-Translate-MSYS2-specific-messages-into-Japanese.patch @@ -1,6 +1,17 @@ ---- pacman-5.2.1-orig/src/pacman/po/ja.po 2019-11-01 09:52:52.000000000 +0900 -+++ pacman-5.2.1/src/pacman/po/ja.po 2020-06-02 16:29:18.220253600 +0900 -@@ -1439,6 +1439,30 @@ +From b6a59bd96f1cee3cf3796b2046fb1751acd59bde Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 21 May 2021 22:58:41 +0200 +Subject: [PATCH 11/N] Translate MSYS2 specific messages into Japanese + +--- + src/pacman/po/ja.po | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/src/pacman/po/ja.po b/src/pacman/po/ja.po +index 40ce7f3..477fd6f 100644 +--- a/src/pacman/po/ja.po ++++ b/src/pacman/po/ja.po +@@ -1439,6 +1439,30 @@ msgid "'%s' is a file, did you mean %s instead of %s?\n" msgstr "" "'%s' はファイルです、あなたが行いたいのは %s で %s ではありませんか?\n" @@ -31,3 +42,6 @@ #: src/pacman/sync.c:708 #, c-format msgid "Starting full system upgrade...\n" +-- +2.31.1 + diff --git a/pacman/0012-workaround-bsdtar-AD-account.patch b/pacman/0012-Workaround-compressing-packages-with-bsdtar-under-Ac.patch similarity index 61% rename from pacman/0012-workaround-bsdtar-AD-account.patch rename to pacman/0012-Workaround-compressing-packages-with-bsdtar-under-Ac.patch index 4b6f87da..f2ab7ea0 100644 --- a/pacman/0012-workaround-bsdtar-AD-account.patch +++ b/pacman/0012-Workaround-compressing-packages-with-bsdtar-under-Ac.patch @@ -1,6 +1,19 @@ ---- pacman-5.2.1/scripts/makepkg.sh.in.orig 2020-01-15 11:45:13.617261400 +0300 -+++ pacman-5.2.1/scripts/makepkg.sh.in 2020-01-15 11:47:05.351767400 +0300 -@@ -697,7 +697,7 @@ +From 6734419a33ad66f1fc2f399315af4577ff96af60 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 21 May 2021 22:59:28 +0200 +Subject: [PATCH 12/N] Workaround compressing packages with bsdtar under + Active Directory account + +--- + scripts/makepkg.sh.in | 4 ++-- + scripts/repo-add.sh.in | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in +index 6baeddf..5ff6607 100644 +--- a/scripts/makepkg.sh.in ++++ b/scripts/makepkg.sh.in +@@ -697,7 +697,7 @@ create_package() { msg2 "$(gettext "Compressing package...")" # TODO: Maybe this can be set globally for robustness shopt -s -o pipefail @@ -9,7 +22,7 @@ compress_as "$PKGEXT" > "${pkg_file}" || ret=$? shopt -u -o pipefail -@@ -788,7 +788,7 @@ +@@ -792,7 +792,7 @@ create_srcpackage() { # TODO: Maybe this can be set globally for robustness shopt -s -o pipefail @@ -18,9 +31,11 @@ shopt -u -o pipefail ---- pacman-5.2.1/scripts/repo-add.sh.in.orig 2020-01-15 11:45:25.629308400 +0300 -+++ pacman-5.2.1/scripts/repo-add.sh.in 2020-01-15 11:46:36.730602900 +0300 -@@ -535,11 +535,11 @@ +diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in +index d8a539e..c9d93d4 100644 +--- a/scripts/repo-add.sh.in ++++ b/scripts/repo-add.sh.in +@@ -535,11 +535,11 @@ create_db() { pushd "$tmpdir/$repo" >/dev/null if ( shopt -s nullglob; files=(*); (( ${#files[*]} )) ); then @@ -34,3 +49,6 @@ fi popd >/dev/null +-- +2.31.1 + diff --git a/pacman/0013-use-libintl.patch b/pacman/0013-build-add-libintl-dependency-to-meson-and-the-.pc-fi.patch similarity index 84% rename from pacman/0013-use-libintl.patch rename to pacman/0013-build-add-libintl-dependency-to-meson-and-the-.pc-fi.patch index 5c271679..bf5eaeda 100644 --- a/pacman/0013-use-libintl.patch +++ b/pacman/0013-build-add-libintl-dependency-to-meson-and-the-.pc-fi.patch @@ -1,8 +1,7 @@ -From 31583e2b308d80d6514a091e973d7c868a9e7f5f Mon Sep 17 00:00:00 2001 +From a844b07570a18bfd40a382ffada9193e2a3df73d Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Wed, 19 Jun 2019 17:53:57 -0400 -Subject: [pacman-dev] [PATCH] build: add libintl dependency to meson and the - .pc file +Subject: [PATCH 13/N] build: add libintl dependency to meson and the .pc file In order to use gettext on systems where it is not part of libc, the correct linker flags are needed in libalpm.pc (for static compilation). @@ -19,7 +18,7 @@ Signed-off-by: Eli Schwartz 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/libalpm/libalpm.pc.in b/lib/libalpm/libalpm.pc.in -index 126a6e6a..da7f96aa 100644 +index 126a6e6..da7f96a 100644 --- a/lib/libalpm/libalpm.pc.in +++ b/lib/libalpm/libalpm.pc.in @@ -10,4 +10,4 @@ Version: @LIB_VERSION@ @@ -29,10 +28,10 @@ index 126a6e6a..da7f96aa 100644 -Libs.private: @LIBS@ @pc_gpgme_libs@ +Libs.private: @LIBS@ @pc_gpgme_libs@ @LIBINTL@ diff --git a/meson.build b/meson.build -index 62d45966..bf2454c7 100644 +index 89362f2..ea6481a 100644 --- a/meson.build +++ b/meson.build -@@ -77,9 +77,13 @@ conf.set_quoted('CACHEDIR', join_paths(LOCALSTATEDIR, 'cache/pacman/pkg/')) +@@ -79,9 +79,13 @@ conf.set_quoted('CACHEDIR', join_paths(LOCALSTATEDIR, 'cache/pacman/pkg/')) conf.set_quoted('HOOKDIR', join_paths(SYSCONFDIR, 'pacman.d/hooks/')) conf.set_quoted('ROOTDIR', ROOTDIR) @@ -47,7 +46,7 @@ index 62d45966..bf2454c7 100644 endif conf.set('ENABLE_NLS', 1) endif -@@ -303,7 +307,7 @@ libcommon = static_library( +@@ -314,7 +318,7 @@ libcommon = static_library( include_directories : includes, install : false) @@ -57,5 +56,5 @@ index 62d45966..bf2454c7 100644 libalpm_a = static_library( 'alpm_objlib', -- -2.26.2 +2.31.1 diff --git a/pacman/0014-fix-asciidoc-argparse.patch b/pacman/0014-Fix-asciidoc-argparse.patch similarity index 51% rename from pacman/0014-fix-asciidoc-argparse.patch rename to pacman/0014-Fix-asciidoc-argparse.patch index 98c8307d..b98eedac 100644 --- a/pacman/0014-fix-asciidoc-argparse.patch +++ b/pacman/0014-Fix-asciidoc-argparse.patch @@ -1,12 +1,22 @@ +From 5a6b9dbc388c617b25c03628db46a19867575eda Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 21 May 2021 23:00:14 +0200 +Subject: [PATCH 14/N] Fix asciidoc argparse + a2x seems to fail when a value to an argument looks like an argument itself. The best fix seems to be to attach the value to the argument using an equal sign. https://bugs.python.org/issue9334 +--- + doc/meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) ---- pacman-5.2.1/doc/meson.build 2019-08-12 03:26:42.000000000 +0200 -+++ pacman-5.2.1/doc/meson.build 2020-05-16 09:46:38.677111500 +0200 -@@ -57,7 +57,7 @@ +diff --git a/doc/meson.build b/doc/meson.build +index a5bcd5b..a86f1bf 100644 +--- a/doc/meson.build ++++ b/doc/meson.build +@@ -57,7 +57,7 @@ foreach page : manpages '-f', 'manpage', '--xsltproc-opts', '-param man.endnotes.list.enabled 0 -param man.endnotes.are.numbered 0', '-D', '@OUTDIR@', @@ -15,3 +25,6 @@ https://bugs.python.org/issue9334 '@INPUT@', ], input : input, +-- +2.31.1 + diff --git a/pacman/0015-Remove-fakeroot.patch b/pacman/0015-Remove-fakeroot.patch new file mode 100644 index 00000000..39dc89ff --- /dev/null +++ b/pacman/0015-Remove-fakeroot.patch @@ -0,0 +1,28 @@ +From 7e27cd03ab69d20fd078a12f378711b2a26056da Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 21 May 2021 23:02:23 +0200 +Subject: [PATCH 15/N] Remove fakeroot + +Currently we don't have fakeroot, so let's allow building without it. Most of +the patching is currently done in 0000-pacman-msysize.patch, these are just some +new occurrences. Ideally this removal will be a completely separate patch in +the future. +--- + scripts/libmakepkg/executable/meson.build | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/scripts/libmakepkg/executable/meson.build b/scripts/libmakepkg/executable/meson.build +index 8536a54..d5b6dcc 100644 +--- a/scripts/libmakepkg/executable/meson.build ++++ b/scripts/libmakepkg/executable/meson.build +@@ -4,7 +4,6 @@ sources = [ + 'ccache.sh.in', + 'checksum.sh.in', + 'distcc.sh.in', +- 'fakeroot.sh.in', + 'gpg.sh.in', + 'gzip.sh.in', + 'pacman.sh.in', +-- +2.31.1 + diff --git a/pacman/0016-Remove-sudo.patch b/pacman/0016-Remove-sudo.patch new file mode 100644 index 00000000..d791f6ca --- /dev/null +++ b/pacman/0016-Remove-sudo.patch @@ -0,0 +1,29 @@ +From 367915b8c1352e0c380a9a37270a3a0dd27058a3 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 21 May 2021 23:02:56 +0200 +Subject: [PATCH 16/N] Remove sudo + +Currently we don't have sudo and most people have their MSYS2 roots +user-writable anyway, so let's completely remove the usage of sudo. Most of the +patching is currently done in 0000-pacman-msysize.patch, these are just some new +occurrences. Ideally this removal will be a completely separate patch in the +future. +--- + scripts/libmakepkg/executable/meson.build | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/scripts/libmakepkg/executable/meson.build b/scripts/libmakepkg/executable/meson.build +index d5b6dcc..535da57 100644 +--- a/scripts/libmakepkg/executable/meson.build ++++ b/scripts/libmakepkg/executable/meson.build +@@ -8,7 +8,6 @@ sources = [ + 'gzip.sh.in', + 'pacman.sh.in', + 'strip.sh.in', +- 'sudo.sh.in', + 'vcs.sh.in', + ] + +-- +2.31.1 + diff --git a/pacman/0016-excise-fakeroot.patch b/pacman/0016-excise-fakeroot.patch deleted file mode 100644 index b122beea..00000000 --- a/pacman/0016-excise-fakeroot.patch +++ /dev/null @@ -1,15 +0,0 @@ -Currently we don't have fakeroot, so let's allow building without it. Most of -the patching is currently done in 0000-pacman-msysize.patch, these are just some -new occurrences. Ideally this removal will be a completely separate patch in -the future. - ---- pacman-5.2.1/scripts/libmakepkg/executable/meson.build 2019-08-12 03:26:42.000000000 +0200 -+++ pacman-5.2.1/scripts/libmakepkg/executable/meson.build 2020-05-16 19:32:35.339363400 +0200 -@@ -4,7 +4,6 @@ - 'ccache.sh.in', - 'checksum.sh.in', - 'distcc.sh.in', -- 'fakeroot.sh.in', - 'gpg.sh.in', - 'gzip.sh.in', - 'pacman.sh.in', diff --git a/pacman/0018-use-msys-tools.patch b/pacman/0017-Use-msys-tools.patch similarity index 57% rename from pacman/0018-use-msys-tools.patch rename to pacman/0017-Use-msys-tools.patch index 26f1d9da..4d4d8394 100644 --- a/pacman/0018-use-msys-tools.patch +++ b/pacman/0017-Use-msys-tools.patch @@ -1,12 +1,22 @@ +From 5cdc97ce02770516db75c03a2ba5aac248b1e4b8 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 21 May 2021 23:03:54 +0200 +Subject: [PATCH 17/N] Use msys tools + Some of the external tools pacman uses might unfortunately have incompatible versions in PATH, e.g. when using makepkg-mingw. Let's always invoke them using absolute paths. Most of the patching is currently done in 0000-pacman-msysize.patch, these are just some new occurrences. Ideally these PATH guards will be a completely separate patch in the future. +--- + scripts/libmakepkg/meson.build | 1 + + 1 file changed, 1 insertion(+) ---- pacman-5.2.1/scripts/libmakepkg/meson.build 2019-08-12 03:26:42.000000000 +0200 -+++ pacman-5.2.1/scripts/libmakepkg/meson.build 2020-05-16 19:25:47.447523000 +0200 -@@ -7,6 +7,7 @@ +diff --git a/scripts/libmakepkg/meson.build b/scripts/libmakepkg/meson.build +index b0697f7..3bdc66c 100644 +--- a/scripts/libmakepkg/meson.build ++++ b/scripts/libmakepkg/meson.build +@@ -7,6 +7,7 @@ libmakepkg_modules = [ { 'name' : 'lint_pkgbuild', 'has_subdir' : true }, { 'name' : 'source', 'has_subdir' : true }, { 'name' : 'srcinfo', }, @@ -14,3 +24,6 @@ PATH guards will be a completely separate patch in the future. { 'name' : 'tidy', 'has_subdir' : true }, { 'name' : 'util', 'has_subdir' : true }, ] +-- +2.31.1 + diff --git a/pacman/0017-excise-sudo.patch b/pacman/0017-excise-sudo.patch deleted file mode 100644 index f68e64a5..00000000 --- a/pacman/0017-excise-sudo.patch +++ /dev/null @@ -1,17 +0,0 @@ -Currently we don't have sudo and most people have their MSYS2 roots -user-writable anyway, so let's completely remove the usage of sudo. Most of the -patching is currently done in 0000-pacman-msysize.patch, these are just some new -occurrences. Ideally this removal will be a completely separate patch in the -future. - ---- pacman-5.2.1/scripts/libmakepkg/executable/meson.build 2019-08-12 03:26:42.000000000 +0200 -+++ pacman-5.2.1/scripts/libmakepkg/executable/meson.build 2020-05-16 19:33:16.467336500 +0200 -@@ -8,8 +8,7 @@ - 'gpg.sh.in', - 'gzip.sh.in', - 'pacman.sh.in', - 'strip.sh.in', -- 'sudo.sh.in', - 'vcs.sh.in', - ] - diff --git a/pacman/0020-fix-wrong-files-sig-clean.patch b/pacman/0018-pacman-correct-length-of-.files.sig-string.patch similarity index 83% rename from pacman/0020-fix-wrong-files-sig-clean.patch rename to pacman/0018-pacman-correct-length-of-.files.sig-string.patch index 4ccc6b52..0d1b3848 100644 --- a/pacman/0020-fix-wrong-files-sig-clean.patch +++ b/pacman/0018-pacman-correct-length-of-.files.sig-string.patch @@ -1,7 +1,7 @@ -From 05aefb8f82d856626598ef6a3f49ff8d5f623bf5 Mon Sep 17 00:00:00 2001 +From f6e00ab089f39417c2d96a3b5d8be4dfbb570ae8 Mon Sep 17 00:00:00 2001 From: Pascal Ernster Date: Thu, 21 Jan 2021 03:49:58 +0100 -Subject: pacman: correct length of ".files.sig" string +Subject: [PATCH 18/N] pacman: correct length of ".files.sig" string Running "pacman -Sc" deletes /var/lib/pacman/sync/*.files.sig due to a wrong string length being used when checking filename suffixes in that @@ -22,13 +22,11 @@ Signed-off-by: Allan McRae src/pacman/sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -(limited to 'src/pacman/sync.c') - diff --git a/src/pacman/sync.c b/src/pacman/sync.c -index a05af5da..9ec4c92e 100644 +index 41ee123..b55e5b3 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c -@@ -105,7 +105,7 @@ static int sync_cleandb(const char *dbpath) +@@ -110,7 +110,7 @@ static int sync_cleandb(const char *dbpath) dbname = strndup(dname, len - 7); } else if(len > 6 && strcmp(dname + len - 6, ".files") == 0) { dbname = strndup(dname, len - 6); @@ -38,5 +36,5 @@ index a05af5da..9ec4c92e 100644 } else { ret += unlink_verbose(path, 0); -- -cgit v1.2.3-1-gf6bb5 +2.31.1 diff --git a/pacman/0019-Export-CC-and-CXX-variables-explicitly.patch b/pacman/0019-Export-CC-and-CXX-variables-explicitly.patch new file mode 100644 index 00000000..5195751f --- /dev/null +++ b/pacman/0019-Export-CC-and-CXX-variables-explicitly.patch @@ -0,0 +1,37 @@ +From 046e01faeea7e0b1ea563f058aacaec946093f15 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sun, 23 May 2021 17:36:14 +0200 +Subject: [PATCH 19/N] Export CC and CXX variables explicitly + +See https://github.com/msys2/MSYS2-packages/pull/2501 +--- + scripts/libmakepkg/buildenv.sh.in | 2 +- + scripts/libmakepkg/buildenv/buildflags.sh.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/libmakepkg/buildenv.sh.in b/scripts/libmakepkg/buildenv.sh.in +index 965b9c2..5d36b6b 100644 +--- a/scripts/libmakepkg/buildenv.sh.in ++++ b/scripts/libmakepkg/buildenv.sh.in +@@ -36,5 +36,5 @@ prepare_buildenv() { + done + + # ensure all necessary build variables are exported +- export CPPFLAGS CFLAGS CXXFLAGS LDFLAGS RUSTFLAGS MAKEFLAGS CHOST ++ export CC CXX CPPFLAGS CFLAGS CXXFLAGS LDFLAGS RUSTFLAGS MAKEFLAGS CHOST + } +diff --git a/scripts/libmakepkg/buildenv/buildflags.sh.in b/scripts/libmakepkg/buildenv/buildflags.sh.in +index 9814a54..e32bf21 100644 +--- a/scripts/libmakepkg/buildenv/buildflags.sh.in ++++ b/scripts/libmakepkg/buildenv/buildflags.sh.in +@@ -30,6 +30,6 @@ buildenv_functions+=('buildenv_buildflags') + + buildenv_buildflags() { + if check_option "buildflags" "n"; then +- unset CPPFLAGS CFLAGS DEBUG_CFLAGS CXXFLAGS DEBUG_CXXFLAGS LDFLAGS RUSTFLAGS DEBUG_RUSTFLAGS ++ unset CC CXX CPPFLAGS CFLAGS DEBUG_CFLAGS CXXFLAGS DEBUG_CXXFLAGS LDFLAGS RUSTFLAGS DEBUG_RUSTFLAGS + fi + } +-- +2.31.1 + diff --git a/pacman/0019-doxyfile-in-missing.patch b/pacman/0019-doxyfile-in-missing.patch deleted file mode 100644 index 0574bc67..00000000 --- a/pacman/0019-doxyfile-in-missing.patch +++ /dev/null @@ -1,329 +0,0 @@ -From dab45f0808951afc2e3146211a1c6d7ebb8bd06d Mon Sep 17 00:00:00 2001 -From: Dave Reisner -Date: Sun, 21 Oct 2018 22:58:23 -0400 -Subject: Dynamically generate Doxyfile from input - -This isn't super interesting for the autotools side, but it's necessary -in order to make things sane for other build systems which we might -introduce in the future. ---- - doc/Doxyfile.in | 305 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 305 insertions(+) - create mode 100644 doc/Doxyfile.in - -(limited to 'doc/Doxyfile.in') - -diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in -new file mode 100644 -index 00000000..78481dd5 ---- /dev/null -+++ b/doc/Doxyfile.in -@@ -0,0 +1,305 @@ -+# Doxyfile 1.8.2 -+ -+#--------------------------------------------------------------------------- -+# Project related configuration options -+#--------------------------------------------------------------------------- -+DOXYFILE_ENCODING = UTF-8 -+PROJECT_NAME = libalpm -+PROJECT_NUMBER = -+PROJECT_BRIEF = "Arch Linux Package Manager Library" -+PROJECT_LOGO = -+OUTPUT_DIRECTORY = @OUTPUT_DIRECTORY@ -+CREATE_SUBDIRS = NO -+OUTPUT_LANGUAGE = English -+BRIEF_MEMBER_DESC = YES -+REPEAT_BRIEF = YES -+ABBREVIATE_BRIEF = "The $name class" \ -+ "The $name widget" \ -+ "The $name file" \ -+ is \ -+ provides \ -+ specifies \ -+ contains \ -+ represents \ -+ a \ -+ an \ -+ the -+ALWAYS_DETAILED_SEC = YES -+INLINE_INHERITED_MEMB = NO -+FULL_PATH_NAMES = NO -+STRIP_FROM_PATH = -+STRIP_FROM_INC_PATH = -+SHORT_NAMES = NO -+JAVADOC_AUTOBRIEF = YES -+QT_AUTOBRIEF = NO -+MULTILINE_CPP_IS_BRIEF = NO -+INHERIT_DOCS = YES -+SEPARATE_MEMBER_PAGES = NO -+TAB_SIZE = 4 -+ALIASES = -+TCL_SUBST = -+OPTIMIZE_OUTPUT_FOR_C = YES -+OPTIMIZE_OUTPUT_JAVA = NO -+OPTIMIZE_FOR_FORTRAN = NO -+OPTIMIZE_OUTPUT_VHDL = NO -+EXTENSION_MAPPING = -+MARKDOWN_SUPPORT = YES -+AUTOLINK_SUPPORT = YES -+BUILTIN_STL_SUPPORT = NO -+CPP_CLI_SUPPORT = NO -+SIP_SUPPORT = NO -+IDL_PROPERTY_SUPPORT = YES -+DISTRIBUTE_GROUP_DOC = NO -+SUBGROUPING = YES -+INLINE_GROUPED_CLASSES = NO -+INLINE_SIMPLE_STRUCTS = NO -+TYPEDEF_HIDES_STRUCT = NO -+SYMBOL_CACHE_SIZE = 0 -+LOOKUP_CACHE_SIZE = 0 -+#--------------------------------------------------------------------------- -+# Build related configuration options -+#--------------------------------------------------------------------------- -+EXTRACT_ALL = NO -+EXTRACT_PRIVATE = NO -+EXTRACT_PACKAGE = NO -+EXTRACT_STATIC = NO -+EXTRACT_LOCAL_CLASSES = YES -+EXTRACT_LOCAL_METHODS = NO -+EXTRACT_ANON_NSPACES = NO -+HIDE_UNDOC_MEMBERS = NO -+HIDE_UNDOC_CLASSES = NO -+HIDE_FRIEND_COMPOUNDS = NO -+HIDE_IN_BODY_DOCS = YES -+INTERNAL_DOCS = NO -+CASE_SENSE_NAMES = YES -+HIDE_SCOPE_NAMES = NO -+SHOW_INCLUDE_FILES = YES -+FORCE_LOCAL_INCLUDES = NO -+INLINE_INFO = YES -+SORT_MEMBER_DOCS = YES -+SORT_BRIEF_DOCS = NO -+SORT_MEMBERS_CTORS_1ST = NO -+SORT_GROUP_NAMES = NO -+SORT_BY_SCOPE_NAME = NO -+STRICT_PROTO_MATCHING = NO -+GENERATE_TODOLIST = YES -+GENERATE_TESTLIST = YES -+GENERATE_BUGLIST = YES -+GENERATE_DEPRECATEDLIST= YES -+ENABLED_SECTIONS = -+MAX_INITIALIZER_LINES = 30 -+SHOW_USED_FILES = YES -+SHOW_FILES = YES -+SHOW_NAMESPACES = YES -+FILE_VERSION_FILTER = -+LAYOUT_FILE = -+CITE_BIB_FILES = -+#--------------------------------------------------------------------------- -+# configuration options related to warning and progress messages -+#--------------------------------------------------------------------------- -+QUIET = NO -+WARNINGS = YES -+WARN_IF_UNDOCUMENTED = YES -+WARN_IF_DOC_ERROR = YES -+WARN_NO_PARAMDOC = NO -+WARN_FORMAT = "$file:$line: $text" -+WARN_LOGFILE = -+#--------------------------------------------------------------------------- -+# configuration options related to the input files -+#--------------------------------------------------------------------------- -+INPUT = ../lib/libalpm/ -+INPUT_ENCODING = UTF-8 -+FILE_PATTERNS = -+RECURSIVE = NO -+EXCLUDE = -+EXCLUDE_SYMLINKS = NO -+EXCLUDE_PATTERNS = -+EXCLUDE_SYMBOLS = -+EXAMPLE_PATH = -+EXAMPLE_PATTERNS = * -+EXAMPLE_RECURSIVE = NO -+IMAGE_PATH = -+INPUT_FILTER = -+FILTER_PATTERNS = -+FILTER_SOURCE_FILES = NO -+FILTER_SOURCE_PATTERNS = -+#--------------------------------------------------------------------------- -+# configuration options related to source browsing -+#--------------------------------------------------------------------------- -+SOURCE_BROWSER = NO -+INLINE_SOURCES = NO -+STRIP_CODE_COMMENTS = NO -+REFERENCED_BY_RELATION = YES -+REFERENCES_RELATION = YES -+REFERENCES_LINK_SOURCE = YES -+USE_HTAGS = NO -+VERBATIM_HEADERS = YES -+#--------------------------------------------------------------------------- -+# configuration options related to the alphabetical class index -+#--------------------------------------------------------------------------- -+ALPHABETICAL_INDEX = NO -+COLS_IN_ALPHA_INDEX = 5 -+IGNORE_PREFIX = -+#--------------------------------------------------------------------------- -+# configuration options related to the HTML output -+#--------------------------------------------------------------------------- -+GENERATE_HTML = NO -+HTML_OUTPUT = html -+HTML_FILE_EXTENSION = .html -+HTML_HEADER = -+HTML_FOOTER = -+HTML_STYLESHEET = -+HTML_EXTRA_STYLESHEET = -+HTML_EXTRA_FILES = -+HTML_COLORSTYLE_HUE = 220 -+HTML_COLORSTYLE_SAT = 100 -+HTML_COLORSTYLE_GAMMA = 80 -+HTML_TIMESTAMP = YES -+HTML_DYNAMIC_SECTIONS = NO -+HTML_INDEX_NUM_ENTRIES = 100 -+GENERATE_DOCSET = NO -+DOCSET_FEEDNAME = "Doxygen generated docs" -+DOCSET_BUNDLE_ID = org.doxygen.Project -+DOCSET_PUBLISHER_ID = org.doxygen.Publisher -+DOCSET_PUBLISHER_NAME = Publisher -+GENERATE_HTMLHELP = NO -+CHM_FILE = -+HHC_LOCATION = -+GENERATE_CHI = NO -+CHM_INDEX_ENCODING = -+BINARY_TOC = NO -+TOC_EXPAND = NO -+GENERATE_QHP = NO -+QCH_FILE = -+QHP_NAMESPACE = org.doxygen.Project -+QHP_VIRTUAL_FOLDER = doc -+QHP_CUST_FILTER_NAME = -+QHP_CUST_FILTER_ATTRS = -+QHP_SECT_FILTER_ATTRS = -+QHG_LOCATION = -+GENERATE_ECLIPSEHELP = NO -+ECLIPSE_DOC_ID = org.doxygen.Project -+DISABLE_INDEX = NO -+GENERATE_TREEVIEW = NO -+ENUM_VALUES_PER_LINE = 4 -+TREEVIEW_WIDTH = 250 -+EXT_LINKS_IN_WINDOW = NO -+FORMULA_FONTSIZE = 10 -+FORMULA_TRANSPARENT = YES -+USE_MATHJAX = NO -+MATHJAX_RELPATH = http://www.mathjax.org/mathjax -+MATHJAX_EXTENSIONS = -+SEARCHENGINE = NO -+SERVER_BASED_SEARCH = NO -+#--------------------------------------------------------------------------- -+# configuration options related to the LaTeX output -+#--------------------------------------------------------------------------- -+GENERATE_LATEX = NO -+LATEX_OUTPUT = latex -+LATEX_CMD_NAME = latex -+MAKEINDEX_CMD_NAME = makeindex -+COMPACT_LATEX = NO -+PAPER_TYPE = letter -+EXTRA_PACKAGES = -+LATEX_HEADER = -+LATEX_FOOTER = -+PDF_HYPERLINKS = NO -+USE_PDFLATEX = NO -+LATEX_BATCHMODE = NO -+LATEX_HIDE_INDICES = NO -+LATEX_SOURCE_CODE = NO -+LATEX_BIB_STYLE = plain -+#--------------------------------------------------------------------------- -+# configuration options related to the RTF output -+#--------------------------------------------------------------------------- -+GENERATE_RTF = NO -+RTF_OUTPUT = rtf -+COMPACT_RTF = NO -+RTF_HYPERLINKS = NO -+RTF_STYLESHEET_FILE = -+RTF_EXTENSIONS_FILE = -+#--------------------------------------------------------------------------- -+# configuration options related to the man page output -+#--------------------------------------------------------------------------- -+GENERATE_MAN = YES -+MAN_OUTPUT = . -+MAN_EXTENSION = .3 -+MAN_LINKS = NO -+#--------------------------------------------------------------------------- -+# configuration options related to the XML output -+#--------------------------------------------------------------------------- -+GENERATE_XML = NO -+XML_OUTPUT = xml -+XML_SCHEMA = -+XML_DTD = -+XML_PROGRAMLISTING = YES -+#--------------------------------------------------------------------------- -+# configuration options for the AutoGen Definitions output -+#--------------------------------------------------------------------------- -+GENERATE_AUTOGEN_DEF = NO -+#--------------------------------------------------------------------------- -+# configuration options related to the Perl module output -+#--------------------------------------------------------------------------- -+GENERATE_PERLMOD = NO -+PERLMOD_LATEX = NO -+PERLMOD_PRETTY = YES -+PERLMOD_MAKEVAR_PREFIX = -+#--------------------------------------------------------------------------- -+# Configuration options related to the preprocessor -+#--------------------------------------------------------------------------- -+ENABLE_PREPROCESSING = YES -+MACRO_EXPANSION = YES -+EXPAND_ONLY_PREDEF = YES -+SEARCH_INCLUDES = YES -+INCLUDE_PATH = ../.. -+INCLUDE_FILE_PATTERNS = *.h -+PREDEFINED = HAVE_CONFIG_H= \ -+ SYMHIDDEN= \ -+ SYMEXPORT= \ -+ HAVE_LIBARCHIVE \ -+ HAVE_LIBCURL \ -+ HAVE_LIBGPGME -+EXPAND_AS_DEFINED = -+SKIP_FUNCTION_MACROS = YES -+#--------------------------------------------------------------------------- -+# Configuration::additions related to external references -+#--------------------------------------------------------------------------- -+TAGFILES = -+GENERATE_TAGFILE = -+ALLEXTERNALS = NO -+EXTERNAL_GROUPS = YES -+PERL_PATH = /usr/bin/perl -+#--------------------------------------------------------------------------- -+# Configuration options related to the dot tool -+#--------------------------------------------------------------------------- -+CLASS_DIAGRAMS = NO -+MSCGEN_PATH = -+HIDE_UNDOC_RELATIONS = YES -+HAVE_DOT = YES -+DOT_NUM_THREADS = 0 -+DOT_FONTNAME = Helvetica -+DOT_FONTSIZE = 10 -+DOT_FONTPATH = -+CLASS_GRAPH = YES -+COLLABORATION_GRAPH = YES -+GROUP_GRAPHS = YES -+UML_LOOK = NO -+UML_LIMIT_NUM_FIELDS = 10 -+TEMPLATE_RELATIONS = NO -+INCLUDE_GRAPH = YES -+INCLUDED_BY_GRAPH = YES -+CALL_GRAPH = NO -+CALLER_GRAPH = NO -+GRAPHICAL_HIERARCHY = YES -+DIRECTORY_GRAPH = YES -+DOT_IMAGE_FORMAT = png -+INTERACTIVE_SVG = NO -+DOT_PATH = -+DOTFILE_DIRS = -+MSCFILE_DIRS = -+DOT_GRAPH_MAX_NODES = 50 -+MAX_DOT_GRAPH_DEPTH = 3 -+DOT_TRANSPARENT = NO -+DOT_MULTI_TARGETS = NO -+GENERATE_LEGEND = YES -+DOT_CLEANUP = YES --- -cgit v1.2.3-1-gf6bb5 - diff --git a/pacman/0021-export-cc-cxx.patch b/pacman/0021-export-cc-cxx.patch deleted file mode 100644 index 84267e16..00000000 --- a/pacman/0021-export-cc-cxx.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- pacman-5.2.2/scripts/libmakepkg/buildenv.sh.in.orig 2021-05-15 07:20:51.021291800 +0100 -+++ pacman-5.2.2/scripts/libmakepkg/buildenv.sh.in 2021-05-15 07:52:13.014867100 +0100 -@@ -36,5 +36,5 @@ - done - - # ensure all necessary build variables are exported -- export CPPFLAGS CFLAGS CXXFLAGS LDFLAGS RUSTFLAGS MAKEFLAGS CHOST -+ export CC CXX CPPFLAGS CFLAGS CXXFLAGS LDFLAGS RUSTFLAGS MAKEFLAGS CHOST - } ---- pacman-5.2.2/scripts/libmakepkg/buildenv/buildflags.sh.in.orig 2021-05-15 07:55:29.592543800 +0100 -+++ pacman-5.2.2/scripts/libmakepkg/buildenv/buildflags.sh.in 2021-05-15 07:55:42.773495200 +0100 -@@ -30,6 +30,6 @@ - - buildenv_buildflags() { - if check_option "buildflags" "n"; then -- unset CPPFLAGS CFLAGS DEBUG_CFLAGS CXXFLAGS DEBUG_CXXFLAGS LDFLAGS RUSTFLAGS DEBUG_RUSTFLAGS -+ unset CC CXX CPPFLAGS CFLAGS DEBUG_CFLAGS CXXFLAGS DEBUG_CXXFLAGS LDFLAGS RUSTFLAGS DEBUG_RUSTFLAGS - fi - } diff --git a/pacman/PKGBUILD b/pacman/PKGBUILD index 82b92ffb..943ffa6e 100644 --- a/pacman/PKGBUILD +++ b/pacman/PKGBUILD @@ -4,7 +4,7 @@ pkgname=pacman pkgver=5.2.2 -pkgrel=23 +pkgrel=24 pkgdesc="A library-based package manager with dependency support (MSYS2 port)" arch=('i686' 'x86_64') url="https://www.archlinux.org/pacman/" @@ -36,82 +36,91 @@ makedepends=('asciidoc' backup=("etc/pacman.conf" "etc/makepkg.conf" "etc/makepkg_mingw.conf") -source=(https://sources.archlinux.org/other/pacman/${pkgname}-${pkgver}.tar.gz +source=(pacman-${pkgver}::git+https://git.archlinux.org/pacman.git#tag=v${pkgver} "pacman.conf" "makepkg.conf" "makepkg_mingw.conf" "makepkg-mingw" - "0000-pacman-msysize.patch" - "0001-more-debugging-info.patch" - "0002-pacman-core-update.patch" - "0003-remove-ldconfig.patch" - "0004-change-epoch-sep.patch" - "0006-makepkg-avoid-creating-.tar-files-with-extended-attr.patch" - "0007-exe-interp-ignore-file-conflict.patch" - "0008-answer-yes-by-default.patch" - "0009-msys-use-pipe-instead-socket.patch" - "0010-filelist-strcasecmp.patch" - "0011-update-ja-po-for-msys2.patch" - "0012-workaround-bsdtar-AD-account.patch" - "0013-use-libintl.patch" - "0014-fix-asciidoc-argparse.patch" - "0016-excise-fakeroot.patch" - "0017-excise-sudo.patch" - "0018-use-msys-tools.patch" - "0019-doxyfile-in-missing.patch" - "0020-fix-wrong-files-sig-clean.patch" - "0021-export-cc-cxx.patch") + 0001-Msysize.patch + 0002-More-debugging-info.patch + 0003-Core-update.patch + 0004-Remove-ldconfig.patch + 0005-Change-the-epoch-separator.patch + 0006-makepkg-avoid-creating-.tar-files-with-extended-attr.patch + 0007-pacman-libalpm-ignore-file-conflicts-for-foo.exe-foo.patch + 0008-Change-default-answer-of-all-queries-to-yes.patch + 0009-Use-pipe-instead-of-socket.patch + 0010-pacman-make-file-list-comparisons-between-packages-c.patch + 0011-Translate-MSYS2-specific-messages-into-Japanese.patch + 0012-Workaround-compressing-packages-with-bsdtar-under-Ac.patch + 0013-build-add-libintl-dependency-to-meson-and-the-.pc-fi.patch + 0014-Fix-asciidoc-argparse.patch + 0015-Remove-fakeroot.patch + 0016-Remove-sudo.patch + 0017-Use-msys-tools.patch + 0018-pacman-correct-length-of-.files.sig-string.patch + 0019-Export-CC-and-CXX-variables-explicitly.patch) validpgpkeys=('6645B0A8C7005E78DB1D7864F99FFE0FEAE999BD' # Allan McRae 'B8151B117037781095514CA7BBDFFC92306B1121') # Andrew Gregory (pacman) -sha256sums=('bb201a9f2fb53c28d011f661d50028efce6eef2c1d2a36728bdd0130189349a0' +sha256sums=('SKIP' 'f5a84c5642d57044ddb40387822bfcb01bdbdcd885b46bc93d116aaf0e5741a6' '178ff34e13f7d558a4410f909667c07faeaf7a83b15b00e7db342c0796675733' 'b9ad2fb4b0e686b96db0a50d411f4d9344ec8950f50906fb502272037246e4b8' '2bd27c3fc5443b367e5025c9b9a35670b02202e48e92eead90755fef8d08fa83' - '2e2dde573b971011abad5340cb2cd5a4b9a0e8470a2ed94d7a969525e0bed0c1' - '24ea2c8dca37847e04894ebfd05d1cf5df49dc0c8089f5581c99caa19b77a7ef' - 'abb81e2dc9507dc20dc860287b8ce1bf5e5cd7cec3dd386770dc568c39db6431' - 'fa6056f2d998578f8e11a97adf4d8a7bb4bba6f75b65aa498c82198ed9da9841' - 'b672f3648bbfd7763b1e689c73a9ba7ddc230016a0d8dfeebca1b7faf7777424' - 'e2731c4007a7c78848679e2203c35d1e56d3ef15a7586aeac9cc9e6e97824cfb' - '52343bbf99da6408950e34dd84319e34724040f866c497c25e36b4ee54030e82' - 'e4f6e17af19e17e745a9f1c6b8402f5896229062c82167cb61f8e7d29eda716c' - '9e8fe5ee78192b0407e80ad2e52cb27569c35974b6c26e465e3d55e19c03d108' - '93be4523fb8c3dd6b56eddfe0b09e666725a62eb43392fee336ba1a328f9ffdd' - '558919a5e4632512fa42690bd5ea96e72766213ae6943408f7010daa486de929' - 'c242202f3526d5eaa21d321a1d0fa472697c50e8288175ebe93212356c78d1f1' - '7cec4688b83df9f8ab56f5ab5e162383fe8928ff88b76d753a2cea935f30ec93' - 'b84310fd8fb9a98258c55ed9628226b14f55d6e42304df4d2a5bd8d8445c03b3' - 'd6b6accddc890aff38b5ded3300e9dde35e1d7ed3f767e1655772e2cc7871739' - '8346a5799be41bd3524fa6fdc57b6175d9d6a00b366f99bd5cd7fa3d43d0ae98' - '7f60108a372718cfec5d883167a33983be7c5df33fc48bfc21f664449ac7a0a4' - '43eb9548ddff92fb08c0c7636c4978541ff225e220bf4ba6512118cf75e76b07' - '876d8d726ed6cc069f947daa1c3d6ffe07ee51e3019dd40f6b77576e8900d1da' - 'b766c7d7fc12f0d2b00d853cca8b15add7170e5e33fd03434ab991ddaa1de7af') + '3b6e0dee7b5f1ff84ffffff1fb5cbc77bc6037212d92bd3fbffc91ff64aa732f' + '084ecde8013312553671ebe53dc8fcd1c1f987bbfaa31898e0f0cd5e637dc89d' + '635988f9138ea50f2eed81d596abc99c47d02f16db3e0c20ea65abf05869327f' + '7a8c08ea12206793b6e40576415d19cd6ffd27f3b6339caffd4074cf9d6794c3' + '37a7b1f97f527a14df3f791431af4777217ed52d34f1b74525f4ad4ce7d88dc2' + '3a91fa92465a771700b69275c2376760b487c057212638e6f79e374ebf15bd78' + 'a00a4820a5a267901ee84165b4d5a4ad09dc540dbec56ddca5e1d60aba513fd4' + '309d602867b671d54752081308a14e7fcf33b7b15c34e4194036ade2fa90f9b4' + '3587f7891920bba891933ea8879d82fae397864f240ae3e029493fd91022d7e7' + 'acc1d0e211c0f1aa5585f6f9250552f533786ee79c8a17d95bfc4998b10677d9' + '5fc5f39bc00ba65275dbdd2209bcb42d1251ec1c1e63f18891c909ac9c635209' + '6585f7db153ddd3b8201ee23af77bf9f716775e7c228ee360be46ea08aa61b5e' + '6506d8a010a65050927dcf4499fba058865ceb22b5c76af58421d4cdec7b4a17' + 'a9797a3d73d18e0188f90fb58878e9ce5bef1661dd953da12a6cfb5a34d2e279' + 'bd3acbae2c2f37d148d28cb424d1ab9491b8be4e0899b6deee4bbe8e11e14801' + 'b3744175bf561ba178608c47a4bc75016ce358197e5cc184bf786cdd209580e6' + '2f22490f9021399c735e6dd83417206a834fb80e0eb586b66779ca53f76095d8' + '2b7dd9f9f4c39e2ee24d54318e1f608569d78c93e856c088592db34d5c3dab5f' + '0737f9cf11af9235c2242d1d9ec9280cf707e50290621ef4625c2512c1dae443') + +apply_git_am_with_msg() { + for _patch in "$@" + do + msg2 "Applying $_patch" + git am --committer-date-is-author-date "${srcdir}/${_patch}" + done +} prepare() { cd ${srcdir}/${pkgname}-${pkgver} - patch -p1 -i ${srcdir}/0000-pacman-msysize.patch - patch -p1 -i ${srcdir}/0001-more-debugging-info.patch - patch -p1 -i ${srcdir}/0002-pacman-core-update.patch - patch -p1 -i ${srcdir}/0003-remove-ldconfig.patch - patch -p1 -i ${srcdir}/0004-change-epoch-sep.patch - patch -p1 -i ${srcdir}/0006-makepkg-avoid-creating-.tar-files-with-extended-attr.patch - patch -p1 -i ${srcdir}/0007-exe-interp-ignore-file-conflict.patch - patch -p1 -i ${srcdir}/0008-answer-yes-by-default.patch - patch -p1 -i ${srcdir}/0009-msys-use-pipe-instead-socket.patch - patch -p1 -i ${srcdir}/0010-filelist-strcasecmp.patch - patch -p1 -i ${srcdir}/0011-update-ja-po-for-msys2.patch - patch -p1 -i ${srcdir}/0012-workaround-bsdtar-AD-account.patch - patch -p1 -i ${srcdir}/0013-use-libintl.patch - patch -p1 -i ${srcdir}/0014-fix-asciidoc-argparse.patch - patch -p1 -i ${srcdir}/0016-excise-fakeroot.patch - patch -p1 -i ${srcdir}/0017-excise-sudo.patch - patch -p1 -i ${srcdir}/0018-use-msys-tools.patch - patch -p1 -i ${srcdir}/0019-doxyfile-in-missing.patch - # https://git.archlinux.org/pacman.git/commit/src/pacman/sync.c?id=05aefb8f82d856626598ef6a3f49ff8d5f623bf5 - patch -p1 -i ${srcdir}/0020-fix-wrong-files-sig-clean.patch - patch -p1 -i ${srcdir}/0021-export-cc-cxx.patch + + # fixup symlinks + git config core.symlinks true + git reset HEAD --hard + + apply_git_am_with_msg 0001-Msysize.patch \ + 0002-More-debugging-info.patch \ + 0003-Core-update.patch \ + 0004-Remove-ldconfig.patch \ + 0005-Change-the-epoch-separator.patch \ + 0006-makepkg-avoid-creating-.tar-files-with-extended-attr.patch \ + 0007-pacman-libalpm-ignore-file-conflicts-for-foo.exe-foo.patch \ + 0008-Change-default-answer-of-all-queries-to-yes.patch \ + 0009-Use-pipe-instead-of-socket.patch \ + 0010-pacman-make-file-list-comparisons-between-packages-c.patch \ + 0011-Translate-MSYS2-specific-messages-into-Japanese.patch \ + 0012-Workaround-compressing-packages-with-bsdtar-under-Ac.patch \ + 0013-build-add-libintl-dependency-to-meson-and-the-.pc-fi.patch \ + 0014-Fix-asciidoc-argparse.patch \ + 0015-Remove-fakeroot.patch \ + 0016-Remove-sudo.patch \ + 0017-Use-msys-tools.patch \ + 0018-pacman-correct-length-of-.files.sig-string.patch \ + 0019-Export-CC-and-CXX-variables-explicitly.patch } build() { diff --git a/pacman/update-patches.sh b/pacman/update-patches.sh new file mode 100644 index 00000000..c76a09f2 --- /dev/null +++ b/pacman/update-patches.sh @@ -0,0 +1,71 @@ +#!/bin/sh + +set -e + +die () { + echo "$*" >&2 + exit 1 +} + +cd "$(dirname "$0")" || +die "Could not cd to msys2-pacman/" + +git rev-parse --verify HEAD >/dev/null && +git update-index -q --ignore-submodules --refresh && +git diff-files --quiet --ignore-submodules && +git diff-index --cached --quiet --ignore-submodules HEAD -- || +die "Clean worktree required" + +git rm 0*.patch || +die "Could not remove previous patches" + +base_tag=refs/tags/v"$(sed -ne 's/^pkgver=//p'