1ce953
#!/bin/bash
1ce953
#Try to get upstream latest files
1ce953
1ce953
DATE=$(date -u +%Y%m%d)
1ce953
ARCHIVE="google-droid-fonts-$DATE"
1ce953
TMPDIR=$(mktemp -d --tmpdir=/var/tmp getdroid-XXXXXXXXXX)
1ce953
[ $? != 0 ] && exit 1
1ce953
umask 022
1ce953
pushd "$TMPDIR"
1ce953
git init
1ce953
git remote add -t HEAD origin https://android.googlesource.com/platform/frameworks/base.git
1ce953
git config core.sparseCheckout true
1ce953
cat > .git/info/sparse-checkout << EOF
1ce953
data/fonts/*
1ce953
!data/fonts/*ttf
1ce953
data/fonts/Droid*
1ce953
EOF
1ce953
git pull --depth=1 --no-tags origin HEAD
1ce953
mv data/fonts "$ARCHIVE"
1ce953
chmod -x "$ARCHIVE/*.ttf"
1ce953
tar -cvJf "$ARCHIVE.tar.xz" "$ARCHIVE"
1ce953
popd
1ce953
mv "$TMPDIR/$ARCHIVE.tar.xz" .
1ce953
rm -fr "$TMPDIR"