msys2 / msys2-pacman

A friendly fork of https://gitlab.archlinux.org/pacman/pacman
GNU General Public License v2.0
21 stars 12 forks source link

Update to v6.0.2 #28

Closed lazka closed 1 year ago

lazka commented 1 year ago

Fixes #22

The main conflict was the strip code, where I dropped the code copying source files based on the debug info. This only ever worked for elf files anyway, and now it uses debugedit which doesn't support Windows.

git range-diff v6.0.1..msys2-v6.0.1-v2 v6.0.2..wip/msys2-v6.0.2

range-diff ``` 1: fc1289b4 = 1: 8f868132 makepkg: clean up more things 2: 6b52c600 = 2: 67116916 makepkg: bash v4 compat 3: 43ce58f3 = 3: d78b0671 makepkg: find_libdepends: port to Windows 4: b2306f50 = 4: 2517b408 makepkg: build env export 5: e9aef783 = 5: 177be576 makepkg: find_libprovides: port to Windows 6: b4df7d36 = 6: 021897d8 fill_progress 7: 8ba367e3 = 7: 96da61e5 test fixes 8: f344d31a = 8: 2a69e2ad Remove everything related to sudo/fakeroot/file permissions 9: 60b14175 = 9: 0d20d7a3 change shebang 10: 59280ed7 = 10: 665948ce Set fixed paths for various tools 11: 8371eee2 = 11: 8d6b87b5 makepkg: port staticlibs to Windows 12: 2dccb801 ! 12: b4ef84e9 makepkg: port strip/debug to Windows @@ scripts/libmakepkg/tidy/strip.sh.in: packaging_options+=('strip' 'debug') - LANG=C readelf -n "$1" | sed -n '/Build ID/ { s/.*: //p; q; }' -} - - source_files() { - LANG=C readelf "$1" --debug-dump 2>/dev/null | \ - awk '/DW_AT_name +:/{name=$NF}/DW_AT_comp_dir +:/{{if (name == "") next}{if (name !~ /^[<\/]/) {printf "%s/", $NF}}{print name}}' -@@ scripts/libmakepkg/tidy/strip.sh.in: source_files() { +-source_files() { +- # This function does two things: +- # +- # 1) rewrites source file locations for packages not respecting prefix- +- # map switches. This ensures all source file references in debug +- # info point to $dbgsrcdir. +- # +- # 2) outputs a list of files from the package source files to stdout +- # while stripping the $dbgsrcdir prefix +- +- LANG=C debugedit --no-recompute-build-id \ +- --base-dir "${srcdir}" \ +- --dest-dir "${dbgsrcdir}/${pkgbase}" \ +- --list-file /dev/stdout "$1" \ +- | sort -zu | tr '\0' '\n' +-} +- strip_file() { local binary=$1; shift @@ scripts/libmakepkg/tidy/strip.sh.in: source_files() { - # copy source files to debug directory - local file dest t - while IFS= read -r t; do -- file=${t/${dbgsrcdir}/"$srcdir"} -- dest="${dbgsrc/"$dbgsrcdir"/}$t" -- if ! [[ -f $dest ]]; then +- file="${srcdir}/${t}" +- dest="${dbgsrc}/${t}" +- if [[ -f "$file" ]] && ! [[ -f $dest ]]; then - mkdir -p "${dest%/*}" - cp -- "$file" "$dest" - fi - done < <(source_files "$binary") - +- - # copy debug symbols to debug directory - mkdir -p "$dbgdir/${binary%/*}" -- objcopy --only-keep-debug "$binary" "$dbgdir/$binary.debug" +- +- # abandon processing files that are not a recognised format +- if ! objcopy --only-keep-debug "$binary" "$dbgdir/$binary.debug" 2>/dev/null; then +- return +- fi +- - local tempfile=$(mktemp "$binary.XXXXXX") - objcopy --add-gnu-debuglink="$dbgdir/${binary#/}.debug" "$binary" "$tempfile" - cat "$tempfile" > "$binary" @@ scripts/libmakepkg/tidy/strip.sh.in: source_files() { - ln "$dbgdir/${binary}.debug" "$dbgdir/${file}.debug" - fi - done < <(find . -type f -perm -u+w -print0 2>/dev/null) -- + - if [[ -n "$bid" ]]; then - local target - mkdir -p "$dbgdir/.build-id/${bid:0:2}" -+ # copy source files to debug directory -+ local file dest t -+ while IFS= read -r t; do -+ file=${t/${dbgsrcdir}/"$srcdir"} -+ dest="${dbgsrc/"$dbgsrcdir"/}$t" -+ if ! [[ -f $dest ]]; then -+ mkdir -p "${dest%/*}" -+ cp -- "$file" "$dest" -+ fi -+ done < <(source_files "$binary") -+ + # copy debug symbols to debug directory + mkdir -p "$dbgdir/${binary%/*}" + msg2 "Separating debug info from $binary into $dbgdir/$binary.debug" 13: 2e0a928d = 13: 06d16ac1 makepkg: lint_package: Warn on package files referencing absolute Windows paths 14: b87e9f0e = 14: 7f5db9af More debugging info 15: facdf753 = 15: daed07c1 Core update 16: 15f48313 = 16: da60046b Remove ldconfig 17: 0e0a45c2 = 17: 4bd3e4b6 Change the epoch separator 18: 62a2f0c6 ! 18: 450d6ceb makepkg: avoid creating .tar files with extended attributes @@ scripts/makepkg.sh.in: create_package() { msg2 "$(gettext "Compressing package...")" # TODO: Maybe this can be set globally for robustness shopt -s -o pipefail -- list_package_files | LANG=C bsdtar --no-fflags -cnf - --null --files-from - | -+ list_package_files | LANG=C bsdtar --no-fflags --no-xattrs -cnf - --null --files-from - | +- list_package_files | LANG=C bsdtar --no-fflags @BSDTAR_NO_READ_SPARSE@ -cnf - --null --files-from - | ++ list_package_files | LANG=C bsdtar --no-fflags @BSDTAR_NO_READ_SPARSE@ --no-xattrs -cnf - --null --files-from - | compress_as "$PKGEXT" > "${pkg_file}" || ret=$? shopt -u -o pipefail 19: b5391573 = 19: ff8c5cc6 pacman/libalpm: ignore file conflicts for foo.exe -> foo renames 20: 4c6761c0 = 20: f20b178e Change default answer of all queries to yes 21: bcd67e9e = 21: ffee8d50 Use pipe instead of socket 22: 07539464 = 22: f3f1c749 pacman: make file list comparisons between packages case insensitive 23: a59f05bc = 23: 39875430 Translate MSYS2 specific messages into Japanese 24: f4dfcad6 ! 24: 5ae4335c Workaround compressing packages with bsdtar under Active Directory account @@ scripts/makepkg.sh.in: create_package() { msg2 "$(gettext "Compressing package...")" # TODO: Maybe this can be set globally for robustness shopt -s -o pipefail -- list_package_files | LANG=C bsdtar --no-fflags --no-xattrs -cnf - --null --files-from - | -+ list_package_files | LANG=C bsdtar --no-fflags --no-xattrs --uid 1 --uname root --gid 1 --gname root -cnf - --null --files-from - | +- list_package_files | LANG=C bsdtar --no-fflags @BSDTAR_NO_READ_SPARSE@ --no-xattrs -cnf - --null --files-from - | ++ list_package_files | LANG=C bsdtar --no-fflags @BSDTAR_NO_READ_SPARSE@ --no-xattrs --uid 1 --uname root --gid 1 --gname root -cnf - --null --files-from - | compress_as "$PKGEXT" > "${pkg_file}" || ret=$? shopt -u -o pipefail @@ scripts/makepkg.sh.in: create_srcpackage() { # TODO: Maybe this can be set globally for robustness shopt -s -o pipefail -- LANG=C bsdtar --no-fflags -cLf - ${pkgbase} | compress_as "$SRCEXT" > "${pkg_file}" || ret=$? -+ LANG=C bsdtar --no-fflags --uid 1 --uname root --gid 1 --gname root -cLf - ${pkgbase} | compress_as "$SRCEXT" > "${pkg_file}" || ret=$? +- LANG=C bsdtar --no-fflags @BSDTAR_NO_READ_SPARSE@ -cLf - ${pkgbase} | compress_as "$SRCEXT" > "${pkg_file}" || ret=$? ++ LANG=C bsdtar --no-fflags @BSDTAR_NO_READ_SPARSE@ --uid 1 --uname root --gid 1 --gname root -cLf - ${pkgbase} | compress_as "$SRCEXT" > "${pkg_file}" || ret=$? shopt -u -o pipefail 25: 795a8e29 = 25: 27e10f3e Fix asciidoc argparse 26: ded79532 = 26: ba450f08 Export CC and CXX variables explicitly 27: 55058b8e = 27: 8e72e5d7 pacman.c: handle cr on stdin as well 28: 2850fdf0 = 28: a780e038 Add a CI job 29: 7e67e661 < -: -------- Fix building staticlibs with LTO -: -------- > 29: 8ef45fad Fix building staticlibs with LTO 30: a4cbed54 = 30: 1316ab44 Make lint_pkgbuild opt-in via MAKEPKG_LINT_PKGBUILD=1 31: 05f8bc82 < -: -------- libmakepkg: fix compatibility with bash-5.2 globskipdots ```