- ## Build a cheesy makefile to run these in parallel.
- cat >build.mk <<EOF
-### -*-makefile-*-
-DSC = $dsc
-FIRST = $first
-REST = $rest
-sbuild-wrap = \\
- t=\$@; \\
- host=\$\${t\#\#*/} full=\$\${t%/*}; \\
- suite=\$\${full%%-*} target=\$\${full\#*-}; \\
- { echo started >build-status.\$\$full; \\
- sbuild \\
- --dist=\$\$suite --build=\$\$host --host=\$\$target \\
- --chroot=\$\$suite-\$\$host --verbose \$1 \$(DSC); \\
- rc=\$\$?; case \$\$rc in \\
- 0) echo ok >build-status.\$\$full ;; \\
- *) echo failed rc=\$\$rc >build-status.\$\$full ;; \\
- esac; } | \\
- while IFS= read -r line; do \\
- printf "%s: %s\n" "\$\$full" "\$\$line"; \\
- done; \\
- read st _ <build-status.\$\$full && \\
- case \$\$st in ok) exit 0 ;; *) exit 1 ;; esac
-all: \$(FIRST) \$(REST)
-\$(FIRST):; \$(call sbuild-wrap,$firstopt)
-\$(REST):; \$(call sbuild-wrap,--no-arch-all)
-EOF
+ ## Sort out the additional packages. This is rather annoying, because
+ ## sbuild(1) does this in a really stupid way.
+ rm -rf pkgs.*
+ for a in $buildarchs; do
+ mkdir pkgs.$a
+ for f in $(dpkg-scanpackages -a$a pkgs/ |
+ sed -n '/^Filename: /s///p')
+ do
+ ln $f pkgs.$a/
+ done
+ done