@@ -373,20 +373,26 @@ while IFS= read "${read_args[@]}" -ru "$fd" path; do
373373 # repo-add (create_package=0). If no paths are available, the package is
374374 # assumed to not exist and the build proceeds as usual (create_package=1).
375375 if (( ! overwrite )) ; then
376+ mapfile -t pkglist < <( PKGDEST=" $db_root " ${AUR_BUILD_PKGLIST:- aur build--pkglist} " ${makepkg_pkglist_args[@]} " )
377+ wait " $! " # Check `build--pkglist` exit status
378+
376379 exists=()
377- # shellcheck disable=SC2086
378- while read -r pkgpath; do
380+ for pkgpath in " ${pkglist[@]} " ; do
379381 [[ -f $pkgpath ]] && exists+=(" $pkgpath " )
380- done < <( PKGDEST= " $db_root " ${AUR_BUILD_PKGLIST :- aur build--pkglist} " ${makepkg_pkglist_args[@]} " )
382+ done
381383
382- wait " $! " # Check `build--pkglist` exit status
383-
384- if (( ${# exists[@]} )) ; then
384+ # Ensure partial results do not skip the build (#1186)
385+ if (( ${# exists[@]} == ${# pkglist[@]} )) ; then
385386 printf >&2 ' %s: warning: skipping existing package (use -f to overwrite)\n' " $argv0 "
387+ printf ' %q\n' >&2 " ${exists[@]} "
386388 create_package=0
387389
390+ elif (( ${# exists[@]} )) ; then
391+ # Since `makepkg` does not allow building split packages
392+ # individually, we restart the build when part of the
393+ # package group is unavailable (including -debug packages)
394+ printf >&2 ' %s: warning: package group partially built\n' " $argv0 "
388395 printf ' %q\n' >&2 " ${exists[@]} "
389- pkglist=(" ${exists[@]} " )
390396 fi
391397
392398 if (( ${# exists[@]} )) && [[ -v results_file ]]; then
0 commit comments