9b3371e
#!/bin/sh
9b3371e
9b3371e
DIRNAME=clang-$( date +%Y%m%d )
9b3371e
URL=http://llvm.org/git/clang.git
9b3371e
9b3371e
rm -rf $DIRNAME
9b3371e
git clone $URL $DIRNAME
9b3371e
cd $DIRNAME
9b3371e
if [ -z "$1" ]; then
9b3371e
    git log | head -1
9b3371e
else
9b3371e
    git checkout $1
9b3371e
fi
9b3371e
git log | head -1 | awk '{ print $2 }' > ../commitid
9b3371e
rm -rf .git
9b3371e
cd ..
9b3371e
tar cf - $DIRNAME | xz -c9 > $DIRNAME.tar.xz
9b3371e
rm -rf $DIRNAME