X-Git-Url: https://git.madduck.net/code/mbuild.git/blobdiff_plain/4acfe4036f522fa5f1bf438d76aa76cb2e4b07e8..7e5d580daa83915bf0fdf44e8f9e9c26c64b6e5a:/sbuild-wrapper.sh?ds=sidebyside diff --git a/sbuild-wrapper.sh b/sbuild-wrapper.sh index 91da408..5aee0ca 100755 --- a/sbuild-wrapper.sh +++ b/sbuild-wrapper.sh @@ -109,8 +109,6 @@ if [ -z "$schangesfile" ]; then exit 1 fi -[ -z "$arch" ] && arch="$DEB_BUILD_ARCH" - dist="$(sed -ne 's,Distribution: ,,p' "$schangesfile")" schangesfile_basename="${schangesfile##*/}" @@ -157,20 +155,37 @@ done rm $schangesfile unset schangesfile -if [ "$binonly" = 0 ]; then - sbuild_args_sourceful="--source --arch-all" -fi +[ -z "$arch" ] && arch="$DEB_BUILD_ARCH" -if [ "$arch" = all ]; then - arch="$(schroot -l | sed -rne 's,^sid-([^-]+).*,\1,p' | uniq | tr '\n' ' ')" -fi +target_arch="$(sed -ne 's,^Architecture: ,,p' $dscfile_basename)" +case "$binonly/$target_arch" in + 1/all) + echo "E: cannot build arch:all packages with -B." >&2 + exit 1 + ;; + 0/all) arch=all;; + */any) + arch="$(schroot -l | sed -rne 's,^sid-([^-]+).*,\1,p' | uniq | tr '\n' ' ')" + if [ "$binonly" = 0 ]; then + sbuild_args_sourceful="--source --arch-all" + fi + ;; +esac for a in $arch; do echo "I: building $packagenameversion for $a/$dist…" >&2 - sbuild $sbuild_args $sbuild_args_sourceful \ - --arch="$a" --dist="$dist" --keyid=$KEYID \ - "$dscfile_basename" + case "$a" in + all) + arch_arg=--arch-all + a="$DEB_BUILD_ARCH" + ;; + *) --arch=$a;; + esac + + sbuild $sbuild_args $sbuild_args_sourceful $arch_arg \ + --dist="$dist" --keyid=$KEYID \ + "$dscfile_basename" || ret=$? changesfile="${packagenameversion}_${a}.changes"