5 echo "$(pwd)/$(basename "$1")"
8 if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then
9 echo "Usage: abi-prepare.sh commit abi.xml configure.sh"
16 VERSION
="$(grep -A 1 '<version>' "$XML" | grep -v version | sed "s
/^
[ ]//")"
18 FULLXML
="$(fullpath "$XML")"
19 FULLCONFIG
="$(fullpath "$CONFIG")"
24 # create target playspace
25 echo "Creating source tree..."
26 mkdir
"/tmp/$VERSION" # make sure it doesn't already exist
27 mkdir
-p "/tmp/$VERSION/rootdir"
29 # extract the commit... need to prefix rev-parse with ./ since if run
30 # in root of git repo, rev-parse will output an empty string,
31 # which we don't want to pass to cd.
32 (cd "./$(git rev-parse --show-cdup)" && \
33 git archive
--prefix="$COMMIT/" "$COMMIT") | \
34 tar -C "/tmp/$VERSION" -xf -
37 echo "Installing to: /tmp/$VERSION/rootdir..."
38 cd "/tmp/$VERSION/$COMMIT"
40 "$FULLCONFIG" --prefix="/tmp/$VERSION/rootdir"