Skip to content

Commit

Permalink
Merge branch 'msys2:master' into joe
Browse files Browse the repository at this point in the history
  • Loading branch information
dlmiles authored May 12, 2023
2 parents 2ad8fc3 + 45067a7 commit f67b6be
Show file tree
Hide file tree
Showing 84 changed files with 1,840 additions and 1,000 deletions.
65 changes: 64 additions & 1 deletion .ci/ci-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ set -eo pipefail
DIR="$( cd "$( dirname "$0" )" && pwd )"

# Configure
source "$DIR/ci-library.sh"
mkdir artifacts
git remote add upstream 'https://github.com/MSYS2/MSYS2-packages'
git fetch --quiet upstream
Expand All @@ -18,6 +17,70 @@ sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf

pacman --noconfirm -Fy

# Enable colors
normal=$(tput sgr0)
red=$(tput setaf 1)
green=$(tput setaf 2)
cyan=$(tput setaf 6)

# Basic status function
_status() {
local type="${1}"
local status="${package:+${package}: }${2}"
local items=("${@:3}")
case "${type}" in
failure) local -n nameref_color='red'; title='[MSYS2 CI] FAILURE:' ;;
success) local -n nameref_color='green'; title='[MSYS2 CI] SUCCESS:' ;;
message) local -n nameref_color='cyan'; title='[MSYS2 CI]'
esac
printf "\n${nameref_color}${title}${normal} ${status}\n\n"
printf "${items:+\t%s\n}" "${items:+${items[@]}}"
}

# Run command with status
execute(){
local status="${1}"
local command="${2}"
local arguments=("${@:3}")
cd "${package:-.}"
message "${status}"
if [[ "${command}" != *:* ]]
then ${command} ${arguments[@]}
else ${command%%:*} | ${command#*:} ${arguments[@]}
fi || failure "${status} failed"
cd - > /dev/null
}

# Get changed packages in correct build order
list_packages() {
# readarray doesn't work with a plain pipe
readarray -t packages < <("$DIR/ci-get-build-order.py")
}

install_packages() {
pacman --noprogressbar --upgrade --noconfirm *.pkg.tar.*
}

# List DLL dependencies
list_dll_deps(){
local target="${1}"
echo "$(tput setaf 2)MSYS2 DLL dependencies:$(tput sgr0)"
find "$target" -regex ".*\.\(exe\|dll\)" -print0 | xargs -0 -r ldd | GREP_COLOR="1;35" grep --color=always "msys-.*\|" \
|| echo " None"
}

list_dll_bases(){
local target="${1}"
echo "$(tput setaf 2)MSYS2 DLL bases:$(tput sgr0)"
find "$target" -regex ".*\.\(exe\|dll\)" -print | rebase -iT - | GREP_COLOR="1;35" grep --color=always "msys-.*\|" \
|| echo " None"
}

# Status functions
failure() { local status="${1}"; local items=("${@:2}"); _status failure "${status}." "${items[@]}"; exit 1; }
success() { local status="${1}"; local items=("${@:2}"); _status success "${status}." "${items[@]}"; exit 0; }
message() { local status="${1}"; local items=("${@:2}"); _status message "${status}" "${items[@]}"; }

# Detect
list_packages || failure 'Could not detect changed files'
message 'Processing changes'
Expand Down
236 changes: 0 additions & 236 deletions .ci/ci-generate-srcinfo.py

This file was deleted.

69 changes: 0 additions & 69 deletions .ci/ci-library.sh

This file was deleted.

Loading

0 comments on commit f67b6be

Please sign in to comment.