Unverified Commit cee28a1b authored by Levente Polyak's avatar Levente Polyak
Browse files

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.
parent e0f82d39
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment