diff options
author | Erich Eckner <erich.eckner.ext@bestsecret.com> | 2024-07-15 12:06:45 +0200 |
---|---|---|
committer | Erich Eckner <erich.eckner.ext@bestsecret.com> | 2024-07-15 12:06:45 +0200 |
commit | 00c0a70257ba2a6fa920c58cec299d7514903ed9 (patch) | |
tree | 83dd862f80f47bdcf90e1314ec3846fb44ec63d2 /build-all-with-docker | |
parent | 258d112502cd1b4b692f84a87be0c0adfca50d2f (diff) | |
download | archlinuxewe-00c0a70257ba2a6fa920c58cec299d7514903ed9.tar.xz |
Revert "run docker sequentially per package"
This reverts commit a124e10bf68d2b05ae9dfbd76fd2b57168595590.
Somehow, it blocked docker completely.
Diffstat (limited to 'build-all-with-docker')
-rwxr-xr-x | build-all-with-docker | 61 |
1 files changed, 38 insertions, 23 deletions
diff --git a/build-all-with-docker b/build-all-with-docker index fbccd3fd8..1676d9c65 100755 --- a/build-all-with-docker +++ b/build-all-with-docker @@ -24,32 +24,47 @@ if [ -n "$(git status --porcelain)" ]; then exit 1 fi -ids=() - -for pkg in */PKGBUILD; do - cd "${pkg%/PKGBUILD}" - ( +ids=$( + for pkg in */PKGBUILD; do + cd "${pkg%/PKGBUILD}" ../addPkgbuildPatch add - docker run -v .:/build arch-build:latest - docker run -v .:/build arch32-i486-build - docker run -v .:/build arch32-i686-build - docker run -v .:/build arch32-pentium4-build - docker run -v .:/build artix-build:latest + docker run -d -v .:/build arch-build:latest + docker run -d -v .:/build artix-build:latest + cd .. + done \ + | tee /dev/stderr +) + +check_and_commit_package_updates() { + [ -z "$(git status --porcelain)" ] && return + for pkg in $( + git status --porcelain \ + | sed ' + s@^.. @@ + s@/[^/]\+$@@ + ' \ + | grep -vxFf <( + docker ps --format '{{.Mounts}}' --no-trunc \ + | sed 's@^.*/@@' + ) + ); do + if ! [ -d "$pkg" ]; then + >&2 echo "$pwd is not a directory" + continue + fi + cd "$pkg" ../addPkgbuildPatch del - [ -n "$(git status --porcelain -- PKGBUILD)" ] && ../commit-package -a && git push - ) & - ids[${#ids[@]}]=$! - cd .. -done + [ -n "$(git status --porcelain -- .)" ] \ + && ../commit-package -a \ + && git push + cd .. + done +} -while [ "${#ids[@]}" -gt 0 ]; do +while docker ps --no-trunc | grep -wF "${ids}"; do sleep 10 - ids=( - $( - ls /proc \ - | grep -xFf <(printf '%s\n' "${ids[@]}") \ - | tee /dev/stderr - ) - ) + check_and_commit_package_updates date done + +check_and_commit_package_updates |