Increase the number of installation attempts for AUR packages

We do this for regular non-AUR packages, let's do this for AUR packages too.

Also check what packages are missing in the AUR and show them.
This commit is contained in:
Kron4ek 2023-08-11 13:34:29 +05:00 committed by GitHub
parent a70666155a
commit 72b7dd36d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -93,6 +93,27 @@ install_packages () {
fi fi
} }
install_aur_packages () {
cd /home/aur
echo "Checking if packages are present in the AUR, please wait..."
for p in ${aur_pkgs}; do
if ! yay -a -G "${p}" &>/dev/null; then
bad_aur_pkglist="${bad_aur_pkglist} ${p}"
fi
done
if [ -n "${bad_aur_pkglist}" ]; then
echo ${bad_aur_pkglist} > /home/aur/bad_aur_pkglist.txt
fi
for i in {1..10}; do
if yay --needed --noconfirm --removemake --nocleanmenu --nodiffmenu --builddir /home/aur -a -S ${aur_pkgs}; then
break
fi
done
}
generate_localegen () { generate_localegen () {
cat <<EOF > locale.gen cat <<EOF > locale.gen
ar_EG.UTF-8 UTF-8 ar_EG.UTF-8 UTF-8
@ -297,7 +318,9 @@ if [ -n "${aur_packagelist}" ]; then
done done
export aur_pkgs export aur_pkgs
CHROOT_AUR=1 HOME=/home/aur run_in_chroot yay --noconfirm --removemake --nocleanmenu --nodiffmenu --builddir /home/aur -a -S ${aur_pkgs} export -f install_aur_packages
CHROOT_AUR=1 HOME=/home/aur run_in_chroot bash -c install_aur_packages
mv "${bootstrap}"/home/aur/bad_aur_pkglist.txt "${bootstrap}"/opt
rm -rf "${bootstrap}"/home/aur rm -rf "${bootstrap}"/home/aur
fi fi
@ -333,3 +356,11 @@ if [ -f "${bootstrap}"/opt/bad_pkglist.txt ]; then
cat "${bootstrap}"/opt/bad_pkglist.txt cat "${bootstrap}"/opt/bad_pkglist.txt
rm "${bootstrap}"/opt/bad_pkglist.txt rm "${bootstrap}"/opt/bad_pkglist.txt
fi fi
if [ -f "${bootstrap}"/opt/bad_aur_pkglist.txt ]; then
echo
echo "These packages are either not in the AUR or yay failed to download their"
echo "PKGBUILDs:"
cat "${bootstrap}"/opt/bad_aur_pkglist.txt
rm "${bootstrap}"/opt/bad_aur_pkglist.txt
fi