run () {
case $notreally in
t) echo "+ $*" ;;
- nil) "$@" ;;
+ nil) nice "$@" ;;
esac
}
### Parse options.
bogusp=nil archp=nil indepp=nil keepon=nil notreally=nil
-unset targets
+unset targets dbpargs
-while getopts "haint:" opt; do
+while getopts "haint:A:" opt; do
case $opt in
h)
usage
-k Keep going even if one fails.
-n Don't actually do the build.
-t TARGET Build in TARGET build environment.
+ -A ARGS Pass ARGS to \`dpkg-buildpackage'.
Commands available:
k) keepon=t ;;
n) notreally=t ;;
t) targets="${targets+$targets }$OPTARG" ;;
+ A) dbpargs="${dbpargs+$dbpargs }$OPTARG" ;;
*) bogusp=nil ;;
esac
done
run sbuild --extra-package=$pkgs.$target \
--dist=$suite --build=$host --host=$target \
--chroot=$suite-$host --verbose $buildopt $dsc \
+ ${dbpargs+--debbuildopts="$dbpargs"} \
3>&- 4>&- 5>&-
echo $? >&5
} |