aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/gbp-cowbuilder-sid
blob: 4021f23c09d7f2f4612240f7e3343ed496d47ed2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash -e
#
# cowbuilder helper for git-buildpackage
# use this as builder:
# git-buildpackage --git-builder=gbp-cowbuilder-sid
#
# you can use this for other dists like sarge, etch, lenny with a symlink: 
# ln -s gbp-cowbuilder-sid gbp-cowbuilder-lenny
#
# and a /etc/pbuilder/pbuilderrc.$DIST

DIST=${0/*gbp-cowbuilder-}
ACTION=$1

CONF=/etc/pbuilder/pbuilderrc.$DIST
WA_OPT='--debian-etch-workaround'

case $DIST in
	sarge*|etch*)
		echo "`basename $0`: Using $WA_OPT"
    		OPTS="$OPTS $WA_OPT"
		;;
esac

case $ACTION in
    update|create|login)
	sudo cowbuilder --$ACTION --configfile=${CONF} --dist $DIST
	;;
    *)
	# pass all options to dpkg-buildpackage:
	pdebuild --configfile ${CONF} 		     \
	 	--pbuilder cowbuilder                \
		--buildresult ${GBP_BUILD_DIR}/..    \
	 	--debbuildopts "-i\.git/ -I.git $*"  \
		-- $OPTS
	;;
esac