@@ -10,6 +10,7 @@ set -e -u
1010
1111aur_username=" aurbuild"
1212pacman_debug=true
13+ pacman_args=()
1314
1415trap ' exit 1' 1 2 3 15
1516
@@ -72,18 +73,26 @@ pacman-key --populate
7273# Un comment the mirror list.
7374# sed -i "s/#Server/Server/g" "/etc/pacman.d/mirrorlist"
7475
76+ # Set pacman args
77+ pacman_args=(" --config" " /etc/alteriso-pacman.conf" " --noconfirm" )
78+ if [[ " ${pacman_debug} " = true ]]; then
79+ pacman_args+=(" --debug" )
80+ fi
81+
7582# Install yay
7683if ! pacman -Qq yay 1> /dev/null 2>&1 ; then
7784 (
7885 _oldpwd=" $( pwd) "
79- pacman -Syy --noconfirm --config " /etc/alteriso-pacman.conf "
80- pacman --noconfirm - S --asdeps --needed go --config " /etc/alteriso-pacman.conf "
86+ pacman -Syy " ${pacman_args[@]} "
87+ pacman -S --asdeps --needed " ${pacman_args[@]} " go
8188 sudo -u " ${aur_username} " git clone " https://aur.archlinux.org/yay.git" " /tmp/yay"
8289 cd " /tmp/yay"
8390 sudo -u " ${aur_username} " makepkg --ignorearch --clean --cleanbuild --force --skippgpcheck --noconfirm
84- pacman --noconfirm --config " /etc/alteriso-pacman.conf" -U $( sudo -u " ${aur_username} " makepkg --packagelist)
91+ for _pkg in $( sudo -u " ${aur_username} " makepkg --packagelist) ; do
92+ pacman " ${pacman_args[@]} " -U " ${_pkg} "
93+ done
8594 cd ..
86- rm -rf " /tmp/yay"
95+ remove " /tmp/yay"
8796 cd " ${_oldpwd} "
8897 )
8998fi
@@ -101,7 +110,6 @@ for _pkg in "${@}"; do
101110 yay -Sy \
102111 --mflags " -AcC" \
103112 --aur \
104- --noconfirm \
105113 --nocleanmenu \
106114 --nodiffmenu \
107115 --noeditmenu \
@@ -111,7 +119,7 @@ for _pkg in "${@}"; do
111119 --useask \
112120 --color always \
113121 --mflags " --skippgpcheck" \
114- --config " /etc/alteriso-pacman.conf " \
122+ " ${pacman_args[@]} " \
115123 --cachedir " /var/cache/pacman/pkg/" \
116124 " ${_pkg} "
117125
@@ -121,7 +129,7 @@ for _pkg in "${@}"; do
121129 fi
122130done
123131
124- yay -Sccc --noconfirm --config " /etc/alteriso-pacman.conf "
132+ yay -Sccc " ${pacman_args[@]} "
125133
126134# remove user and file
127135userdel " ${aur_username} "
0 commit comments