From b5efeecf3117d9bd25b6a17524447d7af6eb9aa4 Mon Sep 17 00:00:00 2001 From: Micah Kornfield Date: Thu, 30 Jul 2020 20:16:03 -0700 Subject: [PATCH] Fallback to google3 path of sources.json if initial link doesn't work --- src/boringssl/gen_build_yaml.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/boringssl/gen_build_yaml.py b/src/boringssl/gen_build_yaml.py index eb4a59ae8b7..0b869fa64f3 100755 --- a/src/boringssl/gen_build_yaml.py +++ b/src/boringssl/gen_build_yaml.py @@ -18,11 +18,19 @@ import os import sys import yaml +run_dir = os.path.dirname(sys.argv[0]) sources_path = os.path.abspath( - os.path.join(os.path.dirname(sys.argv[0]), + os.path.join(run_dir, '../../third_party/boringssl-with-bazel/sources.json')) -with open(sources_path, 'r') as s: - sources = json.load(s) +try: + with open(sources_path, 'r') as s: + sources = json.load(s) +except IOError: + sources_path = os.path.abspath( + os.path.join(run_dir, + '../../../../third_party/openssl/boringssl/sources.json')) + with open(sources_path, 'r') as s: + sources = json.load(s) def map_dir(filename):