File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ set -e -u
1111aur_username=" aurbuild"
1212pacman_debug=false
1313pacman_args=()
14+ failedpkg=()
1415
1516trap ' exit 1' 1 2 3 15
1617
@@ -102,12 +103,7 @@ if ! type -p yay > /dev/null; then
102103 exit 1
103104fi
104105
105-
106- # Build and install
107- chmod +s /usr/bin/sudo
108- for _pkg in " ${@ } " ; do
109- pacman -Qq " ${_pkg} " > /dev/null 2>&1 && continue
110-
106+ installpkg (){
111107 yes | sudo -u " ${aur_username} " \
112108 yay -Sy \
113109 --mflags " -AcC" \
@@ -123,8 +119,25 @@ for _pkg in "${@}"; do
123119 --mflags " --skippgpcheck" \
124120 " ${pacman_args[@]} " \
125121 --cachedir " /var/cache/pacman/pkg/" \
126- " ${_pkg} "
122+ " ${@ } "
123+ }
124+
127125
126+ # Build and install
127+ chmod +s /usr/bin/sudo
128+ for _pkg in " ${@ } " ; do
129+ pacman -Qq " ${_pkg} " > /dev/null 2>&1 && continue
130+ installpkg " ${_pkg} "
131+
132+ if ! pacman -Qq " ${_pkg} " > /dev/null 2>&1 ; then
133+ echo -e " \n[aur.sh] Failed to install ${_pkg} \n"
134+ failedpkg+=(" ${_pkg} " )
135+ fi
136+ done
137+
138+ # Reinstall failed package
139+ for _pkg in " ${@ } " ; do
140+ installpkg " ${_pkg} "
128141 if ! pacman -Qq " ${_pkg} " > /dev/null 2>&1 ; then
129142 echo -e " \n[aur.sh] Failed to install ${_pkg} \n"
130143 exit 1
You can’t perform that action at this time.
0 commit comments