From f97cc670e437f1ee23bf5d50aefdfc95d2236ff5 Mon Sep 17 00:00:00 2001 From: Qian Hong Date: Thu, 18 Feb 2016 12:12:33 +0800 Subject: [PATCH] CI: Update core packages before full system upgrade. --- appveyor.yml | 2 ++ ci-build.sh | 13 ++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f9613965..52d43ae0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,2 +1,4 @@ build_script: + # TODO: implement update-core --noconfirm and replace the below command line + - C:\msys64\usr\bin\pacman --sync --refresh --refresh --needed --noconfirm msys2-runtime msys2-runtime-devel bash pacman pacman-mirrors - C:\msys64\usr\bin\bash --login -c "$(cygpath ${APPVEYOR_BUILD_FOLDER})/ci-build.sh" diff --git a/ci-build.sh b/ci-build.sh index e30cd7de..b28c6128 100644 --- a/ci-build.sh +++ b/ci-build.sh @@ -15,13 +15,7 @@ status() { echo -e "\n${cyan}[MSYS2 CI]${normal} ${@}\n"; } success() { echo -e "\n${green}[MSYS2 CI] SUCCESS:${normal} ${@}.\n"; exit 0; } failure() { echo -e "\n${red}[MSYS2 CI] FAILURE:${normal} ${@}.\n"; exit 1; } gitconf() { test -n "$(git config ${1})" && return 0; git config --global "${1}" "${2}"; } -execute() { status "${package:+$package: }${1}"; ${@:2} || failure "${package}: ${1} failed"; } - -# Prepare -# TODO: implement update-core --noconfirm and move update process to outside this script -execute 'Upgrading the system' pacman --sync --refresh --refresh --sysupgrade --noconfirm --noprogressbar -gitconf user.name 'MSYS2 Continuous Integration' || failure 'Could not configure Git for makepkg' -gitconf user.email 'ci@msys2.org' || failure 'Could not configure Git for makepkg' +execute() { status "${package:+$package: }${1}"; ${@:2} || failure "${package:+$package: }${1} failed"; } # Detect cd "$(dirname "$0")" @@ -31,6 +25,11 @@ for file in "${files[@]}"; do [[ "${file}" = */PKGBUILD ]] && packages+=("${file test -n "${files}" || failure 'Could not detect changed files' test -z "${packages}" && success 'No changes in package recipes' +# Prepare +execute 'Upgrading the system' pacman --sync --refresh --refresh --sysupgrade --noconfirm --noprogressbar +gitconf user.name 'MSYS2 Continuous Integration' || failure 'Could not configure Git for makepkg' +gitconf user.email 'ci@msys2.org' || failure 'Could not configure Git for makepkg' + # Build and install status 'Building changed packages:' for package in "${packages[@]}"; do printf "\t${package}\n"; done