Blame SOURCES/make-git-snapshot.sh

4a8def
#!/bin/sh
4a8def
4a8def
proto=$1
4a8def
branch=$2
4a8def
4a8def
if [ -z "$proto" ]; then
4a8def
    echo "Usage: $0 <proto name> [<branch>]"
4a8def
    exit 1
4a8def
fi
4a8def
4a8def
dirname=$proto-$( date +%Y%m%d )
4a8def
4a8def
rm -rf $dirname
4a8def
git clone git://git.freedesktop.org/git/xorg/proto/$proto $dirname
4a8def
cd $dirname
4a8def
if [ -z "$branch" ]; then
4a8def
    git log | head -1
4a8def
else
4a8def
    git checkout $branch
4a8def
fi
4a8def
sha=`git rev-list --max-count=1 --abbrev-commit HEAD`
4a8def
git repack -a -d
4a8def
cd ..
4a8def
4a8def
# append sha to dirname
4a8def
mv $dirname $dirname-git$sha
4a8def
dirname=$dirname-git$sha
4a8def
tarball=$dirname.tar.bz2
4a8def
tar jcf $tarball $dirname
4a8def
rm -rf $dirname
4a8def
echo "$tarball is now available"