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

Side by Side Diff: update_depot_tools

Issue 7016002: Early exit auto-update when running as root. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 7 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) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 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" ];
9 then
10 echo Running depot tools as root is sad.
11 exit
12 fi
13
8 base_dir=$(dirname "$0") 14 base_dir=$(dirname "$0")
9 if [ -L "$base_dir" ] 15 if [ -L "$base_dir" ]
10 then 16 then
11 base_dir=`cd "$base_dir" && pwd -P` 17 base_dir=`cd "$base_dir" && pwd -P`
12 fi 18 fi
13 19
14 # Test git and git --version. 20 # Test git and git --version.
15 function test_git { 21 function test_git {
16 local GITV="$(git --version)" || { 22 local GITV="$(git --version)" || {
17 echo "git isn't installed, please install it" 23 echo "git isn't installed, please install it"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 then 72 then
67 # Update the bootstrap directory to stay up-to-date with the latest 73 # Update the bootstrap directory to stay up-to-date with the latest
68 # depot_tools. 74 # depot_tools.
69 BEFORE_REVISION=$(get_svn_revision) 75 BEFORE_REVISION=$(get_svn_revision)
70 svn -q up "$base_dir" 76 svn -q up "$base_dir"
71 AFTER_REVISION=$(get_svn_revision) 77 AFTER_REVISION=$(get_svn_revision)
72 if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then 78 if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then
73 echo "Depot Tools has been updated to revision $AFTER_REVISION." 1>&2 79 echo "Depot Tools has been updated to revision $AFTER_REVISION." 1>&2
74 fi 80 fi
75 fi 81 fi
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