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.1.0 #45

Closed lazka closed 1 month ago

lazka commented 1 month ago

Rebase diary:

Minimal rebase with things squashed. Cleanups and backports can come later.

range diff:

```diff 1: bf8bd982 = 1: 263408fe makepkg: clean up more things 2: 1fbb46db < -: -------- makepkg: bash v4 compat 3: 261911e6 < -: -------- makepkg: find_libdepends: port to Windows 4: c8025392 ! 2: 93009536 makepkg: build env export @@ Commit message this should be moved to the other exports really.. ## scripts/makepkg.sh.in ## -@@ scripts/makepkg.sh.in: mkdir -p "$srcdir" +@@ scripts/makepkg.sh.in: fi + 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 5: e17f3254 < -: -------- makepkg: find_libprovides: port to Windows 6: 6a848dc2 < -: -------- fill_progress -: -------- > 3: 7429136e fill_progress 7: 4c61f908 = 4: 369fbad8 test fixes 8: 5bff0d92 ! 5: a7bc88cd Remove everything related to sudo/fakeroot/file permissions @@ scripts/libmakepkg/executable/meson.build: sources = [ 'checksum.sh.in', 'distcc.sh.in', - 'fakeroot.sh.in', + 'debugedit.sh.in', 'gpg.sh.in', 'gzip.sh.in', 'pacman.sh.in', @@ scripts/makepkg.sh.in: run_pacman() { local lockfile="$(pacman-conf DBPath)/db.lck" while [[ -f $lockfile ]]; do @@ scripts/makepkg.sh.in: write_pkginfo() { - merge_arch_attrs + generate_autodeps printf "# Generated by makepkg %s\n" "$makepkg_version" - printf "# using %s\n" "$(fakeroot -v)" @@ scripts/makepkg.sh.in: if ! type -p gettext >/dev/null; then ARGLIST=("$@") # Parse Command Line Options. --OPT_SHORT="AcCdefFghiLmop:rRsSV" -+OPT_SHORT="AcCdefghiLmop:rRsSV" - OPT_LONG=('allsource' 'check' 'clean' 'cleanbuild' 'config:' 'force' 'geninteg' +-OPT_SHORT="AcCdD:efFghiLmop:rRsSV" ++OPT_SHORT="AcCdD:efghiLmop:rRsSV" + OPT_LONG=('allsource' 'check' 'clean' 'cleanbuild' 'config:' 'dir:' 'force' 'geninteg' 'help' 'holdver' 'ignorearch' 'install' 'key:' 'log' 'noarchive' 'nobuild' 'nocolor' 'nocheck' 'nodeps' 'noextract' 'noprepare' 'nosign' 'packagelist' @@ scripts/makepkg.sh.in: while true; do - -d|--nodeps) NODEPS=1 ;; + -D|--dir) shift; CHDIR=$1 ;; -e|--noextract) NOEXTRACT=1 ;; -f|--force) FORCE=1 ;; - -F) INFAKEROOT=1 ;; # generating integrity checks does not depend on architecture -g|--geninteg) BUILDPKG=0 GENINTEG=1 IGNOREARCH=1;; --holdver) HOLDVER=1 ;; +@@ scripts/makepkg.sh.in: while [[ $1 ]]; do + shift + done + +-if (( ! INFAKEROOT )) && [[ -n $CHDIR ]]; then ++if [[ -n $CHDIR ]]; then + cd_safe "$CHDIR" + fi + @@ scripts/makepkg.sh.in: if (( LOGGING )) && ! ensure_writable_dir "LOGDEST" "$LOGDEST"; then exit $E_FS_PERMISSIONS fi @@ scripts/makepkg.sh.in: if (( LOGGING )) && ! ensure_writable_dir "LOGDEST" "$LOG - unset pkgname "${pkgbuild_schema_strings[@]}" "${pkgbuild_schema_arrays[@]}" unset "${known_hash_algos[@]/%/sums}" - unset -f pkgver prepare build check package "${!package_@}" + unset -f pkgver verify prepare build check package "${!package_@}" @@ scripts/makepkg.sh.in: if (( ! PKGVERFUNC )); then check_build_status fi @@ scripts/makepkg.sh.in: if (( ! PKGVERFUNC )); then - exit $E_OK -fi - - msg "$(gettext "Making package: %s")" "$pkgbase $basever ($(date +%c))" + # check we have the software required to process the PKGBUILD + check_software || exit $E_MISSING_MAKEPKG_DEPS - # if we are creating a source-only package, go no further @@ scripts/makepkg.sh.in: if (( SOURCEONLY )); then check_source_integrity all cd_safe "$startdir" @@ test/pacman/pmtest.py: def run(self, pacman): cmd = [] - if os.geteuid() != 0: -- fakeroot = util.which("fakeroot") -- if not fakeroot: -- tap.diag("WARNING: fakeroot not found!") -- else: -- cmd.append("fakeroot") -- +- # fakechroot must be called before fakeroot due to potential +- # potential interactions when wrapping the same C functions - fakechroot = util.which("fakechroot") - if not fakechroot: - tap.diag("WARNING: fakechroot not found!") - else: - cmd.append("fakechroot") +- +- fakeroot = util.which("fakeroot") +- if not fakeroot: +- tap.diag("WARNING: fakeroot not found!") +- else: +- cmd.append("fakeroot") - if pacman["gdb"]: cmd.extend(["libtool", "execute", "gdb", "--args"]) 9: 6b51761d ! 6: c25dbd11 change shebang @@ scripts/pacman-db-upgrade.sh.in # # pacman-db-upgrade - upgrade the local pacman db to a newer format # +@@ + # along with this program. If not, see . + # + ++set -e ++ + # Avoid creating world-unreadable files + umask 022 + ## scripts/pacman-key.sh.in ## @@ 10: 43fb1e08 ! 7: 47fb6fb8 Set fixed paths for various tools @@ scripts/pacman-db-upgrade.sh.in: lockfile="${dbroot}/db.lck" touch "$lockfile" ## scripts/pacman-key.sh.in ## -@@ scripts/pacman-key.sh.in: LIBRARY=${LIBRARY:-'@libmakepkgdir@'} +@@ scripts/pacman-key.sh.in: MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'} # Import libmakepkg - source "$LIBRARY"/util/message.sh - source "$LIBRARY"/util/parseopts.sh -+source "$LIBRARY"/utils_fixed_path.sh + source "$MAKEPKG_LIBRARY"/util/message.sh + source "$MAKEPKG_LIBRARY"/util/parseopts.sh ++source "$MAKEPKG_LIBRARY"/utils_fixed_path.sh # Options ADD=0 @@ scripts/pacman-key.sh.in: import_trustdb() { for importdir in "$@"; do if [[ -f "${importdir}/trustdb.gpg" ]]; then - gpg --homedir "${importdir}" --export-ownertrust | \ -+ /bin/gpg --homedir "${importdir}" --export-ownertrust | \ ++ /usr/bin/gpg --homedir "${importdir}" --export-ownertrust | \ "${GPG_PACMAN[@]}" --import-ownertrust - if (( PIPESTATUS )); then error "$(gettext "%s could not be imported.")" "${importdir}/trustdb.gpg" @@ scripts/pacman-key.sh.in: updatedb() { ## scripts/repo-add.sh.in ## -@@ scripts/repo-add.sh.in: PREVENT_DOWNGRADE=0 - # Import libmakepkg - source "$LIBRARY"/util/compress.sh - source "$LIBRARY"/util/message.sh -+source "$LIBRARY"/utils_fixed_path.sh +@@ scripts/repo-add.sh.in: DB_MODIFIED=0 + source "$MAKEPKG_LIBRARY"/util/compress.sh + source "$MAKEPKG_LIBRARY"/util/message.sh + source "$MAKEPKG_LIBRARY"/util/parseopts.sh ++source "$MAKEPKG_LIBRARY"/utils_fixed_path.sh # ensure we have a sane umask set umask 0022 11: 438e2383 = 8: b5f583d6 makepkg: port staticlibs to Windows 12: 3077636f ! 9: 48411ee3 makepkg: port strip/debug to Windows @@ Metadata ## Commit message ## makepkg: port strip/debug to Windows + ## scripts/libmakepkg/executable/meson.build ## +@@ scripts/libmakepkg/executable/meson.build: sources = [ + 'ccache.sh.in', + 'checksum.sh.in', + 'distcc.sh.in', +- 'debugedit.sh.in', + 'gpg.sh.in', + 'gzip.sh.in', + 'pacman.sh.in', + ## scripts/libmakepkg/tidy/strip.sh.in ## @@ scripts/libmakepkg/tidy/strip.sh.in: packaging_options+=('strip' 'debug') tidy_modify+=('tidy_strip') @@ scripts/libmakepkg/tidy/strip.sh.in: packaging_options+=('strip' 'debug') - - LANG=C debugedit --no-recompute-build-id \ - --base-dir "${srcdir}" \ -- --dest-dir "${dbgsrcdir}/${pkgbase}" \ +- --dest-dir "${dbgsrcdir}" \ - --list-file /dev/stdout "$1" \ - | sort -zu | tr '\0' '\n' -} - - strip_file() { +-package_source_files() { +- local binary=$1 +- +- local file dest t +- while IFS= read -r t; do +- file="${srcdir}/${t}" +- dest="${dbgsrc}/${t}" +- mkdir -p "${dest%/*}" +- if [[ -f "$file" ]]; then +- cp -- "$file" "$dest" +- fi +- done < <(source_files "$binary") +-} +- + collect_debug_symbols() { local binary=$1; shift - if check_option "debug" "y"; then @@ scripts/libmakepkg/tidy/strip.sh.in: packaging_options+=('strip' 'debug') - fi - - # copy source files to debug directory -- local file dest t -- while IFS= read -r t; do -- file="${srcdir}/${t}" -- dest="${dbgsrc}/${t}" -- if [[ -f "$file" ]] && ! [[ -f $dest ]]; then -- mkdir -p "${dest%/*}" -- cp -- "$file" "$dest" -- fi -- done < <(source_files "$binary") -- +- package_source_files "$binary" + - # copy debug symbols to debug directory - mkdir -p "$dbgdir/${binary%/*}" -- -- # 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" -- rm "$tempfile" -- -- # create any needed hardlinks -- while IFS= read -rd '' file ; do -- if [[ "${binary}" -ef "${file}" && ! -f "$dbgdir/${file}.debug" ]]; then -- mkdir -p "$dbgdir/${file%/*}" -- 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 debug symbols to debug directory + mkdir -p "$dbgdir/${binary%/*}" + msg2 "Separating debug info from $binary into $dbgdir/$binary.debug" @@ scripts/libmakepkg/tidy/strip.sh.in: packaging_options+=('strip' 'debug') + fi + done < <(find . -type f -perm -u+w -print0 2>/dev/null) +- # 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" +- rm "$tempfile" +- +- # create any needed hardlinks +- while IFS= read -rd '' file ; do +- if [[ "${binary}" -ef "${file}" && ! -f "$dbgdir/${file}.debug" ]]; then +- mkdir -p "$dbgdir/${file%/*}" +- 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}" +- - target="../../../../../${binary#./}" - target="${target/..\/..\/usr\/lib\/}" - target="${target/..\/usr\/}" @@ scripts/libmakepkg/tidy/strip.sh.in: packaging_options+=('strip' 'debug') - - target="../../${binary#./}.debug" - ln -s "$target" "$dbgdir/.build-id/${bid:0:2}/${bid:2}.debug" - fi +- fi - fi + ;; + esac + } - local tempfile=$(mktemp "$binary.XXXXXX") - if strip "$@" "$binary" -o "$tempfile"; then + strip_file(){ @@ scripts/libmakepkg/tidy/strip.sh.in: tidy_strip() { + [[ -z ${STRIP_STATIC+x} ]] && STRIP_STATIC="-S" if check_option "debug" "y"; then - - dbgdir="$pkgdirbase/$pkgbase-@DEBUGSUFFIX@/usr/lib/debug" + dbgdir="$pkgdirbase/$pkgbase-@DEBUGSUFFIX@" - dbgsrcdir="${DBGSRCDIR:-/usr/src/debug}" + dbgsrcdir="${DBGSRCDIR:-/usr/src/debug}/${pkgbase}" 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 +- find . -type f -perm -u+w -print0 2>/dev/null | LC_ALL=C sort -z | while IFS= read -rd '' binary ; do +- # skip filepaths that cause stripping issues - ideally these should be temporary +- # guile-2.2 +- [[ "$binary" =~ .*/guile/.*\.go$ ]] && continue +- +- local STATICLIB=0 +- case "$(LC_ALL=C readelf -h "$binary" 2>/dev/null)" in +- *Type:*'DYN (Shared object file)'*) # Libraries (.so) or Relocatable binaries + # *.so: Apache2 modules, OCaml stublibs, Ruby modules + # *.oct: Octave modules + # *.cmxs: OCaml natdynlink modules: http://gallium.inria.fr/~frisch/ndl.txt @@ scripts/libmakepkg/tidy/strip.sh.in: tidy_strip() { + -o -type f -executable ! -name '*.dll' ! -name '*.exe' ! -name '*.so' ! -name '*.so.[0-9]*' ! -name '*.oct' ! -name '*.cmxs' ! -name '*.a' ! -name '*.la' ! -name '*.lib' ! -name '*.exe.manifest' ! -name '*.exe.config' ! -name '*.dll.config' ! -name '*.mdb' ! -name '*-config' ! -name '*.csh' ! -name '*.sh' ! -name '*.pl' ! -name '*.pm' ! -name '*.py' ! -name '*.rb' ! -name '*.tcl' -print0 | \ + while IFS= read -d $'\0' binary + do - local STRIPLTO=0 -- case "$(LC_ALL=C readelf -h "$binary" 2>/dev/null)" in -- *Type:*'DYN (Shared object file)'*) # Libraries (.so) or Relocatable binaries ++ local STRIPLTO=0 + # Skip thin archives from stripping + case "${binary##*/}" in + *.a) 13: 29014bdc = 10: 04fe09fb makepkg: lint_package: Warn on package files referencing absolute Windows paths 14: 235ea43e < -: -------- More debugging info 15: 3efdc22f ! 11: d27305d9 Core update @@ lib/libalpm/alpm.h: int alpm_trans_release(alpm_handle_t *handle); * If the package was loaded by alpm_pkg_load(), it will be freed upon ## lib/libalpm/package.c ## -@@ lib/libalpm/package.c: int SYMEXPORT alpm_pkg_should_ignore(alpm_handle_t *handle, alpm_pkg_t *pkg) +@@ lib/libalpm/package.c: int _alpm_pkg_check_meta(alpm_pkg_t *pkg) - return 0; + return error_found; } + +#ifdef __MSYS__ @@ lib/libalpm/package.c: int SYMEXPORT alpm_pkg_should_ignore(alpm_handle_t *handl + strcmp(pkg->name, "mintty") == 0 || + strcmp(pkg->name, "msys2-runtime") == 0 || + strcmp(pkg->name, "msys2-runtime-devel") == 0 || ++ strncmp(pkg->name, "msys2-runtime-", ++ strlen("msys2-runtime-")) == 0 || + strcmp(pkg->name, "pacman") == 0 || + strcmp(pkg->name, "pacman-mirrors") == 0; +} 16: 0855e7f7 ! 12: ff554d9b Remove ldconfig @@ test/pacman/meson.build: pacman_tests = [ @@ test/pacman/meson.build: foreach input : pacman_tests join_paths(meson.current_source_dir(), 'pactest.py'), '--scriptlet-shell', get_option('scriptlet-shell'), - '--bindir', meson.build_root(), + '--bindir', meson.project_build_root(), - '--ldconfig', LDCONFIG, '--verbose', join_paths(meson.current_source_dir(), input) 17: fd1fffaf = 13: 9bbf5bd1 Change the epoch separator 18: 0839de12 = 14: 40a0e295 makepkg: avoid creating .tar files with extended attributes 19: d694a347 = 15: 3f56dd2a pacman/libalpm: ignore file conflicts for foo.exe -> foo renames 20: 864894b8 ! 16: 73ca7afc Change default answer of all queries to yes @@ Commit message ## src/pacman/callback.c ## @@ src/pacman/callback.c: void cb_question(void *ctx, 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) { -- q->remove = noyes(_("%s and %s are in conflict. Remove %s?"), -+ q->remove = yesno(_("%s and %s are in conflict. Remove %s?"), - q->conflict->package1, - q->conflict->package2, - q->conflict->package2); + if(strcmp(alpm_pkg_get_name(q->conflict->package1), q->conflict->reason->name) == 0 + || strcmp(alpm_pkg_get_name(q->conflict->package2), q->conflict->reason->name) == 0) { +- q->remove = noyes(_("%s-%s%s%s and %s-%s%s%s are in conflict. Remove %s?"), ++ q->remove = yesno(_("%s-%s%s%s and %s-%s%s%s are in conflict. Remove %s?"), + alpm_pkg_get_name(q->conflict->package1), + colstr->faint, + alpm_pkg_get_version(q->conflict->package1), +@@ src/pacman/callback.c: void cb_question(void *ctx, alpm_question_t *question) + colstr->nocolor, + alpm_pkg_get_name(q->conflict->package2)); } else { -- q->remove = noyes(_("%s and %s are in conflict (%s). Remove %s?"), -+ q->remove = yesno(_("%s and %s are in conflict (%s). Remove %s?"), - q->conflict->package1, - q->conflict->package2, - q->conflict->reason->name, +- q->remove = noyes(_("%s-%s%s%s and %s-%s%s%s are in conflict (%s). Remove %s?"), ++ q->remove = yesno(_("%s-%s%s%s and %s-%s%s%s are in conflict (%s). Remove %s?"), + alpm_pkg_get_name(q->conflict->package1), + colstr->faint, + alpm_pkg_get_version(q->conflict->package1), @@ src/pacman/callback.c: void cb_question(void *ctx, alpm_question_t *question) count)); list_display(" ", namelist, getcols()); 21: f973a61a ! 17: 4dfb0ee4 Use pipe instead of socket @@ lib/libalpm/util.c +#ifndef __MSYS__ #include +#endif + #include #include #include - #include @@ lib/libalpm/util.c: static int _alpm_chroot_write_to_child(alpm_handle_t *handle, int fd, _alpm_cb_io out_cb, void *cb_ctx) { 22: ae18ca4f ! 18: 3c173477 pacman: make file list comparisons between packages case insensitive @@ lib/libalpm/filelist.c: static int _alpm_files_cmp(const void *f1, const void *f + return _cmppath(file1->name, file2->name); } - alpm_file_t SYMEXPORT *alpm_filelist_contains(alpm_filelist_t *filelist, + alpm_file_t SYMEXPORT *alpm_filelist_contains(const alpm_filelist_t *filelist, @@ lib/libalpm/filelist.c: void _alpm_filelist_sort(alpm_filelist_t *filelist) { size_t i; 23: 6866c7d8 < -: -------- Translate MSYS2 specific messages into Japanese 24: 1237e5c3 = 19: 36980afa Workaround compressing packages with bsdtar under Active Directory account 25: d3e36393 = 20: 5b73927a Fix asciidoc argparse 26: 10cd1c5d < -: -------- Export CC and CXX variables explicitly -: -------- > 21: c19fd98c Export CC and CXX variables explicitly 27: 4fecac86 = 22: ee219d0a pacman.c: handle cr on stdin as well 28: 63de6f62 = 23: 21c03c01 Add a CI job 29: 322b34be < -: -------- Fix building staticlibs with LTO -: -------- > 24: 64311bb8 Fix building staticlibs with LTO 30: ab633a20 = 25: 65f028bd Make lint_pkgbuild opt-in via MAKEPKG_LINT_PKGBUILD=1 31: 4cfaf539 < -: -------- libmakepkg: fix compatibility with bash-5.2 patsub_replacement 32: 49033430 = 26: 036f1763 pacman-key: pass --allow-weak-key-signatures during import 33: fb822167 < -: -------- fixup! change shebang 34: 47d0b2bf < -: -------- Revert "makepkg: bash v4 compat" 35: 1f023f9f < -: -------- fixup! Set fixed paths for various tools 36: bfe70fa6 < -: -------- fixup! Core update 37: 2ab815f2 < -: -------- Revert "More debugging info" -: -------- > 27: 9a49cdf4 Disable autodep scripts ```
lazka commented 1 month ago

Next some backports