summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLevente Polyak <anthraxx@archlinux.org>2019-11-30 13:09:14 +0100
committerLevente Polyak <anthraxx@archlinux.org>2019-11-30 13:25:06 +0100
commitcee28a1b13ddd0f60b2466b20a43f04a4bf5df54 (patch)
treebd745f25fabc36418a3b8380aff7605a05742d33
parente0f82d394717efb28537f0a366b4a5b3515354b6 (diff)
downloaddevtools-cee28a1b13ddd0f60b2466b20a43f04a4bf5df54.tar.xz
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.
-rw-r--r--makechrootpkg.in18
1 files 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