From nobody Mon Feb 9 07:05:52 2026 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+59019+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+59019+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1589158231; cv=none; d=zohomail.com; s=zohoarc; b=bAhwVxQj21eUtmlOp/RkrFRBO70N2JRyGNlH8mvk5dxc4zHBbyrrrwJYW1N2F24/VY/a+BrebBzNq9WT26Sav3ApHxKjS70DSanYQn+Q7mWM86qsh3kmSVJqoyVOCAzLDO14YmTUYY9FbJWb3n0+cKPO8RvhGwsrZ2tckFp3JNo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589158231; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=LLoHdMmTlov4wg/ZBrl2h2Dp6919MFqLNIYcVxPNiCk=; b=IJhd/pVAzSDYRBdPP+9VdkybUCXUjMjC0cOOlH1ILGysFiENHe+4LnzDdozzew+lV5wKfx1OowUex+LBQaLHWwG40TzQ2QRNJQigiWYQN//24Ga9t5QeHdilwjpSR4GgdzWslP8EBfHIs4bUNhNZJj6PmRVkStKErai1YimGCA0= 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+59019+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 1589158231749446.5323130442249; Sun, 10 May 2020 17:50:31 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id C6OhYY1788612xsrPv3Jy7Je; Sun, 10 May 2020 17:50:31 -0700 X-Received: from mga17.intel.com (mga17.intel.com []) by mx.groups.io with SMTP id smtpd.web11.4128.1589158229244686585 for ; Sun, 10 May 2020 17:50:30 -0700 IronPort-SDR: +paxFh9VkHPWRRaEYZOo/FsfpjTYwaTPWK8idpPaczyB3Oa1kSEHYHhWQsVpqnz18RuUwtCTg1 6VP9o8BNLdRA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2020 17:50:29 -0700 IronPort-SDR: V0AVOPSWf16KPkBQNQeTg1kcc0ZiYA0kXVx0HHlGyJuK6mXoAcPeuXaIN+2ZKfrCp1sP6J9M8u cKS+vtiW/nxQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,377,1583222400"; d="scan'208";a="296747710" X-Received: from aedesimo-desk.amr.corp.intel.com ([10.212.208.216]) by fmsmga002.fm.intel.com with ESMTP; 10 May 2020 17:50:28 -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-stagin/EdkRepo] [PATCH 1/4] EdkRepo: Update sync to support multiple manifest repositories Date: Sun, 10 May 2020 17:50:23 -0700 Message-Id: <20200511005026.23532-2-ashley.e.desimone@intel.com> In-Reply-To: <20200511005026.23532-1-ashley.e.desimone@intel.com> References: <20200511005026.23532-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: 4jRy97tlksg6mQTGQ285s8Gex1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1589158231; bh=oXsG1gbN4fAagq0Bwy/iDIi7/6U+PrvqW0POc2/j57w=; h=Cc:Date:From:Reply-To:Subject:To; b=imglz/M5VM3IyIhSvWnhS+tgyEDQsVXntSg4GlTiIfqTlzVCux8gX75a7QbakjXtHJc FEhErYmlHBCuLTHa0pH+5pW/7UDgTGeEEi+0sJWwDcwEHtarDeIReHFBZlvzBRhUKjM90 aE4BBGV4NKo0NpZNei1KnfBlZATzavxIgow= 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 sync command to only update the global manifest repository that the workspace is based on and to only check the source manfiest repository for manifest updates. Update the manifest parser to ignore the 'SourceManifestRepository' field when conducting an equality operation. Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman --- edkrepo/commands/sync_command.py | 36 +++++++++++++++++----------- edkrepo_manifest_parser/edk_manifest.py | 42 +++++++++++++++++++++++++----= ---- 2 files changed, 54 insertions(+), 24 deletions(-) diff --git a/edkrepo/commands/sync_command.py b/edkrepo/commands/sync_comma= nd.py index 82f5247..d1db4f1 100644 --- a/edkrepo/commands/sync_command.py +++ b/edkrepo/commands/sync_command.py @@ -18,7 +18,7 @@ from git import Repo =20 # Our modules from edkrepo.commands.edkrepo_command import EdkrepoCommand -from edkrepo.commands.edkrepo_command import DryRunArgument, SubmoduleSkip= Argument +from edkrepo.commands.edkrepo_command import DryRunArgument, SubmoduleSkip= Argument, SourceManifestRepoArgument import edkrepo.commands.arguments.sync_args as arguments from edkrepo.common.progress_handler import GitProgressHandler from edkrepo.common.edkrepo_exception import EdkrepoUncommitedChangesExcep= tion, EdkrepoManifestNotFoundException @@ -32,8 +32,8 @@ from edkrepo.common.humble import MIRROR_BEHIND_PRIMARY_R= EPO, SYNC_NEEDS_REBASE, from edkrepo.common.humble import SYNC_BRANCH_CHANGE_ON_LOCAL, SYNC_INCOMP= ATIBLE_COMBO from edkrepo.common.humble import SYNC_REBASE_CALC_FAIL from edkrepo.common.pathfix import get_actual_path -from edkrepo.common.common_repo_functions import pull_latest_manifest_repo= , clone_repos, sparse_checkout_enabled -from edkrepo.common.common_repo_functions import reset_sparse_checkout, sp= arse_checkout, verify_manifest_data +from edkrepo.common.common_repo_functions import clone_repos, sparse_check= out_enabled +from edkrepo.common.common_repo_functions import reset_sparse_checkout, sp= arse_checkout, verify_single_manifest from edkrepo.common.common_repo_functions import checkout_repos, check_dir= ty_repos from edkrepo.common.common_repo_functions import update_editor_config from edkrepo.common.common_repo_functions import update_repo_commit_templa= te, get_latest_sha @@ -41,8 +41,12 @@ from edkrepo.common.common_repo_functions import has_pri= mary_repo_remote, fetch_ from edkrepo.common.common_repo_functions import update_hooks, maintain_su= bmodules, combinations_in_manifest from edkrepo.common.common_repo_functions import write_included_config, re= move_included_config from edkrepo.common.workspace_maintenance.workspace_maintenance import gen= erate_name_for_obsolete_backup +from edkrepo.common.workspace_maintenance.manifest_repos_maintenance impor= t pull_workspace_manifest_repo +from edkrepo.common.workspace_maintenance.manifest_repos_maintenance impor= t find_source_manifest_repo +from edkrepo.common.workspace_maintenance.manifest_repos_maintenance impor= t list_available_manifest_repos from edkrepo.common.ui_functions import init_color_console from edkrepo.config.config_factory import get_workspace_path, get_workspac= e_manifest, get_edkrepo_global_data_directory +from edkrepo.config.config_factory import get_workspace_manifest_file from edkrepo_manifest_parser.edk_manifest import CiIndexXml, ManifestXml =20 =20 @@ -71,23 +75,30 @@ class SyncCommand(EdkrepoCommand): 'required' : False, 'help-text' : arguments.OVERRIDE_HELP}) args.append(SubmoduleSkipArgument) + args.append(SourceManifestRepoArgument) return metadata =20 def run_command(self, args, config): update_editor_config(config) + workspace_path =3D get_workspace_path() initial_manifest =3D get_workspace_manifest() current_combo =3D initial_manifest.general_config.current_combo initial_sources =3D initial_manifest.get_repo_sources(current_comb= o) initial_hooks =3D initial_manifest.repo_hooks =20 - pull_latest_manifest_repo(args, config) + source_global_manifest_repo =3D find_source_manifest_repo(initial_= manifest, config['cfg_file'], config['user_cfg_file'], args.source_manifest= _repo) + pull_workspace_manifest_repo(initial_manifest, config['cfg_file'],= config['user_cfg_file'], args.source_manifest_repo, False) + cfg_manifest_repos, user_cfg_manifest_repos, conflicts =3D list_av= ailable_manifest_repos(config['cfg_file'], config['user_cfg_file']) + if source_global_manifest_repo in cfg_manifest_repos: + global_manifest_directory =3D config['cfg_file'].manifest_repo= _abs_path(source_global_manifest_repo) + verify_single_manifest(config['cfg_file'], source_global_manif= est_repo, get_workspace_manifest_file(), args.verbose) + elif source_global_manifest_repo in user_cfg_manifest_repos: + global_manifest_directory =3D config['user_cfg_file'].manifest= _repo_abs_path(source_global_manifest_repo) + verify_single_manifest(config['user_cfg_file'], source_global_= manifest_repo, get_workspace_manifest_file(), args.verbose) =20 - # Verify that the latest version of the manifest in the global man= ifest repository is not broken - global_manifest_directory =3D config['cfg_file'].manifest_repo_abs= _local_path - verify_manifest_data(global_manifest_directory, config, verbose=3D= args.verbose, verify_proj=3Dinitial_manifest.project_info.codename) if not args.update_local_manifest: - self.__check_for_new_manifest(args, config, initial_manifest, = workspace_path) + self.__check_for_new_manifest(args, config, initial_manifest, = workspace_path, global_manifest_directory) check_dirty_repos(initial_manifest, workspace_path) # Determine if sparse checkout needs to be disabled for this opera= tion sparse_settings =3D initial_manifest.sparse_settings @@ -103,7 +114,7 @@ class SyncCommand(EdkrepoCommand): =20 # Get the latest manifest if requested if args.update_local_manifest: #NOTE: hyphens in arg name replaced= with underscores due to argparse - self.__update_local_manifest(args, config, initial_manifest, w= orkspace_path) + self.__update_local_manifest(args, config, initial_manifest, w= orkspace_path, global_manifest_directory) manifest =3D get_workspace_manifest() if args.update_local_manifest: try: @@ -199,7 +210,7 @@ class SyncCommand(EdkrepoCommand): print(SPARSE_CHECKOUT) sparse_checkout(workspace_path, repo_sources_to_sync, manifest) =20 - def __update_local_manifest(self, args, config, initial_manifest, work= space_path): + def __update_local_manifest(self, args, config, initial_manifest, work= space_path, global_manifest_directory): local_manifest_dir =3D os.path.join(workspace_path, 'repo') current_combo =3D initial_manifest.general_config.current_combo initial_sources =3D initial_manifest.get_repo_sources(current_comb= o) @@ -210,8 +221,6 @@ class SyncCommand(EdkrepoCommand): origin =3D repo.remotes.origin origin.fetch() =20 - global_manifest_directory =3D config['cfg_file'].manifest_repo_abs= _local_path - #see if there is an entry in CiIndex.xml that matches the prject n= ame of the current manifest index_path =3D os.path.join(global_manifest_directory, 'CiIndex.xm= l') ci_index_xml =3D CiIndexXml(index_path) @@ -364,8 +373,7 @@ class SyncCommand(EdkrepoCommand): break return repos_to_checkout =20 - def __check_for_new_manifest(self, args, config, initial_manifest, wor= kspace_path): - global_manifest_directory =3D config['cfg_file'].manifest_repo_abs= _local_path + def __check_for_new_manifest(self, args, config, initial_manifest, wor= kspace_path, global_manifest_directory): #see if there is an entry in CiIndex.xml that matches the prject n= ame of the current manifest index_path =3D os.path.join(global_manifest_directory, 'CiIndex.xm= l') ci_index_xml =3D CiIndexXml(index_path) diff --git a/edkrepo_manifest_parser/edk_manifest.py b/edkrepo_manifest_par= ser/edk_manifest.py index 69583b1..1e2b111 100644 --- a/edkrepo_manifest_parser/edk_manifest.py +++ b/edkrepo_manifest_parser/edk_manifest.py @@ -425,6 +425,7 @@ class ManifestXml(BaseXmlHelper): element =3D subroot.find('SourceManifestRepository') if element is None: element =3D ET.SubElement(subroot, 'SourceManifestRepository') + element.tail =3D '\n' element.attrib['manifest_repo'] =3D manifest_repo self._tree.write(filename) self.__general_config.source_manifest_repo =3D manifest_repo @@ -549,7 +550,16 @@ class ManifestXml(BaseXmlHelper): if element1.text !=3D element2.text: return False if element1.tail !=3D element2.tail: - return False + if element1.tail is not None: + tail1 =3D element1.tail.strip() + else: + tail1 =3D '' + if element2.tail is not None: + tail2 =3D element2.tail.strip() + else: + tail2 =3D '' + if tail1 !=3D tail2: + return False if element1.attrib !=3D element2.attrib: return False if len(element1) !=3D len(element2): @@ -558,25 +568,37 @@ class ManifestXml(BaseXmlHelper): =20 def equals(self, other, ignore_current_combo=3DFalse): status =3D self._compare_elements(self._tree.getroot(), other._tre= e.getroot()) - if not status and ignore_current_combo: + if not status: tree1 =3D copy.deepcopy(self._tree.getroot()) tree2 =3D copy.deepcopy(other._tree.getroot()) subroot =3D tree1.find('GeneralConfig') if subroot is None: return False - element =3D subroot.find('CurrentClonedCombo') + if ignore_current_combo: + element =3D subroot.find('CurrentClonedCombo') + if element is None: + element =3D ET.SubElement(subroot, 'CurrentClonedCombo= ') + element.tail =3D '\n' + element.attrib['combination'] =3D '' + element =3D subroot.find('SourceManifestRepository') if element is None: - element =3D ET.SubElement(subroot, 'CurrentClonedCombo') - element.tail =3D '\n' - element.attrib['combination'] =3D '' + element =3D ET.SubElement(subroot, 'SourceManifestReposito= ry') + element.tail =3D'\n' + element.attrib['manifest_repo'] =3D '' subroot =3D tree2.find('GeneralConfig') if subroot is None: return False - element =3D subroot.find('CurrentClonedCombo') + if ignore_current_combo: + element =3D subroot.find('CurrentClonedCombo') + if element is None: + element =3D ET.SubElement(subroot, 'CurrentClonedCombo= ') + element.tail =3D '\n' + element.attrib['combination'] =3D '' + element =3D subroot.find('SourceManifestRepository') if element is None: - element =3D ET.SubElement(subroot, 'CurrentClonedCombo') - element.tail =3D '\n' - element.attrib['combination'] =3D '' + element =3D ET.SubElement(subroot, 'SourceManifestReposito= ry') + element.tail =3D'\n' + element.attrib['manifest_repo'] =3D '' status =3D self._compare_elements(tree1, tree2) return status =20 --=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 (#59019): https://edk2.groups.io/g/devel/message/59019 Mute This Topic: https://groups.io/mt/74126914/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-