[build system] If there's an OVERRIDE, don't guess the current SCM.

This makes automatic checkout work even in situations where the
current repository can't be determined, such as in the case of a 
Git tag.

llvm-svn: 306460
This commit is contained in:
Sean Callanan 2017-06-27 20:35:53 +00:00
parent 9e1ade93a8
commit 5805d9e9ac
2 changed files with 14 additions and 0 deletions

View File

@ -43,6 +43,9 @@ def process_repo(r):
}
def XCODE_REPOSITORIES():
override = repo.get_override()
if override:
return [process_repo(r) for r in override]
identifier = repo.identifier()
if identifier == None:
identifier = "<invalid>" # repo.find will just use the fallback file

View File

@ -21,6 +21,17 @@ def identifier():
pass
return None
def get_override():
dir = os.path.dirname(os.path.realpath(__file__))
repos_dir = os.path.join(dir, "repos")
json_regex = re.compile(r"^.*.json$")
override_path = os.path.join(repos_dir, "OVERRIDE")
if os.path.isfile(override_path):
override_set = json.load(open(override_path))
return override_set["repos"]
else:
return None
def find(identifier):
dir = os.path.dirname(os.path.realpath(__file__))
repos_dir = os.path.join(dir, "repos")