bootstrap: Change yay to paru for pkg installation

This commit is contained in:
Marty Oehme 2023-06-08 13:03:27 +02:00
parent 79910b8bf1
commit bfe7e7790c
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -36,16 +36,16 @@ main() {
exit $ret
}
install_yay() {
# check for existing yay installation
if type yay >/dev/null 2>&1; then
echo "Existing yay installation found ..........................................."
install_paru() {
# check for existing paru installation
if type paru >/dev/null 2>&1; then
echo "Existing paru installation found ..........................................."
return
fi
# use tmp dir to make yay
# use tmp dir to make paru
target=$(mktemp -d)
git clone https://aur.archlinux.org/yay.git "$target"
git clone https://aur.archlinux.org/paru.git "$target"
cd "$target" || exit
makepkg -si
}
@ -53,27 +53,27 @@ install_yay() {
update_repos() {
unattended="$1"
if "$unattended"; then
yay -Sqyy --noconfirm
paru -Sqyy --noconfirm
else
yay -Syy
paru -Syy
fi
}
install_packages() {
unattended="$1"
if "$unattended"; then
echo "$packages_repo" "$packages_aur" | yay -Squ --noconfirm --needed -
echo "$packages_repo" "$packages_aur" | paru -Squ --noconfirm --needed -
else
echo "$packages_repo" | yay -Squ --needed -
echo "$packages_aur" | yay -S --needed -
echo "$packages_repo" | paru -Squ --needed -
echo "$packages_aur" | paru -S --needed -
fi
}
install() {
unattended=$1
echo "Beginning package bootstrap ..............................................."
echo "Installing yay ............................................................"
install_yay
echo "Installing paru ............................................................"
install_paru
echo "Installing apps ..........................................................."
update_repos "$unattended"
install_packages "$unattended"