diff --git a/patches/pkgbuild/gcc.sh b/patches/pkgbuild/gcc.sh index 08ef9d2..f609691 100755 --- a/patches/pkgbuild/gcc.sh +++ b/patches/pkgbuild/gcc.sh @@ -91,6 +91,21 @@ sed -i '/usr\/lib32/d; /_libdir\/32/d' PKGBUILD # front end is off. sed -i 's/^\(\s*for _so in \).*; do$/\1libatomic.so libstdc++.so; do/' PKGBUILD +# package_gcc() also _picks files out for every sub-package, including the +# front ends we disabled. _pick is a mv, so it fails on what was never built: +# +# mv: cannot stat 'usr/bin/gnat': No such file or directory +# +# Dropping the entries from pkgname was not enough -- the _pick lines live in +# package_gcc() and run regardless of which sub-packages are requested. +for _lang in gcc-ada gcc-d gcc-go gcc-m2 gcc-rust gcc-gcobol \ + libgm2 libgo libgphobos libgcobol libhwasan; do + sed -i "/_pick ${_lang} /d" PKGBUILD +done +if grep -qE '_pick (gcc-ada|gcc-d|gcc-go|gcc-m2|gcc-rust|gcc-gcobol) ' PKGBUILD; then + echo "gcc: _pick lines remain for a disabled front end" >&2; exit 1 +fi + if grep -q 'usr/lib32' PKGBUILD; then echo "gcc: usr/lib32 still manipulated" >&2; exit 1 fi diff --git a/scripts/bootstrap-pacman.sh b/scripts/bootstrap-pacman.sh index 31325ba..fb489b8 100755 --- a/scripts/bootstrap-pacman.sh +++ b/scripts/bootstrap-pacman.sh @@ -123,8 +123,15 @@ build_package() { # success became the function's exit status -- and a run reported # "51 built, 0 failed" while glibc, gcc, coreutils and pacman had all # failed. Measured: the repository held 23 files, not a hundred. - makepkg --nodeps --ignorearch --skippgpcheck --skipchecksums --nocheck -f \ - || return 1 + # -C wipes $srcdir first. Without it a re-run inherits the previous + # attempt's tree, and prepare() fails on work it already did: + # patch: ... already exists! Skipping patch. + # 1 out of 1 hunk ignored + # mkdir: build-curl-compat: File exists + # grep, gnupg, pacman and curl all failed this way -- not on the + # port, but on my own driver re-entering a dirty directory. + makepkg --nodeps --ignorearch --skippgpcheck --skipchecksums --nocheck \ + -C -f || return 1 # An exit code is not proof. Only the artefact is. local produced=() shopt -s nullglob