From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web12.3619.1589498831325403489 for ; Thu, 14 May 2020 16:27:11 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Jl8L+h14; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: nathaniel.l.desimone@intel.com) IronPort-SDR: VkgdI1Gpkhu9sPD7++pnyuseKGLGcmeYoDQUlRbtlKJ+0m20KLkRhcqdLVhepgvUZaRgo5fNlk j+d6CLPfnwLw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2020 16:27:10 -0700 IronPort-SDR: cHWsMdjB11FFTZ9Ty+2HkoQ6YO+lyYa6IGRLYgisehDPjJKyvwP27DU8fhjelr9rVd7WBaWXdk QTjSM+YvjaZQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,392,1583222400"; d="scan'208";a="253629384" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by fmsmga008.fm.intel.com with ESMTP; 14 May 2020 16:27:10 -0700 Received: from orsmsx111.amr.corp.intel.com (10.22.240.12) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 14 May 2020 16:27:09 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX111.amr.corp.intel.com (10.22.240.12) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 14 May 2020 16:27:09 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 14 May 2020 16:27:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n3LUC7viIUkHER3V2MyhhwAbke/hveYfcQ+DRNrq37OkNjbb0Zdx10ljVMuxiZqn8W1ObFY6GEpB3Tt0h20pLPv5lfTgo7cFvAgKVwy834lIxizeeyr4tSiD1SCulSbZxG3QqYXUTyAsdsGSigDBiPfzU8p2prG5qSVFrjyx7sK9mv2jqAcY0TaFqjjof2e9MUot/F0HwFNvc69xYq+V0LqyTpl3sgHBqPlJPmyTX3N/gfkVpkTF6YoxoDS2cfrX4l11hYGLQjccFLZyu3XT3bmCF0Iqk+nHXuLTZJ1kuDvnB4r42jRLj0q/JAFt8fLc8BKS/Yz55Sr1/eFC0GnhCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0U7MjKmeZ/arPOcZBXFUlFnU4CgpWpQGjxBzB21Miq4=; b=Pl4lMBdE0xLYeRg//aYdKwp9K4MdpsU1Y5Xeukt7E9D1MqDCmfjm3yMVLIDhAX0IOlKdoiODd5bHhgBPAXXIf/BWxjC/OMgeYJ57l8Hmt4ZlyrdjdvRdLMiuTeOQzo5QlUBHjd+ObumQXkMHnUgT2/JrvDc0oqp77pSLTFttRKlxovaK1d3VyTPgamQ50qLpE/WO9sE3+Uz3sP+Qm+Lx2nXMPCQLSJIbkCtkuKle5ZLqNnIPlR3OamnoG8E8pHT3jS0SQl40L/TrgGUlvib59kP+gs3LQjhSJ/imlJPHaY/nAgG/BlAmkHCOvClbDj/d33/QDEadmrQKh4kTMHGmcw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0U7MjKmeZ/arPOcZBXFUlFnU4CgpWpQGjxBzB21Miq4=; b=Jl8L+h149PzPPfYUfXGE2KsffFpXM08yz3S+E1vRc09lb7thIce0/OFVi1PBMZZhCbF85xiI3V5svZMhvU2rtTnl52WFbv46vF4e33mhjcvsrLbGwkWyaJRnspB/AbVnanFGMU2s9W7LYViYDhGRB28VM+aV/TOs4meZ1NFZ54Q= Received: from BL0PR11MB3489.namprd11.prod.outlook.com (2603:10b6:208:75::29) by BL0PR11MB3121.namprd11.prod.outlook.com (2603:10b6:208:7e::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20; Thu, 14 May 2020 23:27:08 +0000 Received: from BL0PR11MB3489.namprd11.prod.outlook.com ([fe80::d0f8:bfd7:bae2:3e42]) by BL0PR11MB3489.namprd11.prod.outlook.com ([fe80::d0f8:bfd7:bae2:3e42%7]) with mapi id 15.20.2979.033; Thu, 14 May 2020 23:27:07 +0000 From: "Nate DeSimone" To: "Desimone, Ashley E" , "devel@edk2.groups.io" CC: "Pandya, Puja" , "Bjorge, Erik C" , Bret Barkelew , "Agyeman, Prince" Subject: Re: [edk2-staging/EdkRepo] [PATCH V2] EdkRepo: Add the manifest-repos command Thread-Topic: [edk2-staging/EdkRepo] [PATCH V2] EdkRepo: Add the manifest-repos command Thread-Index: AQHWJ7g+D5Z99kJp2E2exQ+BbMNcxaioPtlQ Date: Thu, 14 May 2020 23:27:07 +0000 Message-ID: References: <20200511171820.16088-1-ashley.e.desimone@intel.com> In-Reply-To: <20200511171820.16088-1-ashley.e.desimone@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGExMWQ0NjUtYWQ4My00ZDk4LWE5OWEtMmY5ZWQzMmU4MGUzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidlBUYjk3dzBYckpKTlVhSUY1VjgramU2YzRPTEJKYmtVNFUwQlU3Mkp1TW1aK3BUS1wvWHFOWDZzM3hKRHFrZFwvIn0= dlp-reaction: no-action dlp-version: 11.2.0.6 dlp-product: dlpe-windows x-ctpclassification: CTP_NT authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [50.53.190.176] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 787f1a14-00ab-40d5-5a82-08d7f85e51d8 x-ms-traffictypediagnostic: BL0PR11MB3121: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-forefront-prvs: 040359335D x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VvkFIv16C2XTjuV+N9gqyXPUbIJBBFwCOeo6K4ZSqaGpKi9U+GJ1tT/gfLJkzuQOeoQsbtubMOtUfjtuz8wzHXtuF28QtZElRHUNJDKd2UNekAZ8ZB7fDMq/GQZX6mp2G+88XHD9BtpzCEEdL/qMl9Zjz/j0s1RI1fOORyKfsmLILGzRs9zrtNCLrzLIRJKNjs/OeysYx3lB+zNQymvqZRqImHX87Vp54U3r/lpR/Nr8Bk5cEZpPJt6um6nj0FsFIRmQRICRuRHi+cnucWITA3RiQ+KlCaBaQBcsoDn8vIMbn617b25H9wtcsrLS/RBQQBDsYWNCKWldwKDMTsMMONSPS/ZrkAVzlEhPTybf1lssLmUOtAy4AhK79sWdvdJSwVb3+ceolURBIhWzgWcZpAf5E/BidQYRN9U2pSRbIobdKUdevNd1H4UiFgJLjDN3 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR11MB3489.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(396003)(136003)(366004)(376002)(39860400002)(346002)(2906002)(26005)(54906003)(55016002)(52536014)(478600001)(64756008)(4326008)(5660300002)(316002)(33656002)(76116006)(66446008)(107886003)(8676002)(9686003)(66556008)(66476007)(66946007)(186003)(8936002)(110136005)(7696005)(6506007)(71200400001)(86362001)(53546011);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: 5tVc3SxD4d12/4uyyg+khTMzWNFIFJooW5ifz1+hl8dK6tr7R7lx+t0R1yKqVrN6+SlyKXE+Nn43Ap71bFVSwhJ1AIVsDgHltdu4+gvEUlIRVem/2tVMHj8/Hk4DxRySplUWWy4iFxVfCvzAvYVhrZ2bll2+x1ePQFmPuibnPXCpm0RkkwFxjpFsSktv5z1CITbe+j9MDzhKlXEnj5xA9mDItj2nMezXNaANQ0NEPRwhEcUFZlPX2epI6Los+aCWfgLfA0RQ6x30fMI3cCxHszhJrrqhq52VaY254upidK5kJyZfPgYSgC5QQFJG1leQLtdL0b0PvLTy9VGHBB9eVNjgI69rG+9+uRZC5zZdtRuvdjKRJPrb/tRAB3Nv78OWSAP2MSBJZyFYSMbnXbipsyo+XhjOxV5nLQHQH5zuL2urhF0spJAwP9cRcA3iibTIwy99XZsNZg+IHtjeM8mu/jxTmU1SXDJR+JFRiOGsARc6jrZVxMjzpIWYOSjjtROK MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 787f1a14-00ab-40d5-5a82-08d7f85e51d8 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 May 2020 23:27:07.7903 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Bz2joSvxp193WQeeoo8MlQREdV2ABiUllZyHJ8ymkYZjA2Gy74etqmgJIQM6bRjs2xh3AwKG0uyjiR7yiKJe3ss92xS9EjlNQRe69O6ljYc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR11MB3121 Return-Path: nathaniel.l.desimone@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Nate DeSimone > -----Original Message----- > From: Desimone, Ashley E > Sent: Monday, May 11, 2020 10:18 AM > To: devel@edk2.groups.io > Cc: Desimone, Nathaniel L ; Pandya, Puja > ; Bjorge, Erik C ; Bret > Barkelew ; Agyeman, Prince > > Subject: [edk2-staging/EdkRepo] [PATCH V2] EdkRepo: Add the manifest- > repos command >=20 > Add the manifest_repos_command to list, add, or remove manifest > repositories in the ekdrepo_user.cfg >=20 > Signed-off-by: Ashley E Desimone > Cc: Nate DeSimone > Cc: Puja Pandya > Cc: Erik Bjorge > Cc: Bret Barkelew > Cc: Prince Agyeman > --- > edkrepo/commands/arguments/manifest_repo_args.py | 22 +++++ > edkrepo/commands/humble/manifest_repos_humble.py | 20 +++++ > edkrepo/commands/manifest_repos_command.py | 107 > +++++++++++++++++++++++ > 3 files changed, 149 insertions(+) > create mode 100644 > edkrepo/commands/arguments/manifest_repo_args.py > create mode 100644 > edkrepo/commands/humble/manifest_repos_humble.py > create mode 100644 edkrepo/commands/manifest_repos_command.py >=20 > diff --git a/edkrepo/commands/arguments/manifest_repo_args.py > b/edkrepo/commands/arguments/manifest_repo_args.py > new file mode 100644 > index 0000000..5792a4d > --- /dev/null > +++ b/edkrepo/commands/arguments/manifest_repo_args.py > @@ -0,0 +1,22 @@ > +#!/usr/bin/env python3 > +# > +## @file > +# manifest_repo_args.py > +# > +# Copyright (c) 2020, Intel Corporation. All rights reserved.
# > +SPDX-License-Identifier: BSD-2-Clause-Patent # > + > +''' Contains the help and description strings for arguments in the > +manifest_repo command meta data. > +''' > + > +COMMAND_DESCRIPTION =3D 'Lists, adds or removes a manifest repository.' > +LIST_HELP =3D 'List all available manifest repositories.' > +ADD_HELP =3D 'Add a manifest repository.' > +REMOVE_HELP =3D 'Remove a manifest repository.' > +NAME_HELP =3D 'The name of a manifest repository to add/remove. > Required with Add or Remove flags.' > +URL_HELP =3D 'The URL of a manifest repository to add. Required with Add > flag.' > +LOCAL_PATH_HELP =3D 'The local path that a manifest is stored at in the > edkrepo global data directory. Required with Add flag.' > +BRANCH_HELP =3D 'The branch of a manifest repository to use. Required wi= th > Add flag.' > +ACTION_HELP =3D 'Which action "list", "add", "remove" to take' > diff --git a/edkrepo/commands/humble/manifest_repos_humble.py > b/edkrepo/commands/humble/manifest_repos_humble.py > new file mode 100644 > index 0000000..7dc8bfe > --- /dev/null > +++ b/edkrepo/commands/humble/manifest_repos_humble.py > @@ -0,0 +1,20 @@ > +#!/usr/bin/env python3 > +# > +## @file > +# manifest_repos_humble.py > +# > +# Copyright (c) 2020, Intel Corporation. All rights reserved.
# > +SPDX-License-Identifier: BSD-2-Clause-Patent # > + > +''' > +Contains user visible strings printed by the manifest_repos command. > +''' > + > +CFG_LIST_ENTRY =3D 'Config File: edkrepo.cfg Manifest Repository Name: {= }' > +USER_CFG_LIST_ENTRY =3D 'Config File: edkrepo_user.cfg Manifest > Repository Name: {}' > +NAME_REQUIRED =3D 'The "name" argument is required to add/remove a > manifest repository' > +ADD_REQUIRED =3D 'The "name", "url", "branch" and "local-path" arguments > are required to add a manifest repository' > +CANNOT_REMOVE_CFG =3D 'Manifest repositories cannot be removed from > the edkrepo.cfg file.' > +REMOVE_NOT_EXIST =3D 'The selected manifest repository does note exist i= n > the edkrepo_user.cfg file.' > +ALREADY_EXISTS =3D 'A manifest repository already exists with name: {}' > diff --git a/edkrepo/commands/manifest_repos_command.py > b/edkrepo/commands/manifest_repos_command.py > new file mode 100644 > index 0000000..b817662 > --- /dev/null > +++ b/edkrepo/commands/manifest_repos_command.py > @@ -0,0 +1,107 @@ > +#!/usr/bin/env python3 > +# > +## @file > +# manifest_repos_command.py > +# > +# Copyright (c) 2020, Intel Corporation. All rights reserved.
# > +SPDX-License-Identifier: BSD-2-Clause-Patent # > + > +import configparser > + > +from edkrepo.commands.edkrepo_command import EdkrepoCommand > import > +edkrepo.commands.arguments.manifest_repo_args as arguments import > +edkrepo.commands.humble.manifest_repos_humble as humble from > +edkrepo.common.edkrepo_exception import > +EdkrepoInvalidParametersException from > +edkrepo.common.workspace_maintenance.manifest_repos_maintenance > import > +list_available_manifest_repos > + > + > + > + > +class ManifestRepos(EdkrepoCommand): > + def __init__(self): > + super().__init__() > + > + def get_metadata(self): > + metadata =3D {} > + metadata['name'] =3D 'manifest-repos' > + metadata['help-text'] =3D arguments.COMMAND_DESCRIPTION > + args =3D [] > + metadata['arguments'] =3D args > + args.append({'choice': 'list', > + 'parent': 'action', > + 'help-text': arguments.LIST_HELP}) > + args.append({'choice': 'add', > + 'parent': 'action', > + 'help-text': arguments.ADD_HELP}) > + args.append({'choice': 'remove', > + 'parent': 'action', > + 'help-text': arguments.REMOVE_HELP}) > + args.append({'name': 'action', > + 'positional': True, > + 'position': 0, > + 'required': True, > + 'choices': True, > + 'help-text': arguments.ACTION_HELP}) > + args.append({'name': 'name', > + 'positional': True, > + 'required': False, > + 'position': 1, > + 'nargs' : 1, > + 'help-text': arguments.NAME_HELP}) > + args.append({'name': 'branch', > + 'positional': True, > + 'required': False, > + 'position': 3, > + 'nargs' : 1, > + 'help-text': arguments.BRANCH_HELP}) > + args.append({'name': 'url', > + 'positional': True, > + 'required': False, > + 'position': 2, > + 'nargs' : 1, > + 'help-text': arguments.URL_HELP}) > + args.append({'name': 'path', > + 'positional': True, > + 'required': False, > + 'position': 4, > + 'nargs' : 1, > + 'help-text': arguments.LOCAL_PATH_HELP}) > + return metadata > + > + def run_command(self, args, config): > + cfg_repos, user_cfg_repos, conflicts =3D > + list_available_manifest_repos(config['cfg_file'], > + config['user_cfg_file']) > + > + if args.action =3D=3D 'list': > + for repo in cfg_repos: > + print(humble.CFG_LIST_ENTRY.format(repo)) > + for repo in user_cfg_repos: > + print(humble.USER_CFG_LIST_ENTRY.format(repo)) > + > + elif (args.action =3D=3D ('add' or 'remove')) and not args.name: > + raise EdkrepoInvalidParametersException(humble.NAME_REQUIRED= ) > + elif args.action =3D=3D 'add' and not (args.branch or args.url o= r > args.local_path): > + raise EdkrepoInvalidParametersException(humble.ADD_REQUIRED) > + elif args.action =3D=3D 'remove' and args.name and args.name in = cfg_repos: > + raise > EdkrepoInvalidParametersException(humble.CANNOT_REMOVE_CFG) > + elif args.action =3D=3D'remove' and args.name not in > config['user_cfg_file'].manifest_repo_list: > + raise > EdkrepoInvalidParametersException(humble.REMOVE_NOT_EXIST) > + elif args.action =3D=3D 'add' and (args.name in cfg_repos or arg= s.name in > user_cfg_repos): > + raise > + > EdkrepoInvalidParametersException(humble.ALREADY_EXISTS.format(args.n > a > + me)) > + > + user_cfg_file_path =3D config['user_cfg_file'].cfg_filename > + > + if args.action =3D=3D 'add' or 'remove': > + user_cfg_file =3D configparser.ConfigParser(allow_no_value= =3DTrue) > + user_cfg_file.read(user_cfg_file_path) > + if args.action =3D=3D 'add': > + user_cfg_file.set('manifest-repos', args.name, None) > + user_cfg_file.add_section(args.name) > + user_cfg_file.set(args.name, 'URL', args.url) > + user_cfg_file.set(args.name, 'Branch', args.branch) > + user_cfg_file.set(args.name, 'LocalPath', args.path) > + if args.action =3D=3D 'remove': > + user_cfg_file.remove_option('manifest-repos', args.name) > + user_cfg_file.remove_section(args.name) > + with open(user_cfg_file_path, 'w') as cfg_stream: > + user_cfg_file.write(cfg_stream) > -- > 2.16.2.windows.1