Commit 7e803700 authored by picodotdev's avatar picodotdev

Replace yaourt with another AUR utility

parent 98844c0b
......@@ -28,7 +28,7 @@ Currently these scripts are for me but maybe they are useful for you too.
* Intel processors microcode
* Users creation and add to sudoers
* Common and custom packages installation
* yaourt installation
* AUR utility installation (aurman, yay)
* Retry packages download on conection/mirror error
* Desktop environments (GDM, KDE, XFCE, Mate, Cinnamon, LXDE), display managers (GDM, SDDM, Lightdm, lxdm) and no desktop environments
* Additional kernels installation (linux-lts, linux-hardened, linux-zen)
......
......@@ -55,23 +55,23 @@ PACKAGES_PACMAN_OTHERS="!klavaro !tmux"
PACKAGES_PACMAN_DEVELOPER="!jdk9-openjdk !python !dotnet-sdk !php !rust !go !virtualbox !docker !ansible !vagrant"
PACKAGES_PACMAN_CUSTOM=""
PACKAGES_YAOURT_INTERNET="!dropbox"
PACKAGES_YAOURT_MULTIMEDIA=""
PACKAGES_YAOURT_UTILITIES="!visual-studio-code-bin"
PACKAGES_YAOURT_DOCUMENTS_AND_TEXT="!wps-office"
PACKAGES_YAOURT_SECURITY="!freefilesync"
PACKAGES_YAOURT_SCIENCE=""
PACKAGES_YAOURT_OTHERS="!gnucash"
PACKAGES_YAOURT_DEVELOPER=""
PACKAGES_YAOURT_CUSTOM=""
PACKAGES_AUR_INTERNET="!dropbox"
PACKAGES_AUR_MULTIMEDIA=""
PACKAGES_AUR_UTILITIES="!visual-studio-code-bin"
PACKAGES_AUR_DOCUMENTS_AND_TEXT="!wps-office"
PACKAGES_AUR_SECURITY="!freefilesync"
PACKAGES_AUR_SCIENCE=""
PACKAGES_AUR_OTHERS="!gnucash"
PACKAGES_AUR_DEVELOPER=""
PACKAGES_AUR_CUSTOM=""
PACKAGES_PACMAN="$PACKAGES_PACMAN_INTERNET $PACKAGES_PACMAN_MULTIMEDIA $PACKAGES_PACMAN_UTILITIES $PACKAGES_PACMAN_DOCUMENTS_AND_TEXT $PACKAGES_PACMAN_SECURITY $PACKAGES_PACMAN_SCIENCE $PACKAGES_PACMAN_OTHERS $PACKAGES_PACMAN_DEVELOPER $PACKAGES_PACMAN_CUSTOM"
PACKAGES_YAOURT="$PACKAGES_YAOURT_INTERNET $PACKAGES_YAOURT_MULTIMEDIA $PACKAGES_YAOURT_UTILITIES $PACKAGES_YAOURT_DOCUMENTS_AND_TEXT $PACKAGES_YAOURT_SECURITY $PACKAGES_YAOURT_SCIENCE $PACKAGES_YAOURT_OTHERS $PACKAGES_YAOURT_DEVELOPER $PACKAGES_YAOURT_CUSTOM"
PACKAGES_PACMAN=$(echo $PACKAGES_PACMAN | sed "s/![^ ]*//g")
PACKAGES_YAOURT=$(echo $PACKAGES_YAOURT | sed "s/![^ ]*//g")
PACKAGES_AUR="$PACKAGES_AUR_INTERNET $PACKAGES_AUR_MULTIMEDIA $PACKAGES_AUR_UTILITIES $PACKAGES_AUR_DOCUMENTS_AND_TEXT $PACKAGES_AUR_SECURITY $PACKAGES_AUR_SCIENCE $PACKAGES_AUR_OTHERS $PACKAGES_AUR_DEVELOPER $PACKAGES_AUR_CUSTOM"
PACKAGES_PACMAN=$(echo $PACKAGES_PACMAN | sed "s/![^ ]*//g") # remove disabled packages
PACKAGES_AUR=$(echo $PACKAGES_AUR | sed "s/![^ ]*//g")
PACKAGES_PACMAN=$(echo $PACKAGES_PACMAN | sed "s/ {2,}/ /g")
PACKAGES_YAOURT=$(echo $PACKAGES_YAOURT | sed "s/ {2,}/ /g")
YAOURT="true"
PACKAGES_AUR=$(echo $PACKAGES_AUR | sed "s/ {2,}/ /g")
AUR="aurman" # aurman yay
#reboot
REBOOT="true"
......@@ -92,7 +92,7 @@ function check_variables() {
check_variables_value "USER_PASSWORD" "$USER_PASSWORD"
check_variables_size "ADDITIONAL_USER_PASSWORDS" "${#ADDITIONAL_USER_NAMES_ARRAY[@]}" "${#ADDITIONAL_USER_PASSWORDS_ARRAY[@]}"
check_variables_list "BOOTLOADER" "$BOOTLOADER" "grub refind systemd"
check_variables_boolean "YAOURT" "$YAOURT"
check_variables_list "AUR" "$AUR" "aurman yay"
check_variables_list "DESKTOP_ENVIRONMENT" "$DESKTOP_ENVIRONMENT" "gnome kde xfce mate cinnamon lxde" "false"
check_variables_list "DISPLAY_DRIVER" "$DISPLAY_DRIVER" "xf86-video-intel xf86-video-amdgpu xf86-video-ati nvidia nvidia-340xx nvidia-304xx xf86-video-nouveau" "false"
check_variables_boolean "REBOOT" "$REBOOT"
......@@ -186,9 +186,9 @@ function facts() {
CPU_INTEL="true"
fi
if [ -n "$(lspci | grep -i virtualbox)" ]; then
VIRTUALBOX="true"
fi
# if [ -n "$(lspci | grep -i virtualbox)" ]; then
# VIRTUALBOX="true"
# fi
}
function check_facts() {
......@@ -798,21 +798,27 @@ function packages() {
pacman_install "$PACKAGES_PACMAN"
fi
packages_yaourt
packages_aur
}
function packages_yaourt() {
if [ "$YAOURT" == "true" -o -n "$PACKAGES_YAOURT" ]; then
echo "" >> /mnt/etc/pacman.conf
echo "[archlinuxfr]" >> /mnt/etc/pacman.conf
echo "SigLevel=Optional TrustAll" >> /mnt/etc/pacman.conf
echo "Server=http://repo.archlinux.fr/\$arch" >> /mnt/etc/pacman.conf
function packages_aur() {
if [ -n "$AUR" -o -n "$PACKAGES_AUR" ]; then
pacman_install "git"
pacman_install "yaourt"
arch-chroot /mnt sed -i 's/%wheel ALL=(ALL) ALL/%wheel ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers
case "$AUR" in
"aurman" )
arch-chroot /mnt bash -c "echo -e \"$USER_PASSWORD\n$USER_PASSWORD\n$USER_PASSWORD\n$USER_PASSWORD\n\" | su $USER_NAME -c \"cd /home/$USER_NAME && git clone https://aur.archlinux.org/$AUR.git && gpg --recv-key 465022E743D71E39 && (cd $AUR && makepkg -si --noconfirm) && rm -rf $AUR\""
;;
"yay" )
arch-chroot /mnt bash -c "echo -e \"$USER_PASSWORD\n$USER_PASSWORD\n$USER_PASSWORD\n$USER_PASSWORD\n\" | su $USER_NAME -c \"cd /home/$USER_NAME && git clone https://aur.archlinux.org/$AUR.git && (cd $AUR && makepkg -si --noconfirm) && rm -rf $AUR\""
;;
esac
arch-chroot /mnt sed -i 's/%wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers
fi
if [ -n "$PACKAGES_YAOURT" ]; then
yaourt_install "$PACKAGES_YAOURT"
if [ -n "$PACKAGES_AUR" ]; then
aur_install "$PACKAGES_AUR"
fi
}
......@@ -853,7 +859,7 @@ function pacman_install() {
PACKAGES=$1
for VARIABLE in {1..5}
do
arch-chroot /mnt pacman -Sy --noconfirm $PACKAGES
arch-chroot /mnt pacman -Syu --noconfirm $PACKAGES
if [ $? == 0 ]; then
break
else
......@@ -862,11 +868,11 @@ function pacman_install() {
done
}
function yaourt_install() {
function aur_install() {
PACKAGES=$1
for VARIABLE in {1..5}
do
arch-chroot /mnt bash -c "echo -e \"$USER_PASSWORD\n$USER_PASSWORD\n$USER_PASSWORD\n$USER_PASSWORD\n\" | su $USER_NAME -c \"yaourt -Sy --noconfirm --needed $PACKAGES\""
arch-chroot /mnt bash -c "echo -e \"$USER_PASSWORD\n$USER_PASSWORD\n$USER_PASSWORD\n$USER_PASSWORD\n\" | su $USER_NAME -c \"$AUR -Syu --noconfirm --needed $PACKAGES\""
if [ $? == 0 ]; then
break
else
......
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