From 8d88809c008377c9f0927da0a2401b7bdd6372ba Mon Sep 17 00:00:00 2001 From: Moshe Levi Date: Thu, 9 Jun 2016 19:54:49 +0300 Subject: [PATCH] tinyipa: Fix git clone tags when 1.6.5 <= git < 1.7.10 Add additional "git checkout" to tag to make sure we are on the currect tag. This will allow to support OSes with git >= v1.6.5 e.g. CentOS 6.7 Closes-bug: #1590912 Change-Id: I87a87e1148a0590fa7e378296ce00e0a28666227 --- imagebuild/tinyipa/build-tinyipa.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/imagebuild/tinyipa/build-tinyipa.sh b/imagebuild/tinyipa/build-tinyipa.sh index 7c8c79695..0c6059537 100755 --- a/imagebuild/tinyipa/build-tinyipa.sh +++ b/imagebuild/tinyipa/build-tinyipa.sh @@ -12,6 +12,11 @@ CHROOT_CMD="sudo chroot $BUILDDIR /usr/bin/env -i PATH=$CHROOT_PATH http_proxy=$ TC=1001 STAFF=50 +# NOTE(moshele): Git < 1.7.10 requires a separate checkout, see LP #1590912 +function clone_and_checkout { + git clone $1 $2 --depth=1 --branch $3; cd $2; git checkout $3; cd - +} + echo "Building tinyipa:" # Ensure we have an extended sudo to prevent the need to enter a password over @@ -49,8 +54,8 @@ sudo sh -c "echo $TINYCORE_MIRROR_URL > $BUILDDIR/opt/tcemirror" ( cd "$BUILDDIR/tmp" && wget https://bootstrap.pypa.io/get-pip.py ) # Download TGT and Qemu-utils source -git clone https://github.com/fujita/tgt.git $BUILDDIR/tmp/tgt --depth=1 --branch v1.0.62 -git clone https://github.com/qemu/qemu.git $BUILDDIR/tmp/qemu --depth=1 --branch v2.5.0 +clone_and_checkout "https://github.com/fujita/tgt.git" "${BUILDDIR}/tmp/tgt" "v1.0.62" +clone_and_checkout "https://github.com/qemu/qemu.git" "${BUILDDIR}/tmp/qemu" "v2.5.0" # Create directory for python local mirror mkdir -p "$BUILDDIR/tmp/localpip"