From d0b26ab433a4c184d06f0bdcf2ba962acbbe089d Mon Sep 17 00:00:00 2001 From: Mehdi Chinoune Date: Sat, 7 Aug 2021 21:47:26 +0100 Subject: [PATCH] Fix CI when the same PKGBUILD build conflicting packages. --- .ci/ci-build.sh | 73 +++++++++++++++++++++++++++++++---------------- .ci/ci-library.sh | 8 +----- 2 files changed, 49 insertions(+), 32 deletions(-) diff --git a/.ci/ci-build.sh b/.ci/ci-build.sh index 0004a5205d..fada6d99a6 100644 --- a/.ci/ci-build.sh +++ b/.ci/ci-build.sh @@ -46,33 +46,56 @@ for package in "${packages[@]}"; do MINGW_ARCH=mingw64 execute 'Building source' makepkg-mingw --noconfirm --noprogressbar --allsource echo "::endgroup::" - echo "::group::[install] ${package}" - execute 'Installing' install_packages - echo "::endgroup::" + if [ -f $package/.ci-sequential ]; then + cd "$package" + for pkg in *.pkg.tar.*; do + pkgname="$(echo "$pkg" | rev | cut -d- -f4- | rev)" + echo "::group::[install] ${pkgname}" + pacman --noprogressbar --upgrade --noconfirm $pkg + echo "::endgroup::" - echo "::group::[diff] ${package}" - cd "$package" - for pkg in *.pkg.tar.*; do - message "File listing diff for ${pkg}" - pkgname="$(echo "$pkg" | rev | cut -d- -f4- | rev)" - diff -Nur <(pacman -Fl "$pkgname" | sed -e 's|^[^ ]* |/|' | sort) <(pacman -Ql "$pkgname" | sed -e 's|^[^/]*||' | sort) || true - done - cd - > /dev/null - echo "::endgroup::" + echo "::group::[diff] ${pkgname}" + message "File listing diff for ${pkgname}" + diff -Nur <(pacman -Fl "$pkgname" | sed -e 's|^[^ ]* |/|' | sort) <(pacman -Ql "$pkgname" | sed -e 's|^[^/]*||' | sort) || true + echo "::endgroup::" - echo "::group::[uninstall] ${package}" - repo-add $PWD/artifacts/ci.db.tar.gz "${package}"/*.pkg.tar.* - pacman -Sy - message "Uninstalling $package" - cd "$package" - export installed_packages=() - for pkg in *.pkg.tar.*; do - installed_packages+=("$(echo "$pkg" | rev | cut -d- -f4- | rev)") - done - pacman -R --recursive --unneeded --noconfirm --noprogressbar "${installed_packages[@]}" - unset installed_packages - cd - > /dev/null - echo "::endgroup::" + echo "::group::[uninstall] ${pkgname}" + message "Uninstalling $pkgname" + repo-add $PWD/../artifacts/ci.db.tar.gz $PWD/$pkg + pacman -Sy + pacman -R --recursive --unneeded --noconfirm --noprogressbar "$pkgname" + echo "::endgroup::" + done + cd - > /dev/null + else + echo "::group::[install] ${package}" + execute 'Installing' install_packages + echo "::endgroup::" + + echo "::group::[diff] ${package}" + cd "$package" + for pkg in *.pkg.tar.*; do + message "File listing diff for ${pkg}" + pkgname="$(echo "$pkg" | rev | cut -d- -f4- | rev)" + diff -Nur <(pacman -Fl "$pkgname" | sed -e 's|^[^ ]* |/|' | sort) <(pacman -Ql "$pkgname" | sed -e 's|^[^/]*||' | sort) || true + done + cd - > /dev/null + echo "::endgroup::" + + echo "::group::[uninstall] ${package}" + repo-add $PWD/artifacts/ci.db.tar.gz "${package}"/*.pkg.tar.* + pacman -Sy + message "Uninstalling $package" + cd "$package" + export installed_packages=() + for pkg in *.pkg.tar.*; do + installed_packages+=("$(echo "$pkg" | rev | cut -d- -f4- | rev)") + done + pacman -R --recursive --unneeded --noconfirm --noprogressbar "${installed_packages[@]}" + unset installed_packages + cd - > /dev/null + echo "::endgroup::" + fi mv "${package}"/*.pkg.tar.* artifacts mv "${package}"/*.src.tar.* artifacts diff --git a/.ci/ci-library.sh b/.ci/ci-library.sh index 66ce542631..33e7b5825c 100644 --- a/.ci/ci-library.sh +++ b/.ci/ci-library.sh @@ -140,13 +140,7 @@ list_packages() { } install_packages() { - if [ -f .ci-sequential ]; then - for pkg in *.pkg.tar.*; do - pacman --noprogressbar --upgrade --noconfirm $pkg - done - else - pacman --noprogressbar --upgrade --noconfirm *.pkg.tar.* - fi + pacman --noprogressbar --upgrade --noconfirm *.pkg.tar.* } # Recipe quality