From ae2bc61bf0e2c5b260be27b28c1617772571ed08 Mon Sep 17 00:00:00 2001 From: Gregory NISBET Date: Wed, 28 Aug 2024 19:47:07 +0000 Subject: [PATCH] Make update_depot_tools tell you if it's skipping an update. I set DEPOT_TOOLS_UPDATE to 0 because I sometimes contribute to depot_tools (and because I was negatively impacted a few times in the past by a depot tools update in ways that I can't recall.) Anyway, if you set the DEPOT_TOOLS_UPDATE variable to 0, then even explicitly doing `update_depot_tools` from the command line will not actually do an update, you need to set the environment variable to a different value before attempting an update. This script is so old that its behavior probably shouldn't be changed. But we can tell the user what update_depot_tools is doing and why, and how to get it to do a real update. Change-Id: I67458e78b5e64f8ea75ffad73b2ede0955c4d91f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5824829 Reviewed-by: Gavin Mak Commit-Queue: Gregory Nisbet --- update_depot_tools | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/update_depot_tools b/update_depot_tools index 8ce17216b..eb7343e2a 100755 --- a/update_depot_tools +++ b/update_depot_tools @@ -119,7 +119,9 @@ function update_git_repo { } # Update git checkouts. -if [ "X$DEPOT_TOOLS_UPDATE" != "X0" ]; then +if [ "X$DEPOT_TOOLS_UPDATE" = "X0" ]; then + echo "DEPOT_TOOLS_UPDATE environment variable is 0, skipping update. Set DEPOT_TOOLS_UPDATE to 1 to force update." >&2 +else if [ -e "$base_dir/.git" ]; then cd "$base_dir" update_git_repo