From 10fecddf16262d3ca5d0d52ec01e97e3fb2dbf3a Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 9 Mar 2010 14:30:28 +0100 Subject: [PATCH] Build packages concurrently At this point running 4 in parallel. A higher value seems to require too much disk I/O. --- id-deb-build/id-pbuild-all.sh | 51 ++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/id-deb-build/id-pbuild-all.sh b/id-deb-build/id-pbuild-all.sh index ce267ba..3af753a 100755 --- a/id-deb-build/id-pbuild-all.sh +++ b/id-deb-build/id-pbuild-all.sh @@ -38,21 +38,40 @@ if test "$2" = "upload"; then echo "./update-archive.sh" exit 0 fi +i=0 +concurrency=4 +echo "Building $PKG" +date for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do - for arch in i386 amd64; do - if test ! -f /var/cache/pbuilder/${dist}-${arch}-base.tgz; then - DIST=$dist ARCH=$arch pbuilder create - fi - if $update; then - DIST=$dist ARCH=$arch pbuilder update --override-config - fi - DIST=$dist ARCH=$arch pbuilder --build $PKG - if test -f ${dist}-${arch}/*.dsc; then - : - else - echo "No .dsc file for ${dist}-${arch}" - exit 1 - fi - done + for arch in i386 amd64; do + rm -fr ${dist}-${arch} + ( + if test ! -f /var/cache/pbuilder/${dist}-${arch}-base.tgz; then + DIST=$dist ARCH=$arch pbuilder create + fi + if $update; then + DIST=$dist ARCH=$arch pbuilder update --override-config + fi + DIST=$dist ARCH=$arch pbuilder --build $PKG + ) >${dist}-${arch}.log 2>&1 & + i=`expr $i + 1` + if test $i -eq $concurrency; then + i=0 + wait + fi + done done - +wait +for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do + for arch in i386 amd64; do + + if test -f ${dist}-${arch}/*.dsc; then + : + else + echo "No .dsc file for ${dist}-${arch}" + exit 1 + fi + done +done +date +echo "Done" -- 1.7.10.4