From cee28a1b13ddd0f60b2466b20a43f04a4bf5df54 Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Sat, 30 Nov 2019 13:09:14 +0100 Subject: makechrootpkg: check local pkg versions before downloading for checkpkg Avoid always trying to download and output the according message. Add checks for packages either not being available in the repo or all variants have up to date versions stored in the local cache. --- makechrootpkg.in | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/makechrootpkg.in b/makechrootpkg.in index b3a1854..3fc599e 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -387,13 +387,19 @@ if (( ret != 0 )); then else if (( run_checkpkg )); then msg "Running checkpkg" - msg2 "Downloading current versions" - if pacman --noconfirm -Swdd --logfile /dev/null "${pkgnames[@]}"; then - msg2 "Checking packages" - sudo -u "$makepkg_user" checkpkg --rmdir --warn - else - warning "Skipped checkpkg due to missing packages" + remotepkgs=($(pacman -Sddp --logfile /dev/null "${pkgnames[@]}")) + if (( $? )); then + warning "Skipped checkpkg due to missing repo packages" + exit 0 fi + for remotepkg in ${remotepkgs[@]}; do + [[ $remotepkg == file://* ]] && continue + msg2 "Downloading current versions" + pacman --noconfirm -Swdd --logfile /dev/null "${pkgnames[@]}" + break + done + msg2 "Checking packages" + sudo -u "$makepkg_user" checkpkg --rmdir --warn fi true fi -- cgit v1.2.3-70-g09d2