From nobody Mon Apr 29 07:50:24 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+58991+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+58991+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1589126150; cv=none; d=zohomail.com; s=zohoarc; b=CxqxI+4O/L4paVsJG0mhtoo0hL+09vPSexAma7LxwEof9nUujpt1zzw7jb9SaG+h17iTv6xi7TtsWX/GDvQK2Tq41OoIyHYf++dhfxpYKuSQoNMJ91dbwWEK0GEGhLuRy9szNCYgyPRm9KddKemzsdJNzpQ/5ig/hhAC9jGFtrY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589126150; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=0tvicphOu7/K/NydjwefDPvWDJxM+hq8zr4OsVRL5QE=; b=eHjLCYa1Kc1erfx7XAilQ6HY7jlQeNXmCIyCRIEzvhSLRrnvPIBRcqEI8CziWsI+6JLyQJfvD4nY+oMt5HLbe1+rp4a0uh5U52A44C68RmhPiE6u/tU5LGJf2joaDzP1QPMJ0MDs5Dz1BiOBgLxn2DjOvhC+d5WojhDCjVy1Udc= 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+58991+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 1589126149926895.0097869000701; Sun, 10 May 2020 08:55:49 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 6TjTYY1788612xwwwrIYHcvL; Sun, 10 May 2020 08:55:49 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web11.17206.1589126148610120506 for ; Sun, 10 May 2020 08:55:48 -0700 IronPort-SDR: wHkKnSwJe7X5ScYchO51EouL86CM0PqQQvxRClbVMo0RCSoWN5rD0ZxdI0GfKzC/hnD4fg2VcI wnYPqj7bQDHg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2020 08:55:47 -0700 IronPort-SDR: PoRH5bwiIWD578+jAwnwN1YJ6G5p9wmfS6EjK8t9FqlseN5nvkBblu8cdwPbAdh9QGhCWHTglZ fcxcFLJnyq7g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,376,1583222400"; d="scan'208";a="340315682" X-Received: from aedesimo-desk.amr.corp.intel.com ([10.212.208.216]) by orsmga001.jf.intel.com with ESMTP; 10 May 2020 08:55:47 -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] EdkRepo: Update list-repos to support multiple manifest repositories Date: Sun, 10 May 2020 08:55:38 -0700 Message-Id: <20200510155538.34956-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: OII4RHbybEwt5bShIowdVFXdx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1589126149; bh=z0nYBawbpkSKB4wa1okzAJGqqLhoBPIcB/khs5F5P98=; h=Cc:Date:From:Reply-To:Subject:To; b=ntjiE3JSftwQXEmW5RQO3+2cKs8mdDquKUgfZfwR0HbmqVj9My7CJWWmo+/PoFSM5Hc /F6Hiz//dy7bsHv9noUS1T38DvQxTxJKzTFI0VCHdlcU9SykQ41qxcjYsjQ/xnjcUAmBG PTNjvjWWNWzhhi8r6wtFjKHAFdxDcmQffa8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Update the list repos command to support calculating the list of consumed repositories from all manifests in all manifest repositories defined in both the edkrepo.cfg and the edkrepo.cfg Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman --- edkrepo/commands/list_repos_command.py | 97 +++++++++++++++++++++++++-----= ---- 1 file changed, 72 insertions(+), 25 deletions(-) diff --git a/edkrepo/commands/list_repos_command.py b/edkrepo/commands/list= _repos_command.py index b06a493..364a138 100644 --- a/edkrepo/commands/list_repos_command.py +++ b/edkrepo/commands/list_repos_command.py @@ -18,9 +18,11 @@ from edkrepo.commands.edkrepo_command import EdkrepoComm= and from edkrepo.commands.edkrepo_command import ColorArgument import edkrepo.commands.arguments.list_repos_args as arguments import edkrepo.commands.humble.list_repos_humble as humble -from edkrepo.common.common_repo_functions import pull_latest_manifest_repo from edkrepo.common.edkrepo_exception import EdkrepoInvalidParametersExcep= tion, EdkrepoManifestInvalidException from edkrepo.common.ui_functions import init_color_console +from edkrepo.common.workspace_maintenance.manifest_repos_maintenance impor= t pull_all_manifest_repos +from edkrepo.common.workspace_maintenance.manifest_repos_maintenance impor= t list_available_manifest_repos +from edkrepo.config.tool_config import CI_INDEX_FILE_NAME from edkrepo_manifest_parser.edk_manifest import CiIndexXml, ManifestXml =20 class ListReposCommand(EdkrepoCommand): @@ -52,35 +54,80 @@ class ListReposCommand(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(humble.MANIFEST_DIRECTORY) - print(global_manifest_directory) - print() - index_path =3D os.path.join(global_manifest_directory, 'CiIndex.xm= l') - - pull_latest_manifest_repo(args, config) + pull_all_manifest_repos(config['cfg_file'], config['user_cfg_file'= ]) print() =20 - #Create a dictionary containing all the manifests listed in the Ci= Index.xml file - ci_index_xml =3D CiIndexXml(index_path) + cfg_manifest_repos, user_config_manifest_repos, conflicts =3D list= _available_manifest_repos(config['cfg_file'], config['user_cfg_file']) + + found_manifests =3D {} manifests =3D {} repo_urls =3D set() - project_list =3D list(ci_index_xml.project_list) - if args.archived: - project_list.extend(ci_index_xml.archived_project_list) - for project in project_list: - xml_file =3D ci_index_xml.get_project_xml(project) - manifest =3D ManifestXml(os.path.normpath(os.path.join(global_= manifest_directory, xml_file))) - manifests[project] =3D manifest - combo_list =3D [c.name for c in manifest.combinations] + config_manifest_repos_project_list =3D [] + user_config_manifest_repos_project_list =3D [] + + for manifest_repo in cfg_manifest_repos: + # Get path to global manifest file + global_manifest_directory =3D config['cfg_file'].manifest_repo= _abs_path(manifest_repo) + if args.verbose: + print(humble.MANIFEST_DIRECTORY) + print(global_manifest_directory) + print() + #Create a dictionary containing all the manifests listed in th= e CiIndex.xml file + index_path =3D os.path.join(global_manifest_directory, CI_INDE= X_FILE_NAME) + print(index_path) + ci_index_xml =3D CiIndexXml(index_path) + config_manifest_repos_project_list =3D ci_index_xml.project_li= st if args.archived: - combo_list.extend([c.name for c in manifest.archived_combi= nations]) - for combo in combo_list: - sources =3D manifest.get_repo_sources(combo) - for source in sources: - repo_urls.add(self.get_repo_url(source.remote_url)) + config_manifest_repos_project_list.extend(ci_index_xml.arc= hived_project_list) + for project in config_manifest_repos_project_list: + xml_file =3D ci_index_xml.get_project_xml(project) + manifest =3D ManifestXml(os.path.normpath(os.path.join(glo= bal_manifest_directory, xml_file))) + found_manifests['{}:{}'.format(manifest_repo, project)] = =3D manifest + combo_list =3D [c.name for c in manifest.combinations] + if args.archived: + combo_list.extend([c.name for c in manifest.archived_c= ombinations]) + for combo in combo_list: + sources =3D manifest.get_repo_sources(combo) + for source in sources: + repo_urls.add(self.get_repo_url(source.remote_url)) + for manifest_repo in user_config_manifest_repos: + # Get path to global manifest file + global_manifest_directory =3D config['user_cfg_file'].manifest= _repo_abs_path(manifest_repo) + if args.verbose: + print(humble.MANIFEST_DIRECTORY) + print(global_manifest_directory) + print() + #Create a dictionary containing all the manifests listed in th= e CiIndex.xml file + index_path =3D os.path.join(global_manifest_directory, CI_INDE= X_FILE_NAME) + ci_index_xml =3D CiIndexXml(index_path) + user_config_manifest_repos_project_list =3D ci_index_xml.proje= ct_list + if args.archived: + user_config_manifest_repos_project_list.extend(ci_index_xm= l.archived_project_list) + for project in user_config_manifest_repos_project_list: + xml_file =3D ci_index_xml.get_project_xml(project) + manifest =3D ManifestXml(os.path.normpath(os.path.join(glo= bal_manifest_directory, xml_file))) + found_manifests['{}:{}'.format(manifest_repo, project)] = =3D manifest + combo_list =3D [c.name for c in manifest.combinations] + if args.archived: + combo_list.extend([c.name for c in manifest.archived_c= ombinations]) + for combo in combo_list: + sources =3D manifest.get_repo_sources(combo) + for source in sources: + repo_urls.add(self.get_repo_url(source.remote_url)) + + #Remove the manifest repo portion of the key is there is not a dup= licate project name + key_list =3D list(found_manifests) + for entry in key_list: + new_key =3D entry.split(':')[1] + value =3D found_manifests[entry] + del found_manifests[entry] + for found_manifest in list(found_manifests): + if found_manifest.split(':')[1] =3D=3D new_key: + new_key =3D 'Manifest Repository: {} Project: {}'.form= at(entry.split(':')[0], entry.split(':')[1]) + #break + if new_key in manifests.keys(): + new_key =3D 'Manifest Repository: {} Project: {}'.format(e= ntry.split(':'[0]), entry.split(':')[1]) + manifests[new_key] =3D value =20 #Sort the manifests so projects will be displayed alphabetically manifests =3D collections.OrderedDict(sorted(manifests.items())) --=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 (#58991): https://edk2.groups.io/g/devel/message/58991 Mute This Topic: https://groups.io/mt/74118108/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-