46119b
#!/bin/sh
46119b
46119b
# Usage: ./make-git-snapshot.sh [COMMIT]
46119b
#
46119b
# to make a snapshot of the given tag/branch.  Defaults to HEAD.
46119b
# Point env var REF to a local mesa repo to reduce clone time.
46119b
46119b
DIRNAME=glu-$( date +%Y%m%d )
46119b
46119b
echo REF ${REF:+--reference $REF}
46119b
echo DIRNAME $DIRNAME
46119b
echo HEAD ${1:-HEAD}
46119b
46119b
rm -rf $DIRNAME
46119b
46119b
git clone ${REF:+--reference $REF} \
46119b
	git://git.freedesktop.org/git/mesa/glu $DIRNAME
46119b
46119b
GIT_DIR=$DIRNAME/.git git archive --format=tar --prefix=$DIRNAME/ ${1:-HEAD} \
46119b
	| xz > $DIRNAME.tar.xz
46119b
46119b
# rm -rf $DIRNAME