Quote things in roll-freetype.sh.

A number of strings should be quoted for correctness. This allows for
proper handling of things like paths with spaces in their names.

Change-Id: I81f18d8a6be990733666ea55d20ff2fe9f2bcb34
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/499156
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This commit is contained in:
Ben Wagner 2022-01-24 15:14:21 -05:00 committed by SkCQ
parent d3f8abc95c
commit 385a90aa9d

View File

@ -1,9 +1,9 @@
#!/bin/bash
FT_GIT_REPO=https://chromium.googlesource.com/chromium/src/third_party/freetype2.git
FT_GIT_REF=origin/master
FT_GIT_DIR=third_party/externals/freetype
FT_BUILD_DIR=$(dirname -- "$0")
FT_GIT_REPO="https://chromium.googlesource.com/chromium/src/third_party/freetype2.git"
FT_GIT_REF="origin/master"
FT_GIT_DIR="third_party/externals/freetype"
FT_BUILD_DIR="$(dirname -- "$0")"
previousrev() {
STEP="original revision" &&
@ -12,8 +12,8 @@ previousrev() {
nextrev() {
STEP="next revision" &&
git -C ${FT_GIT_DIR} fetch &&
FT_NEXT_REV=$(git -C ${FT_GIT_DIR} rev-parse ${FT_GIT_REF})
git -C "${FT_GIT_DIR}" fetch &&
FT_NEXT_REV=$(git -C "${FT_GIT_DIR}" rev-parse "${FT_GIT_REF}")
}
rolldeps() {
@ -24,21 +24,21 @@ rolldeps() {
}
mergeinclude() {
SKIA_INCLUDE="include/$1/$2" &&
STEP="merge ${SKIA_INCLUDE}: check for merge conflicts" &&
SKIA_INCLUDE=include/$1/$2 &&
FT_INCLUDE=include/freetype/config/$2 &&
TMPFILE=$(mktemp) &&
git -C ${FT_GIT_DIR} cat-file blob ${FT_PREVIOUS_REV}:${FT_INCLUDE} >> ${TMPFILE} &&
git merge-file ${FT_BUILD_DIR}/${SKIA_INCLUDE} ${TMPFILE} ${FT_GIT_DIR}/${FT_INCLUDE} &&
rm ${TMPFILE} &&
git add ${FT_BUILD_DIR}/${SKIA_INCLUDE}
FT_INCLUDE="include/freetype/config/$2" &&
TMPFILE="$(mktemp)" &&
git -C "${FT_GIT_DIR}" cat-file blob "${FT_PREVIOUS_REV}:${FT_INCLUDE}" >> "${TMPFILE}" &&
git merge-file "${FT_BUILD_DIR}/${SKIA_INCLUDE}" "${TMPFILE}" "${FT_GIT_DIR}/${FT_INCLUDE}" &&
rm "${TMPFILE}" &&
git add "${FT_BUILD_DIR}/${SKIA_INCLUDE}"
}
commit() {
STEP="commit" &&
FT_PREVIOUS_REV_SHORT=$(expr substr "${FT_PREVIOUS_REV}" 1 8) &&
FT_NEXT_REV_SHORT=$(expr substr "${FT_NEXT_REV}" 1 8) &&
FT_COMMIT_COUNT=$(git -C ${FT_GIT_DIR} rev-list --count ${FT_PREVIOUS_REV}..${FT_NEXT_REV}) &&
FT_COMMIT_COUNT=$(git -C "${FT_GIT_DIR}" rev-list --count "${FT_PREVIOUS_REV}..${FT_NEXT_REV}") &&
git commit -m"Roll FreeType from ${FT_PREVIOUS_REV_SHORT} to ${FT_NEXT_REV_SHORT} (${FT_COMMIT_COUNT} commits)
${FT_GIT_REPO}/+log/${FT_PREVIOUS_REV}..${FT_NEXT_REV}