+++ /dev/null
-#!/bin/bash
-# Copyright 2014 Google Inc.
-#
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Outputs the Last Known Good Revision of Skia.
-
-prodcertstatus -q || (echo "Please run prodaccess." 1>&2; exit 1)
-source gbash.sh || exit 2
-
-set -e
-
-# Retrieve last known good revision. (App-engine script is very flaky, so retry
-# 10 times.)
-LKGR=""
-for i in `seq 1 10`; do
- LKGR=$(curl "http://skia-tree-status-staging.appspot.com/lkgr")
- if [[ ${#LKGR} -gt 4 ]]; then
- break
- fi
-done
-[[ ${#LKGR} -gt 4 ]] || gbash::die "Unable to get Skia LKGR (got '${LKGR}')"
-echo "${LKGR}"
prodcertstatus -q || (echo "Please run prodaccess." 1>&2; exit 1)
source gbash.sh || exit 2
-DEFINE_string skia_rev "" "Git hash of Skia revision to clone, default LKGR."
+DEFINE_string skia_rev "" "Git hash of Skia revision to clone, default latest."
gbash::init_google "$@"
set -e
-# Checkout LKGR of Skia in a temp location.
+# Checkout specified revision of Skia in a temp location.
TMP=$(gbash::make_temp_dir)
pushd "${TMP}"
git clone https://skia.googlesource.com/skia
cd skia
git fetch
-if [ -z "${FLAGS_skia_rev}" ]; then
- # Retrieve last known good revision.
- MY_DIR="$(gbash::get_absolute_caller_dir)"
- FLAGS_skia_rev="$(${MY_DIR}/get_skia_lkgr.sh)"
+if [[ -z "${FLAGS_skia_rev}" ]]; then
+ # Retrieve latest revision.
+ FLAGS_skia_rev="$(git show --format=%H --no-patch origin/master)"
fi
git checkout --detach "${FLAGS_skia_rev}"
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-# Syncs //depot/google3/third_party/skia/HEAD to the last known good revision of
-# Skia. If this script is not run from a Piper client, creates a new CitC
-# client. Also updates README.google.
+# Syncs //depot/google3/third_party/skia/HEAD to the latest revision of Skia.
+# If this script is not run from a Piper client, creates a new CitC client. Also
+# updates README.google.
#
# Usage:
# ./tools/sync_google3.sh
set -e
MY_DIR="$(gbash::get_absolute_caller_dir)"
-LKGR="$(${MY_DIR}/get_skia_lkgr.sh)"
+SKIA_REV="$(git ls-remote https://skia.googlesource.com/skia refs/heads/master | cut -f 1)"
gbash::get_google3_dir && GOOGLE3="$(gbash::get_google3_dir)"
if [ -z "${GOOGLE3}" ]; then
GOOGLE3="/google/src/cloud/${USER}/${CLIENT_NAME}/google3"
fi
cd "${GOOGLE3}/third_party/skia/HEAD"
-${MY_DIR}/git_clone_to_google3.sh --skia_rev "${LKGR}"
+${MY_DIR}/git_clone_to_google3.sh --skia_rev "${SKIA_REV}"
-echo "Synced client ${CLIENT_NAME} to ${LKGR}"
+echo "Synced client ${CLIENT_NAME} to ${SKIA_REV}"
# Update README.google.
-sed --in-place "s/^Version: .*/Version: ${LKGR}/" README.google
-sed --in-place "s/URL: http:\/\/skia.googlesource.com\/skia\/+archive\/.*\.tar\.gz/URL: http:\/\/skia.googlesource.com\/skia\/+archive\/${LKGR}.tar.gz/" README.google
+sed --in-place "s/^Version: .*/Version: ${SKIA_REV}/" README.google
+sed --in-place "s/URL: http:\/\/skia.googlesource.com\/skia\/+archive\/.*\.tar\.gz/URL: http:\/\/skia.googlesource.com\/skia\/+archive\/${SKIA_REV}.tar.gz/" README.google
CURRENT_DATE=`date '+%d %B %Y'`
echo "Updated using sync_google3.sh on $CURRENT_DATE by $USER@google.com" >> README.google
# Add README.google to the default change.
g4 reopen
# Create a new CL.
-CHANGE="$(g4 change --desc "Update skia HEAD to ${LKGR}.")"
+CHANGE="$(g4 change --desc "Update skia HEAD to ${SKIA_REV}.")"
CL="$(echo "${CHANGE}" | sed "s/Change \([0-9]\+\) created.*/\1/")"
echo "Created CL ${CL} (http://cl/${CL})"