Blame SOURCES/make-git-snapshot.sh

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