From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh5Xe-00006r-Le for qemu-devel@nongnu.org; Mon, 05 Sep 2016 21:51:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bh5Xb-0005GD-EV for qemu-devel@nongnu.org; Mon, 05 Sep 2016 21:51:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh5Xb-0005Ft-8t for qemu-devel@nongnu.org; Mon, 05 Sep 2016 21:51:11 -0400 Date: Tue, 6 Sep 2016 09:43:57 +0800 From: Fam Zheng Message-ID: <20160906014357.GB653@al.usersys.redhat.com> References: <1472063464-790-1-git-send-email-silbe@linux.vnet.ibm.com> <1472063464-790-6-git-send-email-silbe@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1472063464-790-6-git-send-email-silbe@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v2 5/7] docker: make sure debootstrap is at least 1.0.67 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sascha Silbe Cc: qemu-devel@nongnu.org, Alex =?iso-8859-1?Q?Benn=E9e?= On Wed, 08/24 20:31, Sascha Silbe wrote: > debootstrap prior to 1.0.67 generated an empty sources.list during > foreign bootstraps (Debian#732255 [1]). Fall back to the git checkout > if the installed debootstrap version is too old. > > [1] https://bugs.debian.org/732255 > > Signed-off-by: Sascha Silbe > --- > Not sure if this used to work in even older debootstrap versions; I > don't remember running into this before. But then I needed to set up > several config files manually after a debootstrap anyway (both foreign > and native), so sources.list might just have been another one to fix > up manually. > > tests/docker/dockerfiles/debian-bootstrap.pre | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/tests/docker/dockerfiles/debian-bootstrap.pre b/tests/docker/dockerfiles/debian-bootstrap.pre > index 2ae363f..3c3e781 100755 > --- a/tests/docker/dockerfiles/debian-bootstrap.pre > +++ b/tests/docker/dockerfiles/debian-bootstrap.pre > @@ -3,6 +3,8 @@ > # Simple wrapper for debootstrap, run in the docker build context > # > FAKEROOT=`which fakeroot 2> /dev/null` > +# debootstrap < 1.0.67 generates empty sources.list, see Debian#732255 > +MIN_DEBOOTSTRAP_VERSION=1.0.67 > > exit_and_skip() > { > @@ -40,9 +42,16 @@ fi > # > > if [ -z $DEBOOTSTRAP_DIR ]; then > + NEED_DEBOOTSTRAP=false > DEBOOTSTRAP=`which debootstrap 2> /dev/null` > if [ -z $DEBOOTSTRAP ]; then > echo "No debootstrap installed, attempting to install from SCM" > + NEED_DEBOOTSTRAP=true > + elif ! (echo "${MIN_DEBOOTSTRAP_VERSION}" ; "${DEBOOTSTRAP}" --version |cut -d ' ' -f 2) |sort -VC; then Unbalanced whitespaces around '|'? "sort -VC" seems to be unavalable on OSX. Is there another way to write the check? Fam > + echo "debootstrap too old, attempting to install from SCM" > + NEED_DEBOOTSTRAP=true > + fi > + if $NEED_DEBOOTSTRAP; then > DEBOOTSTRAP_SOURCE=https://anonscm.debian.org/git/d-i/debootstrap.git > git clone ${DEBOOTSTRAP_SOURCE} ./debootstrap.git > export DEBOOTSTRAP_DIR=./debootstrap.git > -- > 1.9.1 >