1#!/bin/sh
2
3# Script to update the mozilla in-tree copy of the HarfBuzz library.
4# Run this within the /gfx/harfbuzz directory of the source tree.
5
6MY_TEMP_DIR=`mktemp -d -t harfbuzz_update.XXXXXX` || exit 1
7
8VERSION=2.8.1
9
10git clone https://github.com/harfbuzz/harfbuzz ${MY_TEMP_DIR}/harfbuzz
11git -C ${MY_TEMP_DIR}/harfbuzz checkout ${VERSION}
12
13COMMIT=$(git -C ${MY_TEMP_DIR}/harfbuzz rev-parse HEAD)
14perl -p -i -e "s/(\d+\.)(\d+\.)(\d+)/${VERSION}/" README-mozilla;
15perl -p -i -e "s/\[commit [0-9a-f]{40}\]/[commit ${COMMIT}]/" README-mozilla;
16
17FILES="AUTHORS autogen.sh configure.ac COPYING git.mk harfbuzz.doap Makefile.am NEWS README.md src THANKS TODO"
18
19for f in $FILES; do
20	rm -rf $f
21	mv ${MY_TEMP_DIR}/harfbuzz/$f $f
22done
23rm -rf src/hb-ucdn
24rm -rf ${MY_TEMP_DIR}
25
26hg revert -r . src/moz.build
27hg addremove
28
29echo "###"
30echo "### Updated HarfBuzz to $COMMIT."
31echo "### Remember to verify and commit the changes to source control!"
32echo "###"
33