On Fri, Jul 22, 2011 at 08:33:38AM -0700, Russ Allbery wrote: > Indeed. Hm, it should be fairly straightforward to support, though, with > some similar assumptions about naming of the *.tgz files. If it looked > for a base tarball as base-$DIST-$ARCH.tgz in /var/cache/pbuilder, does > that work? It's been a while since I used straight pbuilder, so I don't > recall what the naming convention was.
This seems close enough to functional so far: diff --git a/git-pbuilder b/git-pbuilder index d82b58b..cf8837b 100755 --- a/git-pbuilder +++ b/git-pbuilder @@ -33,8 +33,7 @@ if [ -z "$BUILDER" ] && [ -z "$DIST" ] ; then DIST=${BUILDER#*-} BUILDER=${BUILDER%%-*} case $BUILDER in - pbuilder|cowbuilder) BUILDER=cowbuilder ;; - /*) BUILDER=cowbuilder ;; + (/*) BUILDER=cowbuilder ;; esac case $BUILDER in *builder) ;; @@ -64,6 +63,44 @@ OPTIONS="$GIT_PBUILDER_OPTIONS" # How we handle options depends on what type of builder we're using. case $BUILDER in + pbuilder) + # The root directory where different pbuilder --basepath directories + # are found. git-pbuilder expects them to be named base-<dist>.tgz. + : ${PBUILDER_BASE:=/var/cache/pbuilder} + + # If DIST is set, use base-$DIST.tgz. If DIST is not set, the sid + # chroot may be either base.tgz or base-sid.tgz. Try both. If ARCH + # is set, use base-$DIST-$ARCH.tgz. + if [ -z "$DIST" ] ; then + DIST=sid + fi + if [ -n "$ARCH" ] ; then + BASE="$PBUILDER_BASE/base-$DIST-$ARCH.tgz" + OPTIONS="$OPTIONS --architecture $ARCH" + elif [ "$DIST" = 'sid' ] ; then + if [ -f "$PBUILDER_BASE/base-sid.tgz" ] ; then + BASE="$PBUILDER_BASE/base-sid.tgz" + else + BASE="$PBUILDER_BASE/base.tgz" + fi + else + BASE="$PBUILDER_BASE/base-$DIST.tgz" + fi + OPTIONS="$OPTIONS --basetgz $BASE" + + # Make sure the base tarball exists. + if [ ! -f "$BASE" ] && [ "$1" != "create" ]; then + echo "Base directory $BASE does not exist" >&2 + exit 1 + fi + + # Set --debian-etch-workaround if DIST is etch. Assume that + # everything else is new enough that it will be fine. + if [ "$DIST" = 'etch' ] || [ "$DIST" = 'ebo' ] ; then + OPTIONS="$OPTIONS --debian-etch-workaround" + fi + ;; + cowbuilder) # The root directory where different cowbuilder --basepath directories # are found. git-pbuilder expects them to be named base-<dist>.cow. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org