Browse Source

bin/build-packages: :clean_chroot: sets -c for makepkg, which may be insufficient for removing still mounted submounts (e.g. /run) - we now run recursively_umount_and_rm to (hopefully) clean the build chroot entirely

Erich Eckner 4 months ago
parent
commit
167e29229f
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      bin/build-packages

+ 8
- 0
bin/build-packages View File

@@ -524,6 +524,14 @@ while [ "${count}" -ne 0 ] && \
524 524
         find . -maxdepth 1 -type f \( -name '*.pkg.tar.xz' -o -name '*.pkg.tar.xz.sig' \) -exec \
525 525
           rm {} \;
526 526
 
527
+        if echo "${outerParameters}" | \
528
+          grep -qwF -- '-c'; then
529
+          # sometimes it is necessary to manually remove the root/ build
530
+          # directory (due to leftover mounts of /run) - so we just do
531
+          # it everytime '-c' is set
532
+          recursively_umount_and_rm '/var/lib/archbuild/'"${build_command%-build}"
533
+        fi
534
+
527 535
         echo 'building' > "${tmp_dir}/.ping-build-master"
528 536
         >&2 printf '%s: building package "%s" (revisions %s %s, repository %s, straw %s) for %s ...' \
529 537
           "$(date +'%Y-%m-%d %T')" \