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.
This commit is contained in:
parent
e0f82d3947
commit
cee28a1b13
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue