blob: 74fd66043d76a01f8ba72365f363a40f600fc2fa [file] [log] [blame]
#!/bin/bash
#
# Copyright 2017 The PDFium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e
set -o pipefail
set -u
REVIEWERS=`paste -s -d, third_party/freetype/OWNERS`
roll-dep -r "${REVIEWERS}" "$@" third_party/freetype/src/
FT_VERSION=`git -C third_party/freetype/src/ describe --long`
FT_COMMIT=`git -C third_party/freetype/src/ rev-parse HEAD`
FT_CPE_VERSION=$(echo ${FT_VERSION} | sed -r -e's/^VER-([0-9]+)-([0-9]+)-([0-9]+)-[0-9]+-g[0-9a-f]+$/\1.\2.\3/')
# Make sure our copy of pstables.h matches the one in freetype/src.
# May need to --bypass-hooks to prevent formatting of this file.
cp third_party/freetype/src/src/psnames/pstables.h \
third_party/freetype/include/pstables.h
sed -i "s/^Version: .*\$/Version: ${FT_VERSION%-*}/" \
third_party/freetype/README.pdfium
sed -i "s/^Revision: .*\$/Revision: ${FT_COMMIT}/" \
third_party/freetype/README.pdfium
sed -i'' -e "s@^CPEPrefix: cpe:/a:freetype:freetype:.*\$@CPEPrefix: cpe:/a:freetype:freetype:${FT_CPE_VERSION}@" \
third_party/freetype/README.pdfium
git add third_party/freetype/README.pdfium
git add third_party/freetype/include/pstables.h
git commit --quiet --amend --no-edit