From nobody Mon Feb 9 19:05:11 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+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 --- 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-