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