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