From nobody Fri May 3 17:58:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+58976+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+58976+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1589084473; cv=none; d=zohomail.com; s=zohoarc; b=bJJhlUKCeuIYhXrYJhGQLXCZb1N4QLigNk9Ho5e58DiZHHHBXYPB3qpysXtPVA6fqiPXFoNkcdVqT2wvf1TODlWkMpPmRWaVRxOO3Sk8TKFp+c51LwrUlsKVx1yBgDdwqprwjkT59bo42ESzY0Myk9kmGQKJckKee19oyas0hvA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589084473; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=sCOoZxGE6WgS2MtDZ7WMATJUG/ep/gi6DJ+RYTvRlxA=; b=GwfxWkluzQXSpnAj/lifmjJjOPOKmsf3LDKY0QPIctCv7PAT5uaOPE+JHHscG6lJWhfj9zryZy4JgOQSDNRx1M2PUoFIBts/4kwu5f910hUlEVL/8ZgXm1aVeJ9UPtN8Es6yBfwXKVGATjY3/L9cxQKy0xPU+ak7ntIUBJYTj4k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+58976+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1589084473246693.819632528739; Sat, 9 May 2020 21:21:13 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id PJe3YY1788612xDxYu3J7qX9; Sat, 09 May 2020 21:21:12 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.10042.1589084471308435300 for ; Sat, 09 May 2020 21:21:11 -0700 IronPort-SDR: Y5l1WvddrjbEe02AS/QGSe5Q4PJMa+kQnnzKomGpc5isORMQdIpbMBy/hTnaTZsxJdfKEydOSL iCaVOkxqVsLA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2020 21:21:10 -0700 IronPort-SDR: Bl4Xm3cy4rqCMRWgrl9nv4OlJQDWROSU5gxdnqrHsv7mvL+wafmoHClpHUZLUC9IboBlnXDZbR 05jhhNPVEBkA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,374,1583222400"; d="scan'208";a="250158768" X-Received: from aedesimo-desk.amr.corp.intel.com ([10.212.16.28]) by orsmga007.jf.intel.com with ESMTP; 09 May 2020 21:21:10 -0700 From: "Ashley E Desimone" To: devel@edk2.groups.io Cc: Nate DeSimone , Puja Pandya , Erik Bjorge , Bret Barkelew , Prince Agyeman Subject: [edk2-devel] [edk2-staging/EdkRepo] [PATCH V2] EdkRepo: Integrate multiple manifest repository support in the manifest command Date: Sat, 9 May 2020 21:21:08 -0700 Message-Id: <20200510042108.20544-1-ashley.e.desimone@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ashley.e.desimone@intel.com X-Gm-Message-State: R97RYJ78IzwYRSg5P11w2RGex1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1589084472; bh=WxCBK1pP1mBaB3sNrvvHaL1AEmn4AL7HoRVu3XASYNY=; h=Cc:Date:From:Reply-To:Subject:To; b=bfRowQD/vsdAS7DUFOj234WAxjOQz4vBzwLAajoRuoIM1d6+HuboxsQluKTxq7rd/ir 1u04A06k3Ut5uEMbD6f42MgJbpm1PtB4eJeUVyhTQRGF12034dz23y2dwZvaECUA7Zyqk zlCwvt9fdFVh0RsCD/GK2Qzb4Xnqgx9j2JM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Integrate multiple manifest repository support in the manifest command Add the validate_manifest_repo() function to common_repo_functions Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman Reviewed-by: Nate DeSimone --- edkrepo/commands/manifest_command.py | 86 +++++++++++++++++++++--------= ---- edkrepo/common/common_repo_functions.py | 14 +++++- 2 files changed, 68 insertions(+), 32 deletions(-) diff --git a/edkrepo/commands/manifest_command.py b/edkrepo/commands/manife= st_command.py index 44218c9..bb6252d 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 # =20 @@ -15,9 +15,12 @@ from colorama import Fore from edkrepo.commands.edkrepo_command import EdkrepoCommand from edkrepo.commands.edkrepo_command import ColorArgument import edkrepo.commands.arguments.manifest_args as arguments -from edkrepo.common.edkrepo_exception import EdkrepoWorkspaceInvalidExcept= ion -from edkrepo.common.common_repo_functions import pull_latest_manifest_repo= , verify_manifest_data +from edkrepo.common.edkrepo_exception import EdkrepoWorkspaceInvalidExcept= ion, EdkrepoManifestNotFoundException +from edkrepo.common.common_repo_functions import pull_latest_manifest_repo= , validate_manifest_repo from edkrepo.common.ui_functions import init_color_console +from edkrepo.common.workspace_maintenance.manifest_repos_maintenance impor= t list_available_manifest_repos +from edkrepo.common.workspace_maintenance.manifest_repos_maintenance impor= t pull_all_manifest_repos +from edkrepo.common.workspace_maintenance.manifest_repos_maintenance impor= t find_source_manifest_repo from edkrepo.config.config_factory import get_workspace_manifest from edkrepo_manifest_parser.edk_manifest import CiIndexXml =20 @@ -44,46 +47,67 @@ class ManifestCommand(EdkrepoCommand): print() init_color_console(args.color) =20 - # Get path to global manifest file - global_manifest_directory =3D config['cfg_file'].manifest_repo_abs= _local_path - if args.verbose: - print("Manifest directory:") - print(global_manifest_directory) - print() - index_path =3D os.path.join(global_manifest_directory, 'CiIndex.xm= l') + cfg_file =3D config['cfg_file'] + user_cfg =3D config['user_cfg_file'] + cfg_man_repos, user_cfg_man_repos, conflicts =3D list_available_ma= nifest_repos(cfg_file, user_cfg) + man_repos =3D {} =20 - pull_latest_manifest_repo(args, config) - print() + pull_all_manifest_repos(cfg_file, user_cfg, False) =20 - ci_index_xml =3D CiIndexXml(index_path) + # Get paths to the global manifest dirs and their index files + for repo in cfg_man_repos: + global_manifest_directory =3D cfg_file.manifest_repo_abs_path(= repo) + index_path =3D os.path.join(global_manifest_directory, 'CiInde= x.xml') + man_repos[repo] =3D (global_manifest_directory, index_path) + for repo in user_cfg_man_repos: + global_manifest_directory =3D user_cfg.manifest_repo_abs_path(= repo) + index_path =3D os.path.join(global_manifest_directory, 'CiInde= x.xml') + man_repos[repo] =3D (global_manifest_directory, index_path) =20 try: - current_project =3D get_workspace_manifest().project_info.code= name + wkspc_manifest =3D get_workspace_manifest() + current_project =3D wkspc_manifest.project_info.codename + src_man_repo =3D find_source_manifest_repo(wkspc_manifest, cfg= _file, user_cfg, None) except EdkrepoWorkspaceInvalidException: current_project =3D None + src_man_repo =3D None + except EdkrepoManifestNotFoundException: + src_man_repo =3D None =20 - # Attempt to make sure the manifest data is good - try: - verify_manifest_data(global_manifest_directory, config, verbos= e=3Dargs.verbose, verify_all=3DTrue, verify_archived=3Dargs.archived) - except: - print() =20 - print("Projects:") - for project in ci_index_xml.project_list: - if project =3D=3D current_project: - print("* {}{}{}".format(Fore.GREEN, project, Fore.RESET)) - else: - print(" {}".format(project)) + for repo in man_repos.keys(): + print() + print("Manifest directory:") + print(repo) if args.verbose: - print(" -> {}".format(ci_index_xml.get_project_xml(proje= ct))) - - 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 =3D=3D current_project: + + ci_index_xml =3D CiIndexXml(man_repos[repo][1]) + + # Attempt to make sure the manifest data is good + try: + validate_manifest_repo(man_repos[repo][0], args.verbose, a= rgs.archived) + except: + print() + + print("Projects:") + for project in sorted(ci_index_xml.project_list): + if (project =3D=3D current_project and src_man_repo =3D=3D= repo) or (not src_man_repo and project =3D=3D current_project): print("* {}{}{}".format(Fore.GREEN, project, Fore.RESE= T)) else: print(" {}".format(project)) if args.verbose: print(" -> {}".format(ci_index_xml.get_project_xml(p= roject))) + + if args.archived: + print() + print("Archived Projects:") + for project in sorted(ci_index_xml.archived_project_list): + if project =3D=3D current_project: + print("* {}{}{}".format(Fore.GREEN, project, Fore.= RESET)) + else: + print(" {}".format(project)) + if args.verbose: + print(" -> {}".format(ci_index_xml.get_project_x= ml(project))) diff --git a/edkrepo/common/common_repo_functions.py b/edkrepo/common/commo= n_repo_functions.py index 20dcb8a..eb6c4c0 100644 --- a/edkrepo/common/common_repo_functions.py +++ b/edkrepo/common/common_repo_functions.py @@ -54,6 +54,7 @@ from edkrepo.common.pathfix import get_actual_path from project_utils.sparse import BuildInfo, process_sparse_checkout from edkrepo.config.config_factory import get_workspace_path from edkrepo.config.config_factory import get_workspace_manifest +from edkrepo.config.tool_config import CI_INDEX_FILE_NAME from edkrepo.common.edkrepo_exception import EdkrepoInvalidParametersExcep= tion from edkrepo_manifest_parser.edk_manifest import CiIndexXml, ManifestXml from edkrepo.common.edkrepo_exception import EdkrepoNotFoundException, Edk= repoGitException, EdkrepoWarningException @@ -426,11 +427,22 @@ def verify_manifest_data(global_manifest_directory, c= onfig, verbose=3DFalse, verif if verbose: print_manifest_errors(manifestfile_validation_data) =20 +def validate_manifest_repo(manifest_repo, verbose=3DFalse, archived=3DFals= e): + print(VERIFY_GLOBAL) + if archived: + print(VERIFY_ARCHIVED) + manifest_validation_data =3D validate_manifestrepo(manifest_repo, arch= ived) + manifest_repo_error =3D get_manifest_validation_status(manifest_valida= tion_data) + if manifest_repo_error: + print(VERIFY_GLOBAL_FAIL) + if verbose: + print_manifest_errors(manifest_validation_data) + def verify_single_manifest(cfg_file, manifest_repo, manifest_path, verbose= =3DFalse): manifest =3D ManifestXml(manifest_path) print(VERIFY_PROJ.format(manifest.project_info.codename)) index_path =3D os.path.join(cfg_file.manifest_repo_abs_path(manifest_r= epo), CI_INDEX_FILE_NAME) - proj_val_data =3D validate_manifestfiles(index_path, [manifest_path]) + proj_val_data =3D validate_manifestfiles([manifest_path]) proj_val_error =3D get_manifest_validation_status(proj_val_data) if proj_val_error: if verbose: --=20 2.16.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#58976): https://edk2.groups.io/g/devel/message/58976 Mute This Topic: https://groups.io/mt/74109845/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-