Replace FindSrcDirPath
If the webrtc/src repo is checked out in a directory that isn't named "src", FindSrcDirPath will loop forever. Instead of trying to find the repo root, just use the location of the scripts and work out the root with os.pardir. Bug: b/333744051 Change-Id: Ifccdb85d3f9c7cb27ca57cc0b7bb96adf783660d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357980 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Gavin Mak <gavinmak@google.com> Cr-Commit-Position: refs/heads/main@{#42701}
This commit is contained in:
parent
bde30d393b
commit
c51a5c00c4
@ -21,14 +21,6 @@ import sys
|
|||||||
import urllib.request
|
import urllib.request
|
||||||
|
|
||||||
|
|
||||||
def FindSrcDirPath():
|
|
||||||
"""Returns the abs path to the src/ dir of the project."""
|
|
||||||
src_dir = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
while os.path.basename(src_dir) != 'src':
|
|
||||||
src_dir = os.path.normpath(os.path.join(src_dir, os.pardir))
|
|
||||||
return src_dir
|
|
||||||
|
|
||||||
|
|
||||||
# Skip these dependencies (list without solution name prefix).
|
# Skip these dependencies (list without solution name prefix).
|
||||||
DONT_AUTOROLL_THESE = [
|
DONT_AUTOROLL_THESE = [
|
||||||
'src/examples/androidtests/third_party/gradle',
|
'src/examples/androidtests/third_party/gradle',
|
||||||
@ -66,7 +58,8 @@ CLANG_REVISION_RE = re.compile(r'^CLANG_REVISION = \'([-0-9a-z]+)\'$')
|
|||||||
ROLL_BRANCH_NAME = 'roll_chromium_revision'
|
ROLL_BRANCH_NAME = 'roll_chromium_revision'
|
||||||
|
|
||||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
CHECKOUT_SRC_DIR = FindSrcDirPath()
|
CHECKOUT_SRC_DIR = os.path.realpath(
|
||||||
|
os.path.join(SCRIPT_DIR, os.pardir, os.pardir))
|
||||||
CHECKOUT_ROOT_DIR = os.path.realpath(os.path.join(CHECKOUT_SRC_DIR, os.pardir))
|
CHECKOUT_ROOT_DIR = os.path.realpath(os.path.join(CHECKOUT_SRC_DIR, os.pardir))
|
||||||
|
|
||||||
# Copied from tools/android/roll/android_deps/.../BuildConfigGenerator.groovy.
|
# Copied from tools/android/roll/android_deps/.../BuildConfigGenerator.groovy.
|
||||||
|
|||||||
@ -19,15 +19,8 @@ import sys
|
|||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
|
||||||
def find_src_dir_path():
|
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
"""Returns the abs path to the src/ dir of the project."""
|
SRC_DIR = os.path.realpath(os.path.join(SCRIPT_DIR, os.pardir, os.pardir))
|
||||||
src_dir = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
while os.path.basename(src_dir) != 'src':
|
|
||||||
src_dir = os.path.normpath(os.path.join(src_dir, os.pardir))
|
|
||||||
return src_dir
|
|
||||||
|
|
||||||
|
|
||||||
SRC_DIR = find_src_dir_path()
|
|
||||||
sys.path.append(os.path.join(SRC_DIR, 'build'))
|
sys.path.append(os.path.join(SRC_DIR, 'build'))
|
||||||
import find_depot_tools
|
import find_depot_tools
|
||||||
|
|
||||||
|
|||||||
@ -19,16 +19,10 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def find_src_dir_path():
|
|
||||||
"""Returns the abs path to the src/ dir of the project."""
|
|
||||||
src_dir = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
while os.path.basename(src_dir) != 'src':
|
|
||||||
src_dir = os.path.normpath(os.path.join(src_dir, os.pardir))
|
|
||||||
return src_dir
|
|
||||||
|
|
||||||
|
|
||||||
UPDATE_BRANCH_NAME = 'webrtc_version_update'
|
UPDATE_BRANCH_NAME = 'webrtc_version_update'
|
||||||
CHECKOUT_SRC_DIR = find_src_dir_path()
|
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
CHECKOUT_SRC_DIR = os.path.realpath(
|
||||||
|
os.path.join(SCRIPT_DIR, os.pardir, os.pardir))
|
||||||
|
|
||||||
NOTIFY_EMAIL = 'webrtc-trooper@webrtc.org'
|
NOTIFY_EMAIL = 'webrtc-trooper@webrtc.org'
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user