From nobody Tue May 7 19:00:53 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+58820+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+58820+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1588896116; cv=none; d=zohomail.com; s=zohoarc; b=FUduF2d41PDEQxy3N4DW1RIdNeSlTClIcUHnbpFiiv8FoPiXEtXoxLU10lUCbnUsiigVpwjp6flOxdUOObU/gf1yE9njPgmQEjNfhO0tAOqafbLGT3al3YuHYK+S0A0OJwH8EsQnIHhB5DixHHJtQHwNAvuNjm2KslWzSLb6c6I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588896116; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=djXs2TiXCOJm0hq4n33SsF0r+GHJl+0VEPxMFj8Fs5o=; b=m/NkJeCBOzCUITL9EHWIi1WX8720rvilwK8rrlgmJfoIw316qA6dxsRuMvJ8SqTYgztrl3xNEp268zmkEXXcaOA4qUFywjFl3eIKVP8AB/4QdVq3+/U/RA+zK5CAQNjHRvyM87EeCZrp9d1Kgdf4oFM7cahxCrgMpB4OtLUT2Eo= 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+58820+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 1588896116314268.18096968350153; Thu, 7 May 2020 17:01:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id jcPWYY1788612xAjUc2IrQb8; Thu, 07 May 2020 17:01:55 -0700 X-Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.1673.1588896114748016730 for ; Thu, 07 May 2020 17:01:55 -0700 IronPort-SDR: gpqecfkXHlnwLkH5Fc5WHuYJiLH0flcyF33Z2DCdssu/SW+EUjMTBqGkVMNrc7CnegV+dkPY7p rYA6Z8kdUSIw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2020 17:01:54 -0700 IronPort-SDR: 6ZcfxpWQjB7CJkBgGL5NWOC2SclwopMvUuyLPGIMrzJ9+xf7P8Z/n19tgkKPA649RPDLBOvcXO 9cI9XznQ8M3w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,365,1583222400"; d="scan'208";a="462332572" X-Received: from aedesimo-desk.amr.corp.intel.com ([10.254.30.36]) by fmsmga006.fm.intel.com with ESMTP; 07 May 2020 17:01:53 -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 Create-Pin to support multiple manifest repositories Date: Thu, 7 May 2020 17:01:37 -0700 Message-Id: <20200508000137.8496-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: 3DxSHcuJ8pLf7T647W5i44gzx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1588896115; bh=eB2AO/weFKF0qFVC8XqY7AHanXE/KetciMX17xeEPEc=; h=Cc:Date:From:Reply-To:Subject:To; b=PV1C07wLHifRmea/d9nabwTZUh7ELONdMnhCHOz7oj6RI0JMmN9XDFnXu/LlpQk3qoA neXfmoQTUHzvX1hL6Axg7QsCawzo9I8SXdiCiddDxYz7FiyKAi+NHpZ9XZXcFP72ZKLpn FlYkoFBgN7dPNrWVD6uLF4RFtOcn5YCbUKQ= 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 create pin command to select and interact with only the workspaces source manifest repository. Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman --- edkrepo/commands/create_pin_command.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/edkrepo/commands/create_pin_command.py b/edkrepo/commands/crea= te_pin_command.py index f8618e5..7ea501b 100644 --- a/edkrepo/commands/create_pin_command.py +++ b/edkrepo/commands/create_pin_command.py @@ -12,14 +12,16 @@ from collections import namedtuple =20 from git import Repo =20 -from edkrepo.commands.edkrepo_command import EdkrepoCommand +from edkrepo.commands.edkrepo_command import EdkrepoCommand, SourceManifes= tRepoArgument import edkrepo.commands.arguments.create_pin_args as arguments -from edkrepo.common.common_repo_functions import pull_latest_manifest_repo from edkrepo.common.edkrepo_exception import EdkrepoManifestInvalidExcepti= on, EdkrepoInvalidParametersException from edkrepo.common.edkrepo_exception import EdkrepoWorkspaceCorruptExcept= ion from edkrepo.common.humble import WRITING_PIN_FILE, GENERATING_PIN_DATA, G= ENERATING_REPO_DATA, BRANCH, COMMIT from edkrepo.common.humble import COMMIT_MESSAGE, PIN_PATH_NOT_PRESENT, PI= N_FILE_ALREADY_EXISTS, PATH_AND_FILEPATH_USED from edkrepo.common.humble import MISSING_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.workspace_maintenance.manifest_repos_maintenance impor= t pull_workspace_manifest_repo from edkrepo.config.config_factory import get_workspace_manifest, get_work= space_path from edkrepo_manifest_parser.edk_manifest import ManifestXml =20 @@ -49,6 +51,7 @@ class CreatePinCommand(EdkrepoCommand): 'positional': False, 'required': False, 'help-text': arguments.PUSH_HELP}) + args.append(SourceManifestRepoArgument) return metadata =20 def run_command(self, args, config): @@ -56,14 +59,20 @@ class CreatePinCommand(EdkrepoCommand): if args.push and os.path.dirname(args.PinFileName): raise EdkrepoInvalidParametersException(PATH_AND_FILEPATH_USED) =20 - pull_latest_manifest_repo(args, config) workspace_path =3D get_workspace_path() manifest =3D get_workspace_manifest() =20 + src_manifest_repo =3D find_source_manifest_repo(manifest, config['= cfg_file'], config['user_cfg_file'], args.source_manifest_repo) + pull_workspace_manifest_repo(manifest, config['cfg_file'], config[= 'user_cfg_file'], args.source_manifest_repo, False) + cfg, user_cfg, conflicts =3D list_available_manifest_repos(config[= 'cfg_file'], config['user_cfg_file']) + if src_manifest_repo in cfg: + manifest_repo_path =3D config['cfg_file'].manifest_repo_abs_pa= th(src_manifest_repo) + elif src_manifest_repo in user_cfg: + manifest_repo_path =3D config['user_cfg_file'].manifest_repo_a= bs_path(src_manifest_repo) # If the push flag is enabled use general_config.pin_path to deter= mine global manifest relative location to save # pin file to. if args.push and manifest.general_config.pin_path is not None: - pin_dir =3D os.path.join(config['cfg_file'].manifest_repo_abs_= local_path, os.path.normpath(manifest.general_config.pin_path)) + pin_dir =3D os.path.join(manifest_repo_path, os.path.normpath(= manifest.general_config.pin_path)) pin_file_name =3D os.path.join(pin_dir, args.PinFileName) elif args.push and manifest.general_config.pin_path is None: raise EdkrepoManifestInvalidException(PIN_PATH_NOT_PRESENT) @@ -104,7 +113,7 @@ class CreatePinCommand(EdkrepoCommand): =20 # commit and push the pin file if args.push: - manifest_repo =3D Repo(config['cfg_file'].manifest_repo_abs_lo= cal_path) + manifest_repo =3D Repo(manifest_repo_path) # Create a local branch with the same name as the pin file arg= and check it out before attempting the push # to master master_branch =3D manifest_repo.active_branch @@ -124,4 +133,4 @@ class CreatePinCommand(EdkrepoCommand): manifest_repo.git.push('origin', 'HEAD:master') finally: manifest_repo.heads[master_branch.name].checkout() - manifest_repo.delete_head(local_branch, '-D') \ No newline at end of file + manifest_repo.delete_head(local_branch, '-D') --=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 (#58820): https://edk2.groups.io/g/devel/message/58820 Mute This Topic: https://groups.io/mt/74063227/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-