From bb148654a3991699c86a411542a0bc1b181c1e46 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 11 Mar 2012 12:20:21 +0000 Subject: Support overriding sbuild target git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@504 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- sbuild-stuff | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'sbuild-stuff') diff --git a/sbuild-stuff b/sbuild-stuff index 8890c68..af08124 100755 --- a/sbuild-stuff +++ b/sbuild-stuff @@ -55,6 +55,18 @@ fi metadata="$(get_metadata "$DSC")" read dscdist debian_version <<< "$metadata" +sourcepkg="$(grep-dctrl -n -s Source '' "$DSC")" + +if [ -z "${ARCH:-}" ]; then + if [ "`uname -m`" = "x86_64" ]; then + ARCH="amd64" + elif [ "`uname -m`" = "i386" ] || [ "`uname -m`" = "i686" ]; then + ARCH="i386" + else + echo >&2 "Do not know arch" + exit 1 + fi +fi if [ -z "${DIST:-}" ]; then DIST=sid @@ -64,18 +76,15 @@ if [ -z "${DIST:-}" ]; then break fi done + if command -v "sbuild-override-dist-$sourcepkg" >/dev/null 2>&1; then + NEWDIST=$("sbuild-override-dist-$sourcepkg" "$DIST" "$DSC" "$ARCH") + [ -z "$NEWDIST" ] || DIST="$NEWDIST" + fi fi - -if [ -z "${ARCH:-}" ]; then - if [ "`uname -m`" = "x86_64" ]; then - ARCH="amd64" - elif [ "`uname -m`" = "i386" ] || [ "`uname -m`" = "i686" ]; then - ARCH="i386" - else - echo >&2 "Do not know arch" - exit 1 - fi +if [ "$DIST" = "SKIP" ] ;then + echo "skipping build for $DSC because DIST is $DIST." + exit 0 fi if [ "$BINARCH" = 1 ]; then -- cgit v1.2.3