-
Notifications
You must be signed in to change notification settings - Fork 0
/
svnbp
executable file
·59 lines (48 loc) · 2.14 KB
/
svnbp
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# resolve $0 in case it's a symlink, then grab directory.
REALDIR="$(dirname $(realpath $0))"
# if unset, assume pbuilder-hooks is in same directory as this script.
PBUILDERHOOKSDIR="${PBUILDERHOOKSDIR:-$REALDIR/pbuilder-hooks}"
DISTRIBUTION=$(dpkg-parsechangelog | grep ^Distribution | cut -f2 -d' ')
PBUILDERBINDMOUNTS="" # Will be set later based on ENABLE_LOCAL=1 or not.
# check if we need to download the *.orig.tar.*
PKG=$(dpkg-parsechangelog | grep ^Source: | cut -d' ' -f2)
VER=$(dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2 | cut -d- -f1)
NOEPOCHVER=$(echo $VER | sed -e 's/.*://')
if [ ! -f ../tarballs/${PKG}_${NOEPOCHVER}.orig.tar.* ]; then
echo "INFO: could not find ../tarballs/${PKG}_${NOEPOCHVER}.orig.tar.*, trying to fetch..."
export DEB_TARBALL_DOWNLOAD_DIR="../tarballs/"
fakeroot debian/rules get-orig-source
fi
if [ "$DISTRIBUTION" = "UNRELEASED" ]; then
svn info | grep -c -E "^URL.*/experimental/" && DISTRIBUTION=experimental
fi
if [ "$DISTRIBUTION" = "experimental" ]; then
echo "INFO: Enabling experimental archive access for pbuilder"
export ENABLE_EXP=1
fi
if [ -n "$ENABLE_LOCAL" ]; then
echo "INFO: Enabling local archive access for pbuilder"
#LOCALRC="--configfile ${PBUILDERHOOKSDIR}/.pbuilderrc-local-pkg"
PBUILDERBINDMOUNTS="--bindmounts /var/cache/pbuilder/mirror"
fi
if [ -d "../build-logs" ]; then
LOGFILE="../build-logs/$PKG-$VER.log"
else
echo "INFO: ../build-logs doesn't exist, no logging to file."
LOGFILE=""
fi
# check if we need to give pbuilder network access
if [ -n "$ENABLE_LOCAL" ] || [ -n "$ENABLE_EXP" ] || \
[ -n "$ENABLE_UNSTABLE" ] || [ -n "$ENABLE_INCOMING" ] \
[ -n "$ENABLE_NETWORK" ]
then
USENETWORK="--use-network yes"
else
USENETWORK=""
fi
if [ "$LOGFILE" != "" ]; then
svn-buildpackage --svn-ignore-new --svn-builder="pdebuild $LOCALRC --pbuilder pbuilder -- $USENETWORK --hookdir \"$PBUILDERHOOKSDIR\" $PBUILDERBINDMOUNTS --debbuildopts '-i -I -j1'" "$@" | tee $LOGFILE
else
svn-buildpackage --svn-ignore-new --svn-builder="pdebuild $LOCALRC --pbuilder pbuilder -- $USENETWORK --hookdir \"$PBUILDERHOOKSDIR\" $PBUILDERBINDMOUNTS --debbuildopts '-i -I -j1'" "$@"
fi