Эх сурвалжийг харах

gclient: Skip calling update_depot_tools if DEPOT_TOOLS_UPDATE is 0.

Change-Id: Id33839077b3bc8748185d93ab13ed028a05b7fd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1825994
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Edward Lemur 5 жил өмнө
parent
commit
b9aca9494e
2 өөрчлөгдсөн 18 нэмэгдсэн , 11 устгасан
  1. 14 11
      gclient
  2. 4 0
      gclient.bat

+ 14 - 11
gclient

@@ -6,17 +6,20 @@
 base_dir=$(dirname "$0")
 
 if [[ "#grep#fetch#cleanup#diff#setdep#" != *"#$1#"* ]]; then
-  "$base_dir"/update_depot_tools "$@"
-  case $? in
-    123)
-      # msys environment was upgraded, need to quit.
-      exit 0
-      ;;
-    0)
-      ;;
-    *)
-      exit $?
-  esac
+  # Shall skip authomatic update?
+  if [[ $DEPOT_TOOLS_UPDATE != 0 ]]; then
+    "$base_dir"/update_depot_tools "$@"
+    case $? in
+      123)
+        # msys environment was upgraded, need to quit.
+        exit 0
+        ;;
+      0)
+        ;;
+      *)
+        exit $?
+    esac
+  fi
 fi
 
 # Ensure that "depot_tools" is somewhere in PATH so this tool can be used

+ 4 - 0
gclient.bat

@@ -4,9 +4,13 @@
 :: found in the LICENSE file.
 setlocal
 
+:: Shall skip automatic update?
+IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :CALL_GCLIENT
+
 :: Synchronize the root directory before deferring control back to gclient.py.
 call "%~dp0update_depot_tools.bat" %*
 
+:CALL_GCLIENT
 :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used
 :: standalone, but allow other PATH manipulations to take priority.
 set PATH=%PATH%;%~dp0