mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
depot_tools: Simplify MinGW check.
Check `if [[ $(uname -s) = MINGW* ]]` instead of using grepping and an additional variable. Change-Id: I6f2cfbb6743357125e6672b77667ee5e36d3d81e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2127674 Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
This commit is contained in:
5
fetch
5
fetch
@@ -9,16 +9,13 @@ base_dir=$(dirname "$0")
|
|||||||
# standalone, but allow other PATH manipulations to take priority.
|
# standalone, but allow other PATH manipulations to take priority.
|
||||||
PATH=$PATH:$base_dir
|
PATH=$PATH:$base_dir
|
||||||
|
|
||||||
# MINGW will equal 0 if we're running on Windows under MinGW.
|
|
||||||
MINGW=$(uname -s | grep MINGW > /dev/null; echo $?)
|
|
||||||
|
|
||||||
if [[ $GCLIENT_PY3 == 1 ]]; then
|
if [[ $GCLIENT_PY3 == 1 ]]; then
|
||||||
# Explicitly run on Python 3
|
# Explicitly run on Python 3
|
||||||
PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/fetch.py" "$@"
|
PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/fetch.py" "$@"
|
||||||
elif [[ $GCLIENT_PY3 == 0 ]]; then
|
elif [[ $GCLIENT_PY3 == 0 ]]; then
|
||||||
# Explicitly run on Python 2
|
# Explicitly run on Python 2
|
||||||
PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/fetch.py" "$@"
|
PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/fetch.py" "$@"
|
||||||
elif [[ $MINGW = 0 ]]; then
|
elif [[ $(uname -s) = MINGW* || $(uname -s) = CYGWIN* ]]; then
|
||||||
# Run on Python 2 on Windows for now, allows default to be flipped.
|
# Run on Python 2 on Windows for now, allows default to be flipped.
|
||||||
PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/fetch.py" "$@"
|
PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/fetch.py" "$@"
|
||||||
else
|
else
|
||||||
|
|||||||
5
gclient
5
gclient
@@ -26,16 +26,13 @@ fi
|
|||||||
# standalone, but allow other PATH manipulations to take priority.
|
# standalone, but allow other PATH manipulations to take priority.
|
||||||
PATH=$PATH:$base_dir
|
PATH=$PATH:$base_dir
|
||||||
|
|
||||||
# MINGW will equal 0 if we're running on Windows under MinGW.
|
|
||||||
MINGW=$(uname -s | grep MINGW > /dev/null; echo $?)
|
|
||||||
|
|
||||||
if [[ $GCLIENT_PY3 == 1 ]]; then
|
if [[ $GCLIENT_PY3 == 1 ]]; then
|
||||||
# Explicitly run on Python 3
|
# Explicitly run on Python 3
|
||||||
PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/gclient.py" "$@"
|
PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/gclient.py" "$@"
|
||||||
elif [[ $GCLIENT_PY3 == 0 ]]; then
|
elif [[ $GCLIENT_PY3 == 0 ]]; then
|
||||||
# Explicitly run on Python 2
|
# Explicitly run on Python 2
|
||||||
PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/gclient.py" "$@"
|
PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/gclient.py" "$@"
|
||||||
elif [[ $MINGW = 0 ]]; then
|
elif [[ $(uname -s) = MINGW* || $(uname -s) = CYGWIN* ]]; then
|
||||||
# Run on Python 2 on Windows for now, allows default to be flipped.
|
# Run on Python 2 on Windows for now, allows default to be flipped.
|
||||||
PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/gclient.py" "$@"
|
PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/gclient.py" "$@"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -48,16 +48,13 @@ SCRIPT="${SCRIPT-${BASENAME//-/_}.py}"
|
|||||||
# standalone, but allow other PATH manipulations to take priority.
|
# standalone, but allow other PATH manipulations to take priority.
|
||||||
PATH=$PATH:$DEPOT_TOOLS
|
PATH=$PATH:$DEPOT_TOOLS
|
||||||
|
|
||||||
# MINGW will equal 0 if we're running on Windows under MinGW.
|
|
||||||
MINGW=$(uname -s | grep MINGW > /dev/null; echo $?)
|
|
||||||
|
|
||||||
if [[ $GCLIENT_PY3 = 1 ]]; then
|
if [[ $GCLIENT_PY3 = 1 ]]; then
|
||||||
# Explicitly run on Python 3
|
# Explicitly run on Python 3
|
||||||
vpython3 "$DEPOT_TOOLS/$SCRIPT" "$@"
|
vpython3 "$DEPOT_TOOLS/$SCRIPT" "$@"
|
||||||
elif [[ $GCLIENT_PY3 = 0 ]]; then
|
elif [[ $GCLIENT_PY3 = 0 ]]; then
|
||||||
# Explicitly run on Python 2
|
# Explicitly run on Python 2
|
||||||
vpython "$DEPOT_TOOLS/$SCRIPT" "$@"
|
vpython "$DEPOT_TOOLS/$SCRIPT" "$@"
|
||||||
elif [[ $MINGW = 0 ]]; then
|
elif [[ $(uname -s) = MINGW* || $(uname -s) = CYGWIN* ]]; then
|
||||||
# Run on Python 2 on Windows for now, allows default to be flipped.
|
# Run on Python 2 on Windows for now, allows default to be flipped.
|
||||||
vpython "$DEPOT_TOOLS/$SCRIPT" "$@"
|
vpython "$DEPOT_TOOLS/$SCRIPT" "$@"
|
||||||
else
|
else
|
||||||
|
|||||||
5
roll-dep
5
roll-dep
@@ -9,16 +9,13 @@ base_dir=$(dirname "$0")
|
|||||||
# standalone, but allow other PATH manipulations to take priority.
|
# standalone, but allow other PATH manipulations to take priority.
|
||||||
PATH=$PATH:$base_dir
|
PATH=$PATH:$base_dir
|
||||||
|
|
||||||
# MINGW will equal 0 if we're running on Windows under MinGW.
|
|
||||||
MINGW=$(uname -s | grep MINGW > /dev/null; echo $?)
|
|
||||||
|
|
||||||
if [[ $GCLIENT_PY3 = 1 ]]; then
|
if [[ $GCLIENT_PY3 = 1 ]]; then
|
||||||
# Explicitly run on Python 3
|
# Explicitly run on Python 3
|
||||||
PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/roll_dep.py" "$@"
|
PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/roll_dep.py" "$@"
|
||||||
elif [[ $GCLIENT_PY3 = 0 ]]; then
|
elif [[ $GCLIENT_PY3 = 0 ]]; then
|
||||||
# Explicitly run on Python 2
|
# Explicitly run on Python 2
|
||||||
PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/roll_dep.py" "$@"
|
PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/roll_dep.py" "$@"
|
||||||
elif [[ $MINGW = 0 ]]; then
|
elif [[ $(uname -s) = MINGW* || $(uname -s) = CYGWIN* ]]; then
|
||||||
# Run on Python 2 on Windows for now, allows default to be flipped.
|
# Run on Python 2 on Windows for now, allows default to be flipped.
|
||||||
PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/roll_dep.py" "$@"
|
PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/roll_dep.py" "$@"
|
||||||
else
|
else
|
||||||
|
|||||||
5
vpython3
5
vpython3
@@ -39,12 +39,9 @@ base_dir=$(dirname "$0")
|
|||||||
source "$base_dir/cipd_bin_setup.sh"
|
source "$base_dir/cipd_bin_setup.sh"
|
||||||
cipd_bin_setup &> /dev/null
|
cipd_bin_setup &> /dev/null
|
||||||
|
|
||||||
# MINGW will equal 0 if we're running on Windows under MinGW.
|
|
||||||
MINGW=$(uname -s | grep MINGW > /dev/null; echo $?)
|
|
||||||
|
|
||||||
# If Python bootstrapping is not disabled, make sure Python has been
|
# If Python bootstrapping is not disabled, make sure Python has been
|
||||||
# bootstrapped and add it to the front of PATH.
|
# bootstrapped and add it to the front of PATH.
|
||||||
if [[ $MINGW = 0 ]]; then
|
if [[ $(uname -s) = MINGW* || $(uname -s) = CYGWIN* ]]; then
|
||||||
cmd.exe //c $0.bat "$@"
|
cmd.exe //c $0.bat "$@"
|
||||||
elif [[ $DEPOT_TOOLS_BOOTSTRAP_PYTHON3 != 0 ]]; then
|
elif [[ $DEPOT_TOOLS_BOOTSTRAP_PYTHON3 != 0 ]]; then
|
||||||
if [[ ! -e "$base_dir/python3_bin_reldir.txt" ]]; then
|
if [[ ! -e "$base_dir/python3_bin_reldir.txt" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user