diff --git a/fetch_configs/infra.py b/fetch_configs/infra.py index 9e5560703..efa50af93 100644 --- a/fetch_configs/infra.py +++ b/fetch_configs/infra.py @@ -15,21 +15,14 @@ class Infra(config_util.Config): @staticmethod def fetch_spec(props): return { - 'type': 'gclient_git', - 'gclient_git_spec': { - 'solutions': [ - { - 'name' : 'infra', - 'url' : 'https://chromium.googlesource.com/infra/infra.git', - 'managed' : False, - } - ], - }, + 'alias': { + 'config': 'infra_superproject', + }, } @staticmethod def expected_root(_props): - return 'infra' + return '' def main(argv=None): diff --git a/fetch_configs/infra_internal.py b/fetch_configs/infra_internal.py index 1279cab5e..248937d42 100644 --- a/fetch_configs/infra_internal.py +++ b/fetch_configs/infra_internal.py @@ -14,26 +14,18 @@ class InfraInternal(config_util.Config): @staticmethod def fetch_spec(_props): - def url(host, repo): - return 'https://%s.googlesource.com/%s.git' % (host, repo) - - spec = { - 'solutions': [ - { - 'name': 'infra_internal', - 'url': url('chrome-internal', 'infra/infra_internal'), - 'managed': False - }, - ], - } return { - 'type': 'gclient_git', - 'gclient_git_spec': spec, + 'alias': { + 'config': 'infra_superproject', + 'props': [ + '--checkout_internal=True', + ], + }, } @staticmethod def expected_root(_props): - return 'infra_internal' + return '' def main(argv=None): @@ -42,4 +34,3 @@ def main(argv=None): if __name__ == '__main__': sys.exit(main(sys.argv)) - diff --git a/fetch_configs/infra_superproject.py b/fetch_configs/infra_superproject.py index 537a8981a..51060e421 100644 --- a/fetch_configs/infra_superproject.py +++ b/fetch_configs/infra_superproject.py @@ -3,6 +3,7 @@ # found in the LICENSE file. import sys +import ast import config_util # pylint: disable=import-error @@ -12,7 +13,7 @@ import config_util # pylint: disable=import-error class InfraSuperproject(config_util.Config): """Basic Config class for the whole set of Infrastructure repositories.""" @staticmethod - def fetch_spec(_props): + def fetch_spec(props): def url(host, repo): return 'https://%s.googlesource.com/%s.git' % (host, repo) @@ -22,12 +23,12 @@ class InfraSuperproject(config_util.Config): 'name': '.', 'url': url('chromium', 'infra/infra_superproject'), 'managed': False, - 'custom_vars': { - 'checkout_internal': True - } + 'custom_vars': {}, }, ], } + if ast.literal_eval(props.get('checkout_internal', 'False')): + spec['solutions'][0]['custom_vars']['checkout_internal'] = True return { 'type': 'gclient_git', 'gclient_git_spec': spec,