skia2/tools/sync_google3.sh
benjaminwagner f82c13fced Reland of Fix a few bugs in the google3 sync scripts. (patchset #1 id:1 of https://codereview.chromium.org/1295213002/ )
Reason for revert:
Retry.

Original issue's description:
> Revert of Fix a few bugs in the google3 sync scripts. (patchset #1 id:1 of https://codereview.chromium.org/1291343006/ )
>
> Reason for revert:
> MacMini buildbots were unable to apply the patch.
> fatal: Could not parse object '18af0a0080cc2b2b3464292d35a0886cdade551f'.
> http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release/builds/1580
> http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Debug/builds/1474
> http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Release/builds/1566
> http://build.chromium.org/p/client.skia/builders/Perf-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Release/builds/1480
> http://build.chromium.org/p/client.skia/builders/Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release/builds/1456
> http://build.chromium.org/p/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug/builds/1364
>
>
> Original issue's description:
> > Fix a few bugs in the google3 sync scripts.
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/18af0a0080cc2b2b3464292d35a0886cdade551f
>
> TBR=mtklein@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/e349d6b92574c1b0acdb4ba1ed8ff905ea830131

TBR=mtklein@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1284093003
2015-08-18 06:25:14 -07:00

44 lines
1.4 KiB
Bash
Executable File

#!/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.
# 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.
#
# Usage:
# ./tools/sync_google3.sh
source gbash.sh || exit
set -x -e
MY_DIR="$(gbash::get_absolute_caller_dir)"
LKGR="$(${MY_DIR}/get_skia_lkgr.sh)"
gbash::get_google3_dir && GOOGLE3="$(gbash::get_google3_dir)"
if [ -z "${GOOGLE3}" ]; then
CLIENT_NAME="sync_skia_$(date '+%F-%H-%M-%S')"
${MY_DIR}/create_skia_google3_client.sh "${CLIENT_NAME}"
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}"
# 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
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}.")"
CL="$(echo "${CHANGE}" | sed "s/Change \([0-9]\+\) created.*/\1/")"
# Run TAP.
tap_presubmit -c "${CL}" -p skia