summaryrefslogtreecommitdiff
path: root/third_party/freetype/roll-freetype.sh
diff options
context:
space:
mode:
authorTom Anderson <thomasanderson@chromium.org>2017-12-19 23:07:45 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-19 23:07:45 +0000
commitc3532457d457e868afb8506e047ab353f2651bc0 (patch)
tree9dde3974172f6ccd3ef6d3e2aac2a60abc731c9d /third_party/freetype/roll-freetype.sh
parent30ef542b6f631f0ffbcd4110857e7c1a304a8a23 (diff)
downloadpdfium-c3532457d457e868afb8506e047ab353f2651bc0.tar.xz
Fix use_system_freetype=true build when third_party/freetype is missing
BUG=pdfium:733 R=thestig@chromium.org Change-Id: I6beab792c0b8cb0d0e4f5ea8c6e6c3138ccade5f Reviewed-on: https://pdfium-review.googlesource.com/21470 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'third_party/freetype/roll-freetype.sh')
-rwxr-xr-xthird_party/freetype/roll-freetype.sh33
1 files changed, 26 insertions, 7 deletions
diff --git a/third_party/freetype/roll-freetype.sh b/third_party/freetype/roll-freetype.sh
index 12c656de28..0930a64847 100755
--- a/third_party/freetype/roll-freetype.sh
+++ b/third_party/freetype/roll-freetype.sh
@@ -1,7 +1,26 @@
-REVIEWERS=`paste -s -d, third_party/freetype/OWNERS` &&
-roll-dep -r "${REVIEWERS}" "$@" pdfium/third_party/freetype/src/ &&
-FTVERSION=`git -C third_party/freetype/src/ describe --long` &&
-FTCOMMIT=`git -C third_party/freetype/src/ rev-parse HEAD` &&
-sed -i "s/^Version: .*\$/Version: ${FTVERSION%-*}/" third_party/freetype/README.pdfium &&
-sed -i "s/^Revision: .*\$/Revision: ${FTCOMMIT}/" third_party/freetype/README.pdfium &&
-git add third_party/freetype/README.pdfium && git commit --quiet --amend --no-edit
+#!/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}" "$@" pdfium/third_party/freetype/src/
+FTVERSION=`git -C third_party/freetype/src/ describe --long`
+FTCOMMIT=`git -C third_party/freetype/src/ rev-parse HEAD`
+
+# Make sure our copy of pstables.h matches the one in freetype/src.
+cmp third_party/freetype/src/src/psnames/pstables.h \
+ third_party/freetype/include/pstables.h
+
+sed -i "s/^Version: .*\$/Version: ${FTVERSION%-*}/" \
+ third_party/freetype/README.pdfium
+sed -i "s/^Revision: .*\$/Revision: ${FTCOMMIT}/" \
+ third_party/freetype/README.pdfium
+
+git add third_party/freetype/README.pdfium
+git commit --quiet --amend --no-edit