From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.426.1588803774709240474 for ; Wed, 06 May 2020 15:22:54 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: ashley.e.desimone@intel.com) IronPort-SDR: IRPlaF7ZogRMCwfebsc5Wd9O8DKxk0muuRWEogSsZp1WoPVYL6M7auVDYwk4m/3Kv9IegwpPRV Zfm5rmLUzOdQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2020 15:22:53 -0700 IronPort-SDR: dfZYTUIPM7yE/XaHvoshMEwusDt+YbXXCZAAKx8olSrFeRgLEhPQMK90AmGtaOXmkxNmds+9Y4 OMhJuiFUVf0g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,360,1583222400"; d="scan'208";a="284783853" Received: from aedesimo-desk.amr.corp.intel.com ([10.254.1.73]) by fmsmga004.fm.intel.com with ESMTP; 06 May 2020 15:22:53 -0700 From: "Ashley E Desimone" To: devel@edk2.groups.io Cc: Nate DeSimone , Puja Pandya , Erik Bjorge , Bret Barkelew , Prince Agyeman Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Integrate multiple manifest repository support in the manifest command Date: Wed, 6 May 2020 15:22:48 -0700 Message-Id: <20200506222249.19028-1-ashley.e.desimone@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman --- edkrepo/commands/manifest_command.py | 79 +++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 29 deletions(-) diff --git a/edkrepo/commands/manifest_command.py b/edkrepo/commands/manifest_command.py index 44218c9..9e7d204 100644 --- a/edkrepo/commands/manifest_command.py +++ b/edkrepo/commands/manifest_command.py @@ -3,7 +3,7 @@ ## @file # manifest_command.py # -# Copyright (c) 2017- 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2017- 2020, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -18,6 +18,9 @@ import edkrepo.commands.arguments.manifest_args as arguments from edkrepo.common.edkrepo_exception import EdkrepoWorkspaceInvalidException from edkrepo.common.common_repo_functions import pull_latest_manifest_repo, verify_manifest_data from edkrepo.common.ui_functions import init_color_console +from edkrepo.common.workspace_maintenance.manifest_repos_maintenance import list_available_manifest_repos +from edkrepo.common.workspace_maintenance.manifest_repos_maintenance import pull_all_manifest_repos +from edkrepo.common.workspace_maintenance.manifest_repos_maintenance import find_source_manifest_repo from edkrepo.config.config_factory import get_workspace_manifest from edkrepo_manifest_parser.edk_manifest import CiIndexXml @@ -44,46 +47,64 @@ class ManifestCommand(EdkrepoCommand): print() init_color_console(args.color) - # Get path to global manifest file - global_manifest_directory = config['cfg_file'].manifest_repo_abs_local_path - if args.verbose: - print("Manifest directory:") - print(global_manifest_directory) - print() - index_path = os.path.join(global_manifest_directory, 'CiIndex.xml') + cfg_file = config['cfg_file'] + user_cfg = config['user_cfg_file'] + cfg_man_repos, user_cfg_man_repos, conflicts = list_available_manifest_repos(cfg_file, user_cfg) + man_repos = {} - pull_latest_manifest_repo(args, config) - print() + pull_all_manifest_repos(cfg_file, user_cfg, False) - ci_index_xml = CiIndexXml(index_path) + # Get paths to the global manifest dirs and their index files + for repo in cfg_man_repos: + global_manifest_directory = cfg_file.manifest_repo_abs_path(repo) + index_path = os.path.join(global_manifest_directory, 'CiIndex.xml') + man_repos[repo] = (global_manifest_directory, index_path) + for repo in user_cfg_man_repos: + global_manifest_directory = user_cfg.manifest_repo_abs_path(repo) + index_path = os.path.join(global_manifest_directory, 'CiIndex.xml') + man_repos[repo] = (global_manifest_directory, index_path) try: - current_project = get_workspace_manifest().project_info.codename + wkspc_manifest = get_workspace_manifest() + current_project = wkspc_manifest.project_info.codename + src_man_repo = find_source_manifest_repo(wkspc_manifest, cfg_file, user_cfg, None) except EdkrepoWorkspaceInvalidException: current_project = None + src_man_repo = None - # Attempt to make sure the manifest data is good - try: - verify_manifest_data(global_manifest_directory, config, verbose=args.verbose, verify_all=True, verify_archived=args.archived) - except: + for repo in man_repos.keys(): print() - - print("Projects:") - for project in ci_index_xml.project_list: - if project == current_project: - print("* {}{}{}".format(Fore.GREEN, project, Fore.RESET)) - else: - print(" {}".format(project)) + print("Manifest directory:") + print(repo) if args.verbose: - print(" -> {}".format(ci_index_xml.get_project_xml(project))) - - if args.archived: + print('Manifest directory path:') + print(man_repos[repo][0]) print() - print("Archived Projects:") - for project in ci_index_xml.archived_project_list: - if project == current_project: + + ci_index_xml = CiIndexXml(man_repos[repo][1]) + + # Attempt to make sure the manifest data is good + try: + verify_manifest_data(global_manifest_directory, config, verbose=args.verbose, verify_all=True, verify_archived=args.archived) + except: + print() + + print("Projects:") + for project in ci_index_xml.project_list: + if (project == current_project and src_man_repo == repo) or (not src_man_repo and project == current_project): print("* {}{}{}".format(Fore.GREEN, project, Fore.RESET)) else: print(" {}".format(project)) if args.verbose: print(" -> {}".format(ci_index_xml.get_project_xml(project))) + + if args.archived: + print() + print("Archived Projects:") + for project in ci_index_xml.archived_project_list: + if project == current_project: + print("* {}{}{}".format(Fore.GREEN, project, Fore.RESET)) + else: + print(" {}".format(project)) + if args.verbose: + print(" -> {}".format(ci_index_xml.get_project_xml(project))) -- 2.16.2.windows.1