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-override-dist-obfsproxy | 13 +++++++++++++ sbuild-stuff | 29 +++++++++++++++++++---------- 2 files changed, 32 insertions(+), 10 deletions(-) create mode 100755 sbuild-override-dist-obfsproxy diff --git a/sbuild-override-dist-obfsproxy b/sbuild-override-dist-obfsproxy new file mode 100755 index 0000000..e72eddf --- /dev/null +++ b/sbuild-override-dist-obfsproxy @@ -0,0 +1,13 @@ +#!/bin/sh + +dist="$1" +dsc="$2" + +case "$dist" in + lenny) + echo SKIP + ;; + squeeze) + echo squeeze-backports + ;; +esac 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