X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/b94830d9593ca8c243fef1bc0b29eb751f935cde..e5099dd86be490d4ed3890203472e3158569286b:/bin/mdw-sbuild-server diff --git a/bin/mdw-sbuild-server b/bin/mdw-sbuild-server index a1355b8..d04f5a2 100755 --- a/bin/mdw-sbuild-server +++ b/bin/mdw-sbuild-server @@ -176,6 +176,13 @@ case "$#,$1" in ## actually a little tricky. for t in $targets; do + ## Dissect the target name. + suite=${t%%-*} archs=${t#*-} + case $archs in + */*) target=${archs%/*} host=${archs#*/} ;; + *) target=$archs host=$archs; t=$suite-$target/$host ;; + esac + ## Work through the architectures which we can build. for arch in $wantarchs; do case $arch in @@ -199,7 +206,7 @@ case "$#,$1" in case $archp in nil) continue ;; esac ## If we can't build it then we shouldn't try. - if ! dpkg-architecture -a"$os-${t#*-}" -i"$arch"; then + if ! dpkg-architecture -a"$os-$target" -i"$arch"; then continue fi @@ -235,23 +242,38 @@ case "$#,$1" in DSC = $dsc FIRST = $first REST = $rest -SBUILD = t=\$@; sbuild \\ - --dist=\$\${t%-*} --arch=\$\${t\#*-} \\ - --chroot=\$@ --verbose -TAGLINES = \\ - while IFS= read -r line; do printf "%s: %s\n" "\$@" "\$\$line"; done +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.${i%/*}; done + ## And we're ready to go. mkfifo pipeout cat pipeout& catpid=$! set +e; make -fbuild.mk $parallel $makeopts -k all >pipeout rc=$?; set -e wait $! - rm build.mk pipeout + rm build.mk pipeout build-status.* find . -maxdepth 1 -type l -exec rm {} \; exit $rc ;;