Skip to content

Commit d78bbd0

Browse files
authored
Merge pull request aurutils#1187 from aurutils/build-partial-results
`build`: do not skip on partial results
2 parents 3fd7986 + efce8f7 commit d78bbd0

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ETCDIR ?= /etc
77
AURUTILS_LIB_DIR ?= $(LIBDIR)/$(PROGNM)
88
AURUTILS_VERSION ?= $(shell git describe --tags || true)
99
ifeq ($(AURUTILS_VERSION),)
10-
AURUTILS_VERSION := 20.3
10+
AURUTILS_VERSION := 20.4
1111
endif
1212
AURUTILS_LIB = $(shell find lib/ -name 'aur-*')
1313

lib/pacman/aur-build

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

makepkg/aurutils.changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 20.4
2+
3+
* `aur-build`
4+
+ do not skip build on partial results (#1186)
5+
16
## 20.3
27

38
* `perl`

0 commit comments

Comments
 (0)