diff options
author | Guido Günther <agx@sigxcpu.org> | 2016-01-25 08:16:25 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2016-01-25 08:16:25 +0100 |
commit | abe4e4026b484d13ad781e1a72c26f8ea4c7de5a (patch) | |
tree | 6b6dcccbb8f2f5d45dad3e4185510956c5c9349d /bin | |
parent | 0b5a0a2bb4d803460536962a0b02df1ec6a2ba50 (diff) |
Update to git-pbuilder 1.40
Thanks: Russ Allberry
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/git-pbuilder | 66 |
1 files changed, 39 insertions, 27 deletions
diff --git a/bin/git-pbuilder b/bin/git-pbuilder index 10213d4e..57644e6f 100755 --- a/bin/git-pbuilder +++ b/bin/git-pbuilder @@ -1,5 +1,5 @@ #!/bin/bash -# $Id: git-pbuilder,v 1.38 2015/12/05 22:06:36 eagle Exp $ +# $Id: git-pbuilder,v 1.40 2016/01/23 23:59:19 eagle Exp $ # # git-pbuilder -- Wrapper around pbuilder for gbp buildpackage # @@ -10,7 +10,7 @@ # # Written by Russ Allbery <eagle@eyrie.org> # Based on the example in the git-buildpackage documentation -# Copyright 2014, 2015 Russ Allbery <eagle@eyrie.org> +# Copyright 2014, 2015, 2016 Russ Allbery <eagle@eyrie.org> # Copyright 2008, 2009, 2010, 2011, 2012, 2013 # The Board of Trustees of the Leland Stanford Junior University # @@ -110,12 +110,11 @@ OUTPUT_DIR="${GIT_PBUILDER_OUTPUT_DIR:-../}" # How we handle options depends on what type of builder we're using. Ignore # options if $GIT_PBUILDER_AUTOCONF is set to no. -if [ no != "$GIT_PBUILDER_AUTOCONF" ] ; then +if [ no != "$GIT_PBUILDER_AUTOCONF" ]; then case $BUILDER in pbuilder) - # The root directory where different pbuilder --basepath - # directories are found. git-pbuilder expects them to be named - # base-<dist>.tgz. + # The root directory where different pbuilder --basetgz files 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 @@ -126,7 +125,7 @@ if [ no != "$GIT_PBUILDER_AUTOCONF" ] ; then BASE="$PBUILDER_BASE/base-$DIST$EXT-$ARCH.tgz" OPTIONS+=( --architecture "$ARCH" ) elif [ "$DIST" = 'sid' ] ; then - if [ -f "$PBUILDER_BASE/base-sid.tgz" ] ; then + if [ -f "$PBUILDER_BASE/base-sid.tgz" ]; then BASE="$PBUILDER_BASE/base-sid.tgz" else BASE="$PBUILDER_BASE/base.tgz" @@ -144,7 +143,7 @@ if [ no != "$GIT_PBUILDER_AUTOCONF" ] ; then # 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 + if [ "$DIST" = 'etch' ] || [ "$DIST" = 'ebo' ]; then OPTIONS+=( --debian-etch-workaround ) fi ;; @@ -154,34 +153,47 @@ if [ no != "$GIT_PBUILDER_AUTOCONF" ] ; then # directories are found. git-pbuilder expects them to be named # base-<dist>.cow. : ${COWBUILDER_BASE:=/var/cache/pbuilder} - - # If DIST is set, use base-$DIST.cow. If DIST is not set, the sid + + # If --basepath is specified on the command line we need to use + # that and that alone, since if it's specified more than once, + # cowbuilder will fail. + bp_found="" + for opt in $@; do + case $opt in + --basepath|--basepath=*) bp_found="yes" ;; + esac + done + + # If --basepath wasn't already provided, we need to set it. If + # DIST is set, use base-$DIST.cow. If DIST is not set, the sid # chroot may be either base.cow or base-sid.cow. Try both. If # ARCH is set, use base-$DIST-$ARCH.cow. - : ${DIST:=sid} - if [ -n "$ARCH" ] ; then - BASE="$COWBUILDER_BASE/base-$DIST$EXT-$ARCH.cow" - OPTIONS+=( --architecture "$ARCH" ) - elif [ "$DIST" = 'sid' ] ; then - if [ -d "$COWBUILDER_BASE/base-sid.cow" ] ; then - BASE="$COWBUILDER_BASE/base-sid.cow" + if [ -z "$bp_found" ]; then + : ${DIST:=sid} + if [ -n "$ARCH" ]; then + BASE="$COWBUILDER_BASE/base-$DIST$EXT-$ARCH.cow" + OPTIONS+=( --architecture "$ARCH" ) + elif [ "$DIST" = 'sid' ]; then + if [ -d "$COWBUILDER_BASE/base-sid.cow" ] ; then + BASE="$COWBUILDER_BASE/base-sid.cow" + else + BASE="$COWBUILDER_BASE/base.cow" + fi else - BASE="$COWBUILDER_BASE/base.cow" + BASE="$COWBUILDER_BASE/base-$DIST$EXT.cow" fi - else - BASE="$COWBUILDER_BASE/base-$DIST$EXT.cow" - fi - OPTIONS+=( --basepath "$BASE" ) + OPTIONS+=( --basepath "$BASE" ) - # Make sure the base directory exists. - if [ ! -d "$BASE" ] && [ "$1" != "create" ]; then - echo "Base directory $BASE does not exist" >&2 - exit 1 + # Make sure the base directory exists. + if [ ! -d "$BASE" ] && [ "$1" != "create" ]; then + echo "Base directory $BASE does not exist" >&2 + exit 1 + fi 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 + if [ "$DIST" = 'etch' ] || [ "$DIST" = 'ebo' ]; then OPTIONS+=( --debian-etch-workaround ) fi ;; |