From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.3810.1589499627982477698 for ; Thu, 14 May 2020 16:40:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=PII6QFtL; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: nathaniel.l.desimone@intel.com) IronPort-SDR: 9c17AXHGdSB/gJNSgIt7JXOmx3cPIYM7tD0XWDasDqsBpyCTO9tOirv5NDWwf/gHgW+uRWqFmu otlKPyoxMriw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2020 16:40:27 -0700 IronPort-SDR: ua4h+oFOwKrAMUaNxVfeLuqslzTUkAoqdZGulq62DdDigE87UjYwIUI774ZYuvl3zTP4h8yjYX 52ejrpj9Ogyw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,392,1583222400"; d="scan'208";a="252219701" Received: from orsmsx105.amr.corp.intel.com ([10.22.225.132]) by fmsmga007.fm.intel.com with ESMTP; 14 May 2020 16:40:24 -0700 Received: from orsmsx121.amr.corp.intel.com (10.22.225.226) by ORSMSX105.amr.corp.intel.com (10.22.225.132) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 14 May 2020 16:40:23 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX121.amr.corp.intel.com (10.22.225.226) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 14 May 2020 16:40:23 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.104) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 14 May 2020 16:40:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F3TMGilZpcZFARFdi3WlWw2bgEujRJOaReYiIggK7sUKosYF9T/2rEqIApKvzjm37ek7AKfAXWXVvXeHKEz5o0VZcZ7GpLqnHp86Uy0Fx4zyDFQeONxnJDMkU7GH3Fvq2vTjPM0tmbUUEiF9IKMXP32IZgeqPP/cQaw/xQX6eIwVI8RAhFKocbfTpAlmHnhi+NKRTOvF8Mh4vyVz5s13ifuSNoYxNlHn2HOsmAZCu/CeOUf0//ptuiiZ/RD7j/mOI+JlUTW7wB9X/WzqMkA9xBzupjgdstzZ1s2iKS9QjZFehliyU5yuXkfrriP1cFsDSMn29YrRVCdoybMWMCuA6Q== 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=CHnKWRleGqhwVRzQCWmMopmd8u6xsNnT8aereLDM8G4=; b=L9GDP3JLJ4pRHTVcZtPcldxERzDagPfVSv1hEYGHw3bqB+PEuSqtne2busd6yEXebSUrmEESjYQs8gXcDXWucgkWnSB1l8QFtG3LLQYOdwwJsR9Af71JHGIdYtm6XBhx9JZzqGN9Dp9SYVjO6Nv+sq/BorlRxwQW/X1g+sZUQELrda9JCW6yMdagMffJXTJMB6/GEWPMwtc+URrLyfX975/1kNmm5Wy15CQqTrJSOjisDslReTf/dVvxbQguUTx/SrjJBqSoE4FkR5mQTZ1ByOWQ/FptZTLfVx0wkjNJgngWFk1l5ZdYT+Mw/5DM8GTFxOsmAr+o1AdvHGcBbpXZWw== 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=CHnKWRleGqhwVRzQCWmMopmd8u6xsNnT8aereLDM8G4=; b=PII6QFtL76dxiH5IoGf7BWBw7Jm9qYUmWgBZ620Q3ESaGANj0FMpXkj9Phqoq/sL4/QO/S4hmSsu5vU0O6u0Bxj7SgFKjbXcLAxJMnOYLliZS9vPUGZzTcFgmykEd7RLcA9vt93IwdOWoHsQIXUj0lWnv0lBhXm2jUCCcqAROO0= Received: from BL0PR11MB3489.namprd11.prod.outlook.com (2603:10b6:208:75::29) by BL0PR11MB3475.namprd11.prod.outlook.com (2603:10b6:208:64::29) 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:40:20 +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:40:20 +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+BbMNcxaioQomQ Date: Thu, 14 May 2020 23:40:20 +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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDkyZWYyMmItZDY3Yi00YzY5LWI1MDQtNGMwNTMxNmY3MzdlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibElzOG4wbnV4WHRuU1doZUczUCs1bUlRNjZHaTVaR3EyNVBUeUU3bDdVbHdcL0NDRTZIMzRuSXl2ZmJKS2FIQnIifQ== 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: 43bb980d-8b31-4dc7-5726-08d7f8602a58 x-ms-traffictypediagnostic: BL0PR11MB3475: 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: 9rLJwtc7tQJRGw/DaXHHYQRhriwiGcS2tx2+3vtN2MxeR+tf4N2tS9TnbIV3lJ3kJVMzfOtXbjH+n4FHKJ0+BcNUWqZlAe3XOiRdwiMB5Xv7lYsQloIqGfHjyJkeZfSFLCKAt/phZtBSm10Qk341am/EwEyXNM3LxPOrNgKWJVAqm/j6VivCg6Z/yzEoXmjr6L01fd7EuFPyDpHC+HRdCxsddxFHV0pHcHJgobrdm7Xs9Awkv8XvHHzd206BMkqoF+oVYo7UrM8yP+7EDhBy4/3nJFKxOP8dkhUlxl84UqgStjd5zPZy15t1GJijnhwEPpD+wYh0htDxKUZDctmIzm4BFjefglaSrzwix3XHjtyQ8DUVrytYVv4jwjGKr9TMfldOsz4RgZkDSq69v7zKoQIvkL0pgIGzZ62twGyPbJdPq91VoCyWUOircaWoRFZ3 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)(376002)(136003)(366004)(39860400002)(346002)(33656002)(6506007)(26005)(66446008)(66476007)(186003)(66556008)(52536014)(110136005)(54906003)(71200400001)(53546011)(316002)(8676002)(7696005)(4326008)(55016002)(64756008)(86362001)(5660300002)(8936002)(66946007)(107886003)(2906002)(478600001)(9686003)(76116006);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: oNQkWqs3qmgm3qYGLR1dV8jTsUKjM91vjvnqI4eXMBgw4tsiZIxJvDwAyRY9m74EvsZI4aMs6NbsEbM8cRd5xIAUWeaFcRHt76MgPC2JizCB6Lci0dqCWeB9tU/x0uyn7497ZQM/wBXs7JRUaBorXKFzbfus80vIuSXcFT96q//smdI/u+cC5et4FP3Uskv3b+SB0l8z1m8pQdlgrII4b6fQpwSo4aylIyPogzxjohzLJquWA+mSYaODWx9VUUGInRT1ui8ZjI+5uVs+8VEv3wPdgb38ZrOMwZO9lL2EAMxBqL9vNPCS1dTF11sUI1PP4s+kdcat7jzNZp1qNbPAnYePTsjwJSGXDcSUXXE7Ik99Edw0pZa6pu5mr/O8t0fwPnks9Qoo0NBobATNmyHP1UFklWLo9rMNlVv9pz7D+vzLDhyMtvur+HQXxvawUxg/W/FE0zR4Tu5Q8Aep47FBcmI5WLb0Ebaud7cye4yitdC8pYhst2cKZeE7fS8htZEe MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 43bb980d-8b31-4dc7-5726-08d7f8602a58 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 May 2020 23:40:20.4877 (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: kgafcTQq34KsaWjqCxnEHZTE++l7hxysgjeAZROwwcD6g6MSbx3mNi9iiwsupEuewxn+/2ZwwANfAMn+HaVc4eZ2+wifBns0JLMO5y1Czv4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR11MB3475 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 Pushed: 589dbc0a > -----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