From nobody Tue Nov 26 04:37:45 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+59134+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+59134+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1589214001; cv=none; d=zohomail.com; s=zohoarc; b=cPuUeU8dMXHSprGE6zazdlTFLTS9UCgP5fCrAx6IqzH3oCy/F0YYZrr7wopZf98PIZoI1QHuyrVEeKioLhM4aviyoXl0NwFRtWj9pucLaKMP1oxHnKZpOflTLWVrsHY9nevgIBuAjn/fjojFT6Ix1dQS8WABZsMrXHNGMp0YrVM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589214001; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=kiFcWoFz59CEx+zFQ25It0ITiitIWtgwahLvLPmOaOI=; b=nv0lSxNrQTWkjoFM0b0eVQlLDdCmvkoyo0TAd3Kk4ANJtLbF6v2iulQUmeJt+bXVS6tKTKYQxH4mWgbKGtFZl5Ya47p+7+zJiMBZg4sE1rKNx/vWgSekA0DDRwlLIcb3snafUH/AaR5HDB9p2VsHwy4IOWmM/yhXFr0j1C5Qhm8= 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+59134+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 1589214001092188.0640336861312; Mon, 11 May 2020 09:20:01 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id I049YY1788612xSDIHLNc14f; Mon, 11 May 2020 09:20:00 -0700 X-Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web12.113.1589214000068582149 for ; Mon, 11 May 2020 09:20:00 -0700 IronPort-SDR: vUvmRrgwLuz050+tpBoXlk1rrPqXPhezGwjaGMxhm386eNknnvLzTd5N57ZJlOx6hyFu3zMNuR jPon8+SB44Pg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2020 09:19:58 -0700 IronPort-SDR: YzlXo+/zC9VI9140vTSKO7Llnc+C7RqKbzdzLM3HH2QRcNy9D4SR+V/C49s4M4MnO7xhsts7UK vwg4YFccnN8w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,380,1583222400"; d="scan'208";a="463224675" X-Received: from aedesimo-desk.amr.corp.intel.com ([10.212.18.220]) by fmsmga005.fm.intel.com with ESMTP; 11 May 2020 09:19:58 -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: Update list-repos to support multiple manifest repositories Date: Mon, 11 May 2020 09:19:54 -0700 Message-Id: <20200511161954.13940-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: cbdSSQAdtWMnTYQn37qaQYVzx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1589214000; bh=gamBW+G9dZmoqq92/jqzvfdJJiCdxmrAm7voT1HFt/8=; h=Cc:Date:From:Reply-To:Subject:To; b=oy9bK+PYKqQtkRqYxlL9Nbdw2YWyaFWsyRnTNefraKaTGNbZXPyskwjf/sougiRsTlS 9waSPxp/SZn5fTxB1rj7aJIgHHO/myU8NVReFecl0DDLwYIIXY1cXjwj8V52ZV+0y1NSO 0338jWkCrUq2XQTVNz2NOw8bvG5aSH6kj/U= 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 Reviewed-by: Erik Bjorge Reviewed-by: Nate DeSimone --- 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..b2088c0 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 (#59134): https://edk2.groups.io/g/devel/message/59134 Mute This Topic: https://groups.io/mt/74139572/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-