From 7e5d580daa83915bf0fdf44e8f9e9c26c64b6e5a Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Sat, 6 Feb 2010 23:44:30 +0100 Subject: [PATCH 1/1] fix up arch handling --- sbuild-wrapper.sh | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) 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" -- 2.39.5