summaryrefslogtreecommitdiff
path: root/sbuild-stuff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2011-03-10 21:18:12 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2011-03-10 21:18:12 +0000
commit44f71598645135fd592da0aaaa935af8d1ad3861 (patch)
tree0e93a13995ebc11bbf305981791ffd5af9b53659 /sbuild-stuff
parent584102cfb3b2fa765388edebd77526b5e4ecbc66 (diff)
Add two scripts
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@472 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'sbuild-stuff')
-rwxr-xr-xsbuild-stuff51
1 files changed, 51 insertions, 0 deletions
diff --git a/sbuild-stuff b/sbuild-stuff
new file mode 100755
index 0000000..5f282fd
--- /dev/null
+++ b/sbuild-stuff
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+set -e
+set -u
+
+if [ "${1:-}" == "--binary-only" ]; then
+ BINARY_ARCH="--binary-arch"
+ BINARCH=1
+ shift
+else
+ BINARCH=0
+fi;
+
+DSC="${1:-}"; shift
+if [ -z "$DSC" ] || [ -z "$BINARCH" ]; then
+ echo "Usage: $0 [--binary-arch] <foo.dsc>" >&2
+ exit 1;
+fi
+
+package=`echo $DSC | sed -e 's/_.*//'`
+debian_version=`echo $DSC | sed -e 's/^[^_]*_//' -e s/\.dsc$//`
+
+if [ -z "${DIST:-}" ]; then
+ DIST=sid
+ for d in lenny squeeze wheezy dapper hardy karmic lucid maverick; do
+ if echo $debian_version | grep -q "$d" ; then
+ DIST="$d"
+ break
+ fi
+ done
+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
+fi
+
+if [ "$BINARCH" = 1 ]; then
+ extra=""
+else
+ extra="-s --arch-all"
+fi
+
+sbuild --arch="$ARCH" --dist="$DIST" --apt-update $extra "$DSC"