Merge "Allow ABI dumps to contain ANDROID_BUILD_TOP that is not a path prefix"
This commit is contained in:
@@ -83,9 +83,19 @@ class Target(object):
|
|||||||
def _validate_dump_content(dump_path):
|
def _validate_dump_content(dump_path):
|
||||||
"""Make sure that the dump contains relative source paths."""
|
"""Make sure that the dump contains relative source paths."""
|
||||||
with open(dump_path, 'r') as f:
|
with open(dump_path, 'r') as f:
|
||||||
if AOSP_DIR in f.read():
|
for line_number, line in enumerate(f, 1):
|
||||||
raise ValueError(
|
start = 0
|
||||||
dump_path + ' contains absolute path to $ANDROID_BUILD_TOP.')
|
while True:
|
||||||
|
start = line.find(AOSP_DIR, start)
|
||||||
|
if start < 0:
|
||||||
|
break
|
||||||
|
# The substring is not preceded by a common path character.
|
||||||
|
if start == 0 or not (line[start - 1].isalnum() or
|
||||||
|
line[start - 1] in '.-_/'):
|
||||||
|
raise ValueError(f'{dump_path} contains absolute path to '
|
||||||
|
f'$ANDROID_BUILD_TOP at line '
|
||||||
|
f'{line_number}:\n{line}')
|
||||||
|
start += len(AOSP_DIR)
|
||||||
|
|
||||||
|
|
||||||
def copy_reference_dump(lib_path, reference_dump_dir, compress):
|
def copy_reference_dump(lib_path, reference_dump_dir, compress):
|
||||||
|
|||||||
Reference in New Issue
Block a user