aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2019-10-07 10:43:50 -0700
committerGeorge Burgess IV <gbiv@google.com>2019-10-07 17:45:38 +0000
commit9555c912cbe9aa0abd01156885ba30e597b786d7 (patch)
treec8d4e9073b52ca1d2067d91f549082b33d0f4ed3
parentdaa58a128603f1415dad6027a79d5c7772374058 (diff)
parentc968b02291794fc765ee0bd5d0f62ab47c786141 (diff)
downloadtoolchain-utils-ndk-sysroot-r21.tar.gz
Merging 3 commit(s) from Chromium's toolchain-utilsndk-sysroot-r21
Doing this for 8acdba6, which introduces the script that generated this commit. Merged commit digest: c968b02 afdo_metadata: Publish new profiles for Chrome. 8acdba6 Add a merge-with-upstream script to toolchain-utils f723413 toolchain-utils: update skylab credential location for role account Change-Id: I64dc02294d6a2b645c70198ebee680c356b94387
-rw-r--r--afdo_metadata/chrome_afdo.json2
-rwxr-xr-xafe_lock_machine.py5
-rwxr-xr-xandroid_merge_from_upstream.sh82
3 files changed, 86 insertions, 3 deletions
diff --git a/afdo_metadata/chrome_afdo.json b/afdo_metadata/chrome_afdo.json
index bb12183b..006298df 100644
--- a/afdo_metadata/chrome_afdo.json
+++ b/afdo_metadata/chrome_afdo.json
@@ -3,7 +3,7 @@
"name": "R79-3904.19-1569836348.afdo"
},
"benchmark": {
- "name": "chromeos-chrome-amd64-79.0.3923.0_rc-r1.afdo"
+ "name": "chromeos-chrome-amd64-79.0.3931.2_rc-r1.afdo"
},
"airmont": {
"name": "R79-3904.19-1569838411.afdo"
diff --git a/afe_lock_machine.py b/afe_lock_machine.py
index 510d55f2..2f35e9bf 100755
--- a/afe_lock_machine.py
+++ b/afe_lock_machine.py
@@ -70,8 +70,9 @@ class AFELockManager(object):
SKYLAB_PATH = '/usr/local/bin/skylab'
LEASE_MINS = 600
- SKYLAB_CREDENTIAL = '/usr/local/google/home/mobiletc-prebuild/' \
- 'chromeos-swarming-1adbe355c97c.json'
+ SKYLAB_CREDENTIAL = '/usr/local/google/home/mobiletc-prebuild' \
+ '/sheriff_utils/skylab_credential' \
+ '/chromeos-swarming-credential.json'
SWARMING = 'chromite/third_party/swarming.client/swarming.py'
SUCCESS = 0
diff --git a/android_merge_from_upstream.sh b/android_merge_from_upstream.sh
new file mode 100755
index 00000000..cf07d4bf
--- /dev/null
+++ b/android_merge_from_upstream.sh
@@ -0,0 +1,82 @@
+#!/bin/bash -eu
+# Copyright 2019 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# This is a script crafted to make our Android friends' lives easier: when run
+# on their copy of toolchain-utils, this script will do all of the necessary
+# merging/branch creation/etc. to make keeping things up-to-date trivial.
+#
+# For example,
+# https://android-review.googlesource.com/c/platform/external/toolchain-utils/+/1132504/1
+
+local_branch_name="merge_with_upstream"
+local_upstream="aosp/master"
+remote="aosp"
+remote_branch="${remote}/upstream-mirror-master"
+
+my_dir="$(dirname "$(readlink -m "$0")")"
+cd "${my_dir}"
+
+ensure_head_is_upstream_master() {
+ local current_rev master_rev
+ current_rev="$(git rev-parse HEAD)"
+ master_rev="$(git rev-parse ${local_upstream})"
+ if [[ "${current_rev}" != "${master_rev}" ]]; then
+ echo "Please checkout ${local_upstream} and rerun this" >&2
+ exit
+ fi
+}
+
+ensure_no_local_branch_present() {
+ if ! git rev-parse "${local_branch_name}" >& /dev/null; then
+ return 0
+ fi
+
+ echo -n "${local_branch_name} is a valid branch already. Delete? [y/N] " >&2
+
+ local line
+ read -r line
+ if [[ "${line}" != y* && "${line}" != Y* ]]; then
+ echo "Aborted" >&2
+ exit 1
+ fi
+
+ # If we're *on* that branch, deleting it is difficult.
+ local current_branch
+ current_branch="$(git branch --show-current)"
+ if [[ "${current_branch}" == "${local_branch_name}" ]]; then
+ local rev
+ rev="$(git rev-parse HEAD)"
+ # This is fine, since we assume HEAD == upstream-mirror-master anyway
+ # (e.g., the existing branch was pointless.)
+ git checkout "${rev}"
+ fi
+ git branch -D "${local_branch_name}"
+}
+
+get_merge_commit_list() {
+ local merge_base
+ merge_base="$(git merge-base HEAD ${remote_branch})"
+ git log --oneline "${merge_base}..${remote_branch}"
+}
+
+ensure_head_is_upstream_master
+ensure_no_local_branch_present
+
+echo "Ensuring repository is up-to-date..."
+git fetch "${remote}"
+repo start "${local_branch_name}"
+
+commit_list="$(get_merge_commit_list)"
+num_commits="$(wc -l <<< "${commit_list}")"
+commit_message="Merging ${num_commits} commit(s) from Chromium's toolchain-utils
+
+Merged commit digest:
+$(sed 's/^/ /' <<< "${commit_list}")
+"
+
+git merge "${remote_branch}" -m "${commit_message}"
+echo 'NOTE: When you try to `repo upload`, repo might show a scary warning'
+echo 'about the number of changes are being uploaded. That should be fine,'
+echo 'since repo will only create CLs for commits not known to our remote.'