From nobody Sun May 5 09:39:50 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+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 Reviewed-by: Nate DeSimone --- 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- From nobody Sun May 5 09:39:50 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+59020+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+59020+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=mzUCYiwiNtGK8BPMzBWXFrFHl6FL6ikh/H7SZZr9MaO4IUQa0r4x++nUiwzcu08dMffl9vJFlOAeO7D+0gK9kik/A4Kx5IUBCdMjE4wUcQ9ERv2/Hzo+dgFlLpIC1qYIWvxVDWhwXBzn4OGshXl6m/4tP8Pe3XGC6q2ktMbyAgw= 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=7ON+VsftcKepUZCAIUwJvmZgmaZL48snyithzYnUyrg=; b=iBfgjTxNqiprzPMoHUFYVXaqD9lVzCkqxJ+L2pR6+5uy7u1zklCfb2dwpMFXNjcq2u7fa+sqWVTecddkczyDbSn6nJqxBTPqBiqA2FOZi/3JkBSwvEFwxxphLQVouFgGX3l5K7R4AxTS6mA7uVHrrzQV3Vt+fSvMLSBhiYryjWQ= 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+59020+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 1589158230952116.60753717833052; Sun, 10 May 2020 17:50:30 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id qB5mYY1788612x3qGlCAvCwp; Sun, 10 May 2020 17:50:30 -0700 X-Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.4017.1589158230010710343 for ; Sun, 10 May 2020 17:50:30 -0700 IronPort-SDR: yY/yrGwDOzEkD+HOADdW3SrHHI3No6nJRXFD6lLrFBBlvtTuivAqCxZvQzA75HvKWGjzGdQjwy AXghv1YkewTQ== 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: mcwqjwLV96WpKdaaIj95/s2xm0LN6dU6ZuhAZWm5DxrS/7XFCdjm1w0S5BhFsUlOq/r+XOPbvX 0kGbxXdT/s+w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,377,1583222400"; d="scan'208";a="296747715" 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:29 -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-staing/EdkRepo] [PATCH 2/4] EdkRepo: Remove unused functions from common_repo_functions.py Date: Sun, 10 May 2020 17:50:24 -0700 Message-Id: <20200511005026.23532-3-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: n6HyoRN0u1XAdgdBxqzDtDbEx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1589158230; bh=Av9zt5FprkP9Hi3e3mvUizUb2/K7MjOm+tCPdWPbYHc=; h=Cc:Date:From:Reply-To:Subject:To; b=Pi42npvi9b4MOhsJXVXIIViqS5grrtUrMXCQxyRxDmHlRldFQ+sACwSSlzMZBB4aOtl xtXHxuAc+yRhUhh/Fi1harP+22lyygScORMutKfWISU2EOdbeApniHBdSFOLlSRZ/0Cs3 3K2T6xCwm4+WPbZVX7dmR3sQPXSws7ThWkI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Remove unused functions from common_repo_functions.py and remove any remaining imports of them. 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 | 2 +- edkrepo/common/common_repo_functions.py | 40 -----------------------------= ---- edkrepo/common/humble.py | 4 ++-- 3 files changed, 3 insertions(+), 43 deletions(-) diff --git a/edkrepo/commands/manifest_command.py b/edkrepo/commands/manife= st_command.py index bb6252d..5c6184f 100644 --- a/edkrepo/commands/manifest_command.py +++ b/edkrepo/commands/manifest_command.py @@ -16,7 +16,7 @@ from edkrepo.commands.edkrepo_command import EdkrepoComma= nd from edkrepo.commands.edkrepo_command import ColorArgument import edkrepo.commands.arguments.manifest_args as arguments 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.common_repo_functions import 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 diff --git a/edkrepo/common/common_repo_functions.py b/edkrepo/common/commo= n_repo_functions.py index eb6c4c0..5ec834b 100644 --- a/edkrepo/common/common_repo_functions.py +++ b/edkrepo/common/common_repo_functions.py @@ -73,14 +73,6 @@ CLEAR_LINE =3D '\x1b[K' DEFAULT_REMOTE_NAME =3D 'origin' PRIMARY_REMOTE_NAME =3D 'primary' =20 -def pull_latest_manifest_repo(args, config, reset_hard=3DFalse): - repo_url =3D config['cfg_file'].manifest_repo_url - branch =3D config['cfg_file'].manifest_repo_branch - local_path =3D config['cfg_file'].manifest_repo_local_path - init_color_console(False) - pull_single_manifest_repo(repo_url, branch, local_path, reset_hard) - - def clone_repos(args, workspace_dir, repos_to_clone, project_client_side_h= ooks, config, skip_submodule, manifest): for repo_to_clone in repos_to_clone: local_repo_path =3D os.path.join(workspace_dir, repo_to_clone.root) @@ -395,38 +387,6 @@ def checkout_repos(verbose, override, repos_to_checkou= t, workspace_path, manifes if repo_to_checkout.enable_submodule: maintain_submodules(repo_to_checkout, repo, verbose) =20 -def verify_manifest_data(global_manifest_directory, config, verbose=3DFals= e, verify_all=3DFalse, verify_proj=3DNone, verify_archived=3DFalse): - # Validate the project individual project selected - if verify_proj: - print(VERIFY_PROJ.format(verify_proj)) - ci_index_path =3D os.path.join(config['cfg_file'].manifest_repo_ab= s_local_path, 'CiIndex.xml') - ci_index =3D CiIndexXml(ci_index_path) - try: - proj_path =3D find_project_in_index(verify_proj, ci_index, con= fig['cfg_file'].manifest_repo_abs_local_path, VERIFY_PROJ_NOT_IN_INDEX.form= at(verify_proj)) - except EdkrepoInvalidParametersException: - raise - if proj_path: - proj_val_data =3D validate_manifestfiles([proj_path]) - proj_val_error =3D get_manifest_validation_status(proj_val_dat= a) - if proj_val_error: - if verbose: - print_manifest_errors(proj_val_data) - raise EdkrepoManifestInvalidException(VERIFY_PROJ_FAIL.for= mat(verify_proj)) - - # Validate the entire global manifest repository. - if verify_all: - print(VERIFY_GLOBAL) - if verify_archived: - print(VERIFY_ARCHIVED) - # Attempt to make sure the manifest data is good - manifestfile_validation_data =3D validate_manifestrepo(global_mani= fest_directory, verify_archived) - manifest_repo_error =3D get_manifest_validation_status(manifestfil= e_validation_data) - # Display errors - if manifest_repo_error: - print(VERIFY_GLOBAL_FAIL) - if verbose: - print_manifest_errors(manifestfile_validation_data) - def validate_manifest_repo(manifest_repo, verbose=3DFalse, archived=3DFals= e): print(VERIFY_GLOBAL) if archived: diff --git a/edkrepo/common/humble.py b/edkrepo/common/humble.py index 8ca38bb..f905357 100644 --- a/edkrepo/common/humble.py +++ b/edkrepo/common/humble.py @@ -41,7 +41,7 @@ SYNC_COMMITS_ON_MASTER =3D 'Commits were found on {0} bra= nch.\n (use the "--overr SYNC_ERROR =3D '\nError: Some repositories were not updated.' SYNC_MANIFEST_NOT_FOUND =3D 'A manifest for project, {0}, was not found.\n= To complete this operation please rerun the command with the --override fla= g\n' + SYNC_EXIT SYNC_URL_CHANGE =3D 'The URL for the remote, {0} has changed.\n' + SYNC_EX= IT -SYNC_COMBO_CHANGE =3D 'The current checked out combination, {0}, does not = exist in the latest manifest for project, {1}\n'=20 +SYNC_COMBO_CHANGE =3D 'The current checked out combination, {0}, does not = exist in the latest manifest for project, {1}\n' SYNC_REPO_CHANGE =3D 'The latest manifest for project, {0}, requires a cha= nge in currently cloned repositories.\nTo complete this operation please re= run the command with the --override flag\n' + SYNC_EXIT SYNC_SOURCE_MOVE_WARNING =3D '{}{}WARNING:{}{} {{}} being moved to {{}}'.f= ormat(Style.BRIGHT, Fore.RED, Style.RESET_ALL, Fore.RED) SYNC_REMOVE_WARNING =3D '{}{}WARNING:{}{} The following repos no longer ex= ist in the new manifest and can no \nlonger be used for submitting code. Pl= ease manually delete the following \ndirectories after saving any work you = have in them:'.format(Style.BRIGHT, Fore.RED, Style.RESET_ALL, Fore.RED) @@ -130,7 +130,7 @@ ERROR_WRITING_INCLUDE =3D 'An error occured while writt= ing the URL redirection con #Error messages for squash.py SQUASH_COMMON_ANCESTOR_REQUIRED =3D '{} is not in the same branch history = as {}, unable to operate on this commit range.' =20 -# Messages for common_repo_functions.verify_manifest_data() +# Messages for common_repo_functions. VERIFY_GLOBAL =3D 'Verifying the active projects in the global manifest re= pository\n' VERIFY_ARCHIVED =3D 'Verifying the archived projects in the global manifes= t repository\n' VERIFY_GLOBAL_FAIL =3D 'Unable to verify the contents of the global manife= st repository\n' --=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 (#59020): https://edk2.groups.io/g/devel/message/59020 Mute This Topic: https://groups.io/mt/74126915/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- From nobody Sun May 5 09:39:50 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+59021+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+59021+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1589158232; cv=none; d=zohomail.com; s=zohoarc; b=HKR58v01iYvSvwHxhVr6ysCGe7QdIy1hA8S776eYFXSzsWoHOUq110Z6WnolDd706BHax+NU82OPTBFbgmkrgs1U/4VKeqrN2NktZohV1OCcrQ6ZvTFvAD+FEwLifJ/U5cdmnp5tTlaKEngbWDnkb3gy+MakacmSiMMTBWxpH5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589158232; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=wfwy/9NdvAFmRoqDp3kGPYABTwi4Gnx0Ay55gsXVsf4=; b=DL80ChHfqZ00hze7yzcy0lisXHPx8RHsvx+y4UU0HtdUvjjU0CMRS4BdZFufOb4xFK28MxAXcXteEa5uFe4hJcXH1p2LxKJvIz2fLsbasFFL1jt42vmEi+qKlVVgnx7wY6EewJbmJoDzo6MpjkDzxPre+4RiwEuQa2G+Pco6SBI= 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+59021+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 1589158232598345.51638615389425; Sun, 10 May 2020 17:50:32 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id lSLTYY1788612xcELenwGBFG; Sun, 10 May 2020 17:50:32 -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: 1eQTPhq0A3XfOsym3eaIoBWuZoJGyQjMCzkGDoCZEL2dqFbpDd4dJHV4MtJxTT3AFoQTBL54rR jY5AQ8Q+sJLw== 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: aAJJbFL2moh33/yVKyKZWp84snrjW49LJl/wb7kf5CzIhgMbsI+99i/XFrdIpTAS2cVsVAdev5 dbowHr6ahyqw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,377,1583222400"; d="scan'208";a="296747721" 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:29 -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 3/4] EdkRepo: Add support for multiple manifest repostories to command completions Date: Sun, 10 May 2020 17:50:25 -0700 Message-Id: <20200511005026.23532-4-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: xXD8TYnyPZwAN6sEcsj4oQPFx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1589158232; bh=YqEVIDzbjXxdZpzMGT8x/4Q0agJJPV2rvhCEP92SqrY=; h=Cc:Date:From:Reply-To:Subject:To; b=GbUfiytzvIb0hkFk2gGB+nWEVMsBURBjEw1oWJpf9XG70NAy0UqSsbvdOEhwNbJ9AW/ drzD1CFAtlA3qJNnCerVIGJcskQkLzNkvXSN2EtlNngvPkSvG2IfGXeWKcQLVwIDr/swS GnuoCtoU23va0OPSRwRJdjoThqx5r42ebfY= 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 command completions for the checkout pin command to support multiple manifest repositories. If a source manifest repository cannot be found for the current workspace then no completions will be provided. 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/command_completion_edkrepo.py | 48 +++++++++++++++++++++++--------= ---- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/edkrepo/command_completion_edkrepo.py b/edkrepo/command_comple= tion_edkrepo.py index 1220924..8a2c0e6 100644 --- a/edkrepo/command_completion_edkrepo.py +++ b/edkrepo/command_completion_edkrepo.py @@ -15,6 +15,9 @@ import traceback =20 from edkrepo_manifest_parser.edk_manifest import ManifestXml from edkrepo.common.common_repo_functions import combinations_in_manifest +from edkrepo.common.edkrepo_exception import EdkrepoManifestNotFoundExcept= ion +from edkrepo.common.workspace_maintenance.manifest_repos_maintenance impor= t list_available_manifest_repos +from edkrepo.common.workspace_maintenance.manifest_repos_maintenance impor= t find_source_manifest_repo from edkrepo.config import config_factory from edkrepo.config.config_factory import get_workspace_manifest =20 @@ -28,23 +31,36 @@ def current_combo(parsed_args, config): =20 def checkout_pin(parsed_args, config): pins =3D [] - manifest_directory =3D config['cfg_file'].manifest_repo_abs_local_path manifest =3D get_workspace_manifest() - pin_folder =3D os.path.normpath(os.path.join(manifest_directory, manif= est.general_config.pin_path)) - for dirpath, _, filenames in os.walk(pin_folder): - for file in filenames: - pin_file =3D os.path.join(dirpath, file) - # Capture error output from manifest parser stdout so it is hi= dden unless verbose is enabled - stdout =3D sys.stdout - sys.stdout =3D io.StringIO() - pin =3D ManifestXml(pin_file) - parse_output =3D sys.stdout.getvalue() - sys.stdout =3D stdout - if parsed_args.verbose and parse_output.strip() !=3D '': - print('Pin {} Parsing Errors: {}\n'.format(file, parse_out= put.strip())) - if pin.project_info.codename =3D=3D manifest.project_info.code= name: - pins.append(file) - print(' '.join(pins)) + manifest_directory =3D None + try: + source_manifest_repo =3D find_source_manifest_repo(manifest, confi= g['cfg_file'], config['user_cfg_file'], ) + if source_manifest_repo: + cfg, user_cfg, conflicts =3D list_available_manifest_repos(con= fig['cfg_file'], config['user_cfgFile']) + if source_manifest_repo in cfg: + manifest_directory =3D config['cfg_file'].manifest_repo_ab= s_path(source_manifest_repo) + elif source_manifest_repo in user_cfg: + manifest_directory =3D config['user_cfg_file'].manifest_re= po_abs_path(source_manifest_repo) + else: + manifest_directory =3D None + except EdkrepoManifestNotFoundException: + manifest_directory =3D None + if manifest_directory: + pin_folder =3D os.path.normpath(os.path.join(manifest_directory, m= anifest.general_config.pin_path)) + for dirpath, _, filenames in os.walk(pin_folder): + for file in filenames: + pin_file =3D os.path.join(dirpath, file) + # Capture error output from manifest parser stdout so it i= s hidden unless verbose is enabled + stdout =3D sys.stdout + sys.stdout =3D io.StringIO() + pin =3D ManifestXml(pin_file) + parse_output =3D sys.stdout.getvalue() + sys.stdout =3D stdout + if parsed_args.verbose and parse_output.strip() !=3D '': + print('Pin {} Parsing Errors: {}\n'.format(file, parse= _output.strip())) + if pin.project_info.codename =3D=3D manifest.project_info.= codename: + pins.append(file) + print(' '.join(pins)) =20 # To add command completions for a new command, add an entry to this dicti= onary. command_completions =3D { --=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 (#59021): https://edk2.groups.io/g/devel/message/59021 Mute This Topic: https://groups.io/mt/74126916/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- From nobody Sun May 5 09:39:50 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+59022+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+59022+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1589158233; cv=none; d=zohomail.com; s=zohoarc; b=XJ16pYHnRp3/7Aas1fJJSirG5EqbaWrVuxCB2hTA5oN/ciVi2TcyzG+OuJc/a3AFC7H81WSa/KOxSiGKh4MNPUtgjxd0quCf7+zfhAEbVLqsIWYHBJPmv60vXu3tUOf3VShiyXVuphgLoyvW3/HrBIsNkDESAZ8Va38C3kFcsrk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589158233; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=EnOADfvBr66Ccpqn5La9GJezrrFSwkpYNKwgz7CIuzo=; b=Yx35cRqTBUN7j/gx9dbhnGvUn0kaStp4LeJZZThmtCDpQCbjcHdQkIz1b9dMp7zDgiEV0f2EN4QIGpjyHijPXQOePWip9wGlYBF9nmoh8Mmjj0CX2YPaQ/ezn2qDi3oAzcaPSi/8nCc5iN1iCM5xbHyGjazv9dTx3qhwY8442DY= 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+59022+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 1589158233040145.98316442730584; Sun, 10 May 2020 17:50:33 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id gs8AYY1788612xoLcRa3zDYi; Sun, 10 May 2020 17:50:32 -0700 X-Received: from mga17.intel.com (mga17.intel.com []) by mx.groups.io with SMTP id smtpd.web10.4017.1589158230010710343 for ; Sun, 10 May 2020 17:50:30 -0700 IronPort-SDR: PYAZxYBrisr8dN4Ip0/H5J+3M7SFSVMpqlCoevskoPjlF5OyeBNSMhjyKeVvGnod9Ju26gQWs4 lPxwvYUwPG/A== 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:30 -0700 IronPort-SDR: Bke9lTsxNWvwM+kUXi0ASNJCEydzLLAEaPCEY6w10xR/u1zWYd8B+DSxRV4OjsbrxzWif0urZo 427X+i1+TQQQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,377,1583222400"; d="scan'208";a="296747725" 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:29 -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 4/4] EdkRepo: Remove support for deprecated Manifest-Repo content in edkrepo.cfg Date: Sun, 10 May 2020 17:50:26 -0700 Message-Id: <20200511005026.23532-5-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: 8PP14YVtQRh3cWWGxaS4MjQjx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1589158232; bh=KwiErFkqUpqHbRZ/3zR5FlZqS5D5abjVZgb8KHFHbeQ=; h=Cc:Date:From:Reply-To:Subject:To; b=VXlAkXdJXxF8a2OBLwgK0D45mSORhyxI7AtPS5Oy0g2Mthc1XPjm8MZQeS+bxpvuMuN aGlXqV1naDCsdGd7MrZ6yHPN6J3lYuQlARCuv+5MROONMrR0yEna1s/O/8F5tXxh0Y/Tn 0Ea/gbyn4Av5l98PlflnVeywgeHeKNS/itE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Remove the remaining uses of manifest_repo_abs_local_path() and update to use manifest_repo_abs_path where appropriate. Remove the config prop definitions for the Manifest-Repo section of the edkrepo.cfg file. Remove the Manifest-Repo entry from the edkrepo.cfg file. 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/clone_command.py | 3 ++- edkrepo/commands/sync_command.py | 8 +++--- edkrepo/common/common_repo_functions.py | 45 ++++++++++++++++++++---------= ---- edkrepo/config/config_factory.py | 12 ++------- edkrepo_installer/Vendor/edkrepo.cfg | 5 ---- 5 files changed, 36 insertions(+), 37 deletions(-) diff --git a/edkrepo/commands/clone_command.py b/edkrepo/commands/clone_com= mand.py index b7f3158..179aaf7 100644 --- a/edkrepo/commands/clone_command.py +++ b/edkrepo/commands/clone_command.py @@ -66,7 +66,6 @@ class CloneCommand(EdkrepoCommand): =20 def run_command(self, args, config): pull_all_manifest_repos(config['cfg_file'], config['user_cfg_file'= ], False) - update_editor_config(config) =20 name_or_manifest =3D args.ProjectNameOrManifestFile workspace_dir =3D args.Workspace @@ -92,8 +91,10 @@ class CloneCommand(EdkrepoCommand): # If this manifest is in a defined manifest repository validate th= e manifest within the manifest repo if manifest_repo in cfg: verify_single_manifest(config['cfg_file'], manifest_repo, glob= al_manifest_path) + update_editor_config(config, config['cfg_file'].manifest_repo_= abs_path(manifest_repo)) elif manifest_repo in user_cfg: verify_single_manifest(config['user_cfg_file'], manifest_repo,= global_manifest_path) + update_editor_config(config, config['user_cfg_file'].manifest_= repo_abs_path(manifest_repo)) =20 # Copy project manifest to local manifest dir and rename it Manife= st.xml. local_manifest_dir =3D os.path.join(workspace_dir, "repo") diff --git a/edkrepo/commands/sync_command.py b/edkrepo/commands/sync_comma= nd.py index d1db4f1..da99397 100644 --- a/edkrepo/commands/sync_command.py +++ b/edkrepo/commands/sync_command.py @@ -79,8 +79,6 @@ class SyncCommand(EdkrepoCommand): 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 @@ -97,6 +95,8 @@ class SyncCommand(EdkrepoCommand): 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 + update_editor_config(config, global_manifest_directory) + if not args.update_local_manifest: self.__check_for_new_manifest(args, config, initial_manifest, = workspace_path, global_manifest_directory) check_dirty_repos(initial_manifest, workspace_path) @@ -145,7 +145,7 @@ class SyncCommand(EdkrepoCommand): for repo_to_sync in repo_sources_to_sync: local_repo_path =3D os.path.join(workspace_path, repo_to_sync.= root) # Update any hooks - update_hooks(hooks_add, hooks_update, hooks_uninstall, local_r= epo_path, repo_to_sync, config) + update_hooks(hooks_add, hooks_update, hooks_uninstall, local_r= epo_path, repo_to_sync, config, global_manifest_directory) repo =3D Repo(local_repo_path) #Fetch notes repo.remotes.origin.fetch("refs/notes/*:refs/notes/*") @@ -200,7 +200,7 @@ class SyncCommand(EdkrepoCommand): # Perform submodule updates and url redirection maintain_submodules(repo_to_sync, repo) # Update commit message templates - update_repo_commit_template(workspace_path, repo, repo_to_sync= , config) + update_repo_commit_template(workspace_path, repo, repo_to_sync= , config, source_global_manifest_repo) =20 if sync_error: print(SYNC_ERROR) diff --git a/edkrepo/common/common_repo_functions.py b/edkrepo/common/commo= n_repo_functions.py index 5ec834b..61133f1 100644 --- a/edkrepo/common/common_repo_functions.py +++ b/edkrepo/common/common_repo_functions.py @@ -59,8 +59,8 @@ from edkrepo.common.edkrepo_exception import EdkrepoInval= idParametersException from edkrepo_manifest_parser.edk_manifest import CiIndexXml, ManifestXml from edkrepo.common.edkrepo_exception import EdkrepoNotFoundException, Edk= repoGitException, EdkrepoWarningException from edkrepo.common.edkrepo_exception import EdkrepoFoundMultipleException= , EdkrepoHookNotFoundException -from edkrepo.common.edkrepo_exception import EdkrepoGitConfigSetupExceptio= n, EdkrepoManifestInvalidException -from edkrepo.common.workspace_maintenance.manifest_repos_maintenance impor= t pull_single_manifest_repo +from edkrepo.common.edkrepo_exception import EdkrepoGitConfigSetupExceptio= n, EdkrepoManifestInvalidException, EdkrepoManifestNotFoundException +from edkrepo.common.workspace_maintenance.manifest_repos_maintenance impor= t find_source_manifest_repo, list_available_manifest_repos from edkrepo.common.workspace_maintenance.workspace_maintenance import cas= e_insensitive_single_match from edkrepo.common.ui_functions import init_color_console from edkrepo_manifest_parser import edk_manifest @@ -112,11 +112,27 @@ def clone_repos(args, workspace_dir, repos_to_clone, = project_client_side_hooks, if repo_to_clone.enable_submodule: maintain_submodules(repo_to_clone, repo, args.verbose) =20 - # Install git hooks - install_hooks(project_client_side_hooks, local_repo_path, repo_to_= clone, config) + try: + if 'source_manifest_repo' in vars(args).keys(): + src_manifest_repo =3D find_source_manifest_repo(manifest, = config['cfg_file'], config['user_cfg_file'], args.source_manifest_repo) + else: + src_manifest_repo =3D find_source_manifest_repo(manifest, = config['cfg_file'], config['user_cfg_file'], None) + except EdkrepoManifestNotFoundException: + src_manifest_repo =3D None + if src_manifest_repo: + cfg, user_cfg, conflicts =3D list_available_manifest_repos(con= fig['cfg_file'], config['user_cfg_file']) + if src_manifest_repo in cfg: + global_manifest_directory =3D config['cfg_file'].manifest_= repo_abs_path(src_manifest_repo) + elif src_manifest_repo in user_cfg: + global_manifest_directory =3D config['user_cfg_file'].mani= fest_repo_abs_path(src_manifest_repo) + else: + global_manifest_directory =3D None + if global_manifest_directory: + # Install git hooks if there is a manifest repo associated wit= h the manifest being cloned + install_hooks(project_client_side_hooks, local_repo_path, repo= _to_clone, config, global_manifest_directory) =20 - # Add the commit template if it exists. - update_repo_commit_template(workspace_dir, repo, repo_to_clone, co= nfig) + # Add the commit template if it exists. + update_repo_commit_template(workspace_dir, repo, repo_to_clone= , config, global_manifest_directory) =20 # Check to see if mirror is in sync with primary repo if not in_sync_with_primary(repo, repo_to_clone, args.verbose): @@ -194,7 +210,7 @@ def maintain_submodules(repo_sources, repo, verbose =3D= False): except: raise EdkrepoGitException(SUBMODULE_FAILURE.format(repo_sources.re= mote_name)) =20 -def install_hooks(hooks, local_repo_path, repo_for_install, config): +def install_hooks(hooks, local_repo_path, repo_for_install, config, global= _manifest_directory): # Determine the which hooks are for the repo in question and which are= from a URL based source or are in a global # manifest repo relative path hooks_url =3D [] @@ -222,7 +238,6 @@ def install_hooks(hooks, local_repo_path, repo_for_inst= all, config): =20 # Copy any global manifest repository relative path source based hooks for hook in hooks_path: - global_manifest_directory =3D config['cfg_file'].manifest_repo_abs= _local_path man_dir_rel_hook_path =3D os.path.join(global_manifest_directory, = hook.source) if not os.path.exists(man_dir_rel_hook_path): raise EdkrepoHookNotFoundException(HOOK_NOT_FOUND_ERROR.format= (hook.source, repo_for_install.root)) @@ -258,11 +273,11 @@ def uninstall_hooks(hooks, local_repo_path, repo_for_= uninstall): hook_file =3D os.path.join(destination, (os.path.basen= ame(str(hook.source)))) os.remove(hook_file) =20 -def update_hooks (hooks_add, hooks_update, hooks_uninstall, local_repo_pat= h, repo, config): +def update_hooks (hooks_add, hooks_update, hooks_uninstall, local_repo_pat= h, repo, config, global_manifest_directory): if hooks_add: - install_hooks(hooks_add, local_repo_path, repo, config) + install_hooks(hooks_add, local_repo_path, repo, config, global_man= ifest_directory) if hooks_update: - install_hooks(hooks_update, local_repo_path, repo, config) + install_hooks(hooks_update, local_repo_path, repo, config, global_= manifest_directory) if hooks_uninstall: uninstall_hooks(hooks_uninstall, local_repo_path, repo) =20 @@ -562,15 +577,11 @@ def get_latest_sha(repo, branch, remote_or_url=3D'ori= gin'): latest_sha =3D None return latest_sha =20 -def update_repo_commit_template(workspace_dir, repo, repo_info, config): +def update_repo_commit_template(workspace_dir, repo, repo_info, config, gl= obal_manifest_directory): # Open the local manifest and get any templates manifest =3D edk_manifest.ManifestXml(os.path.join(workspace_dir, 'rep= o', 'Manifest.xml')) templates =3D manifest.commit_templates =20 - # Need to know where the global manifest directory is located at this = point - global_manifest_directory =3D os.path.join(get_edkrepo_global_data_dir= ectory(), - config['cfg_file'].manifest_r= epo_local_path) - # Apply the template based on current manifest with repo.config_writer() as cw: if cw.has_option(section=3D'commit', option=3D'template'): @@ -590,7 +601,7 @@ def update_repo_commit_template(workspace_dir, repo, re= po_info, config): if cw.has_option(section=3D'commit', option=3D'template'): cw.remove_option(section=3D'commit', option=3D'template') =20 -def update_editor_config(config): +def update_editor_config(config, global_manifest_directory): return =20 def has_primary_repo_remote(repo, verbose=3DFalse): diff --git a/edkrepo/config/config_factory.py b/edkrepo/config/config_facto= ry.py index 6d56ee6..c0b9f68 100644 --- a/edkrepo/config/config_factory.py +++ b/edkrepo/config/config_factory.py @@ -119,7 +119,7 @@ class BaseConfig(): """Returns a list of available manifest repos""" if self.cfg.has_section('manifest-repos'): return self.cfg.options('manifest-repos') - =20 + def manifest_repo_props(self, manifest_repo): """ Returns a list of cfg_prop objects that pertain to a given manifest @@ -128,7 +128,7 @@ class BaseConfig(): return [x for x in self.prop_list if manifest_repo in x.name] =20 def get_manifest_repo_url(self, manifest_repo): - """=20 + """ Returns the URL value for a given manifest repo based on config file contents. """ @@ -172,9 +172,6 @@ class GlobalConfig(BaseConfig): def __init__(self): self.filename =3D os.path.join(get_edkrepo_global_data_directory()= , "edkrepo.cfg") self.prop_list =3D [ - CfgProp('manifest-repo', 'URL', 'manifest_repo_url', None,= True), - CfgProp('manifest-repo', 'Branch', 'manifest_repo_branch',= None, True), - CfgProp('manifest-repo', 'LocalPath', 'manifest_repo_local= _path', None, True), CfgProp('sparsecheckout', 'always_include', 'sparsecheckou= t_always_include', None, True), CfgProp('sparsecheckout', 'always_exclude', 'sparsecheckou= t_always_exclude', None, True), CfgProp('f2f-cherry-pick', 'ignored_folder_substrings', 'f= 2f_cp_ignored_folder_substrings'), @@ -199,11 +196,6 @@ class GlobalConfig(BaseConfig): pkg_list.append(pkg.strip()) return pkg_list =20 - @property - def manifest_repo_abs_local_path(self): - """Provides an absolute path to the manifest repo based on configu= ration file values.""" - return os.path.join(self.global_data_dir, self.manifest_repo_local= _path) - @property def sparsecheckout_data(self): always_include =3D self.sparsecheckout_always_include.split('|') diff --git a/edkrepo_installer/Vendor/edkrepo.cfg b/edkrepo_installer/Vendo= r/edkrepo.cfg index 38d7b35..738b832 100644 --- a/edkrepo_installer/Vendor/edkrepo.cfg +++ b/edkrepo_installer/Vendor/edkrepo.cfg @@ -6,11 +6,6 @@ URL =3D https://github.com/tianocore/edk2-staging.git Branch =3D EdkRepo-Manifest LocalPath =3D edk2-staging-manifest-master =20 -[manifest-repo] -URL =3D https://github.com/tianocore/edk2-staging.git -Branch =3D EdkRepo-Manifest -LocalPath =3D manifest-master - [git-ver] minimum =3D 2.13.0 recommended =3D 2.16.2 --=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 (#59022): https://edk2.groups.io/g/devel/message/59022 Mute This Topic: https://groups.io/mt/74126917/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-