Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: update_depot_tools

Issue 25110004: Don't update git url if 'read' times out (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env bash 1 #!/usr/bin/env bash
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # This script will try to sync the bootstrap directories and then defer control. 6 # This script will try to sync the bootstrap directories and then defer control.
7 7
8 if [ "$USER" == "root" ]; 8 if [ "$USER" == "root" ];
9 then 9 then
10 echo Running depot tools as root is sad. 10 echo Running depot tools as root is sad.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 } 72 }
73 73
74 function update_git_repo { 74 function update_git_repo {
75 remote_url=$("$GIT" config --get remote.origin.url) 75 remote_url=$("$GIT" config --get remote.origin.url)
76 if [ -n "$remote_url" -a "$remote_url" != "$CANONICAL_GIT_URL" ]; then 76 if [ -n "$remote_url" -a "$remote_url" != "$CANONICAL_GIT_URL" ]; then
77 echo "Your copy of depot_tools is configured to fetch from an obsolete URL:" 77 echo "Your copy of depot_tools is configured to fetch from an obsolete URL:"
78 echo 78 echo
79 echo " $remote_url" 79 echo " $remote_url"
80 echo 80 echo
81 read -t 60 -p "OK to update it to $CANONICAL_GIT_URL ? [Y/n] " -n 1 81 read -t 60 -p "OK to update it to $CANONICAL_GIT_URL ? [Y/n] " -n 1
82 STATUS=$?
82 echo 83 echo
83 if [ $? -ne "0" ]; then 84 if [[ $STATUS -ne 0 ]]; then
84 echo "Timeout; not updating remote URL." 85 echo "Timeout; not updating remote URL."
85 elif [ -z "$REPLY" -o "$REPLY" = "Y" -o "$REPLY" = "y" ]; then 86 elif [ -z "$REPLY" -o "$REPLY" = "Y" -o "$REPLY" = "y" ]; then
86 "$GIT" config remote.origin.url "$CANONICAL_GIT_URL" 87 "$GIT" config remote.origin.url "$CANONICAL_GIT_URL"
87 echo "Remote URL updated." 88 echo "Remote URL updated."
88 fi 89 fi
89 fi 90 fi
90 91
91 if is_git_clone_repo; then 92 if is_git_clone_repo; then
92 git fetch -q origin &> /dev/null 93 git fetch -q origin &> /dev/null
93 local REBASE_TXT STATUS 94 local REBASE_TXT STATUS
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 # Update the root directory to stay up-to-date with the latest depot_tools. 131 # Update the root directory to stay up-to-date with the latest depot_tools.
131 BEFORE_REVISION=$(get_svn_revision) 132 BEFORE_REVISION=$(get_svn_revision)
132 "$SVN" -q up "$base_dir" 133 "$SVN" -q up "$base_dir"
133 AFTER_REVISION=$(get_svn_revision) 134 AFTER_REVISION=$(get_svn_revision)
134 if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then 135 if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then
135 echo "Depot Tools has been updated to revision $AFTER_REVISION." 1>&2 136 echo "Depot Tools has been updated to revision $AFTER_REVISION." 1>&2
136 fi 137 fi
137 fi 138 fi
138 139
139 find "$base_dir" -iname "*.pyc" -exec rm {} \; 140 find "$base_dir" -iname "*.pyc" -exec rm {} \;
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698