wayland/make-git-snapshot.sh

23 lines
596 B
Bash
Raw Normal View History

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