From 5d4155755f66f0b3546c3e8d85cd8c8bbbabcc94 Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Thu, 17 May 2012 22:04:12 -0400 Subject: [PATCH] maint: changed abi checker script to use git tags instead of tarballs --- maintainer/abi/README | 10 +++++----- maintainer/abi/abi-prepare.sh | 15 +++++++++++---- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/maintainer/abi/README b/maintainer/abi/README index 68b16347..ba7270f2 100644 --- a/maintainer/abi/README +++ b/maintainer/abi/README @@ -5,14 +5,14 @@ using the tool found at: There are two scritps: - abi-prepare.sh - takes a Barry tarball, extracts it into /tmp - and builds and installs it - configure-lib.sh - support script used by abi-prepare.sh + abi-prepare.sh - extracts a git commit or tag into /tmp and builds + and installs it + configure-lib.sh - support script used by *abi-prepare.sh scripts For example, to prepare version 0.16 and 0.17.0 for comparison, run: - ./abi-prepare.sh barry-0.16.tar.bz2 0.16.xml ./configure-lib.sh - ./abi-prepare.sh barry-0.17.0.tar.bz2 0.17.0.xml ./configure-lib.sh + ./abi-prepare.sh barry-0.16 0.16.xml ./configure-lib.sh + ./abi-prepare.sh barry-0.17.0 0.17.0.xml ./configure-lib.sh To compare, run: diff --git a/maintainer/abi/abi-prepare.sh b/maintainer/abi/abi-prepare.sh index f979bafb..541c9152 100755 --- a/maintainer/abi/abi-prepare.sh +++ b/maintainer/abi/abi-prepare.sh @@ -6,11 +6,11 @@ fullpath() { } if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then - echo "Usage: abi-prepare.sh tarball abi.xml configure.sh" + echo "Usage: abi-prepare.sh commit abi.xml configure.sh" exit 1 fi -TARBALL="$1" +COMMIT="$1" XML="$2" CONFIG="$3" VERSION="$(grep -A 1 '' "$XML" | grep -v version | sed "s/^[ ]//")" @@ -25,11 +25,18 @@ set -e echo "Creating source tree..." mkdir "/tmp/$VERSION" # make sure it doesn't already exist mkdir -p "/tmp/$VERSION/rootdir" -tar -C "/tmp/$VERSION" -xjf "$TARBALL" + +# extract the commit... need to prefix rev-parse with ./ since if run +# in root of git repo, rev-parse will output an empty string, +# which we don't want to pass to cd. +(cd "./$(git rev-parse --show-cdup)" && \ + git archive --prefix="$COMMIT/" "$COMMIT") | \ + tar -C "/tmp/$VERSION" -xf - # build and install echo "Installing to: /tmp/$VERSION/rootdir..." -cd "/tmp/$VERSION/barry-$VERSION" +cd "/tmp/$VERSION/$COMMIT" +./buildgen.sh "$FULLCONFIG" --prefix="/tmp/$VERSION/rootdir" make -j2 make install -- 2.11.4.GIT