From nobody Sat Apr 27 05:03:03 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+59618+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+59618+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1589502603; cv=none; d=zohomail.com; s=zohoarc; b=L6KOKOBNFtlulyFSjn8rrLqzKzsSUXjTzKRyRqYsrdx+OrTaP0JkZpc8LbssPQ17B5FYXtLYEkaZyLC5TOjiCcnLFU7k03dY/+eFg2gXTKdC1TIqgcfuYjATeltSudM1ebX52jTbWl9h0mq97hamr87qSVnWdAAItHK2miyeH1w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589502603; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=oRgCQocllW3/LuoQaGmf2PL9la9oVJaHkJg1hjy35lg=; b=jDo8pCp19x8KXRBdq8+fvQO03WCDV2eNb+b+jCscE4jc49oCZ7V9HR5b/qbeUwBOru8R64SJLQmyQcxycI3rn6EiimwpCwyr1Hx62krAkfH7PdIY417SYrZy+XjHwF6RSR3Q++Atb9a1xQjladY0gHq/vTzygyk7g12xd8tDm5s= 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+59618+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 1589502603547751.9759874650844; Thu, 14 May 2020 17:30:03 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id atrgYY1788612x14ehQgmlMN; Thu, 14 May 2020 17:30:03 -0700 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web10.4738.1589502602305913889 for ; Thu, 14 May 2020 17:30:02 -0700 IronPort-SDR: 4DgQH35puIGRST6jSmDQz0hkyE3GIaYY9GnusOGteWNCzvdbG05LS/gem3SeljOyAkb1TKwe38 hdHudpayITaA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2020 17:30:01 -0700 IronPort-SDR: st0WQDqkX6nqB/CxlFzTz07aowPujqOMdDjQK7jLSezVKcBEDHO/SGenscAm373X+E6qm31ml/ Wu0vkDNnbeag== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,392,1583222400"; d="scan'208";a="438115436" X-Received: from aedesimo-desk.amr.corp.intel.com ([10.212.39.189]) by orsmga005.jf.intel.com with ESMTP; 14 May 2020 17:30:01 -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: Only process the checkout command if a valid combo is used Date: Thu, 14 May 2020 17:29:58 -0700 Message-Id: <20200515002958.12432-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: RXnjzVwfxlBfBBop44NBm5nRx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1589502603; bh=4iUpBs6wY3RaYpj0gNZAZmsRP9K5CMhE5ey43OS3uIQ=; h=Cc:Date:From:Reply-To:Subject:To; b=RvbTokCovX8IUS7B5PxSdAfx1SlRafSUXPSj+sh/mVFj1AKTdxXt1D4XmK6OIGOWUrl lEjelke9g2tJybG+cGvgdGwnYUwdLyl0QWegy5DNPZztLDm6Ubqf/e+x/Rk/jwtzAg6Kg YnKeWOY3m/wPsC+vRCRybYjdRwzjOQVU9Ec= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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/checkout_command.py | 20 +++++++++++++------- edkrepo/commands/humble/checkout_humble.py | 10 ++++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 edkrepo/commands/humble/checkout_humble.py diff --git a/edkrepo/commands/checkout_command.py b/edkrepo/commands/checko= ut_command.py index 7d65eb8..abea6a5 100644 --- a/edkrepo/commands/checkout_command.py +++ b/edkrepo/commands/checkout_command.py @@ -3,7 +3,7 @@ ## @file # checkout_command.py # -# Copyright (c) 2017- 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2017- 2020, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # # Standard modules @@ -14,8 +14,11 @@ import os =20 # Our modules from edkrepo.commands.edkrepo_command import EdkrepoCommand, OverrideArgum= ent -import edkrepo.commands.arguments.checkout_args as arguments -from edkrepo.common.common_repo_functions import checkout +import edkrepo.commands.arguments.checkout_args as arguments +import edkrepo.commands.humble.checkout_humble as humble +from edkrepo.common.common_repo_functions import checkout, combination_is_= in_manifest +from edkrepo.common.edkrepo_exception import EdkrepoInvalidParametersExcep= tion +from edkrepo.config.config_factory import get_workspace_manifest =20 =20 class CheckoutCommand(EdkrepoCommand): @@ -25,17 +28,20 @@ class CheckoutCommand(EdkrepoCommand): def get_metadata(self): metadata =3D {} metadata['name'] =3D 'checkout' - metadata['help-text'] =3D arguments.COMMAND_DESCRIPTION + metadata['help-text'] =3D arguments.COMMAND_DESCRIPTION args =3D [] metadata['arguments'] =3D args args.append({'name' : 'Combination', 'positional' : True, 'position' : 0, 'required': True, - 'description' : arguments.COMBINATION_DESCRIPTION, - 'help-text' : arguments.COMBINATION_HELP}) + 'description' : arguments.COMBINATION_DESCRIPTION, + 'help-text' : arguments.COMBINATION_HELP}) args.append(OverrideArgument) return metadata =20 def run_command(self, args, config): - checkout(args.Combination, args.verbose, args.override) + if combination_is_in_manifest(args.Combination, get_workspace_mani= fest()): + checkout(args.Combination, args.verbose, args.override) + else: + raise EdkrepoInvalidParametersException(humble.NO_COMBO) diff --git a/edkrepo/commands/humble/checkout_humble.py b/edkrepo/commands/= humble/checkout_humble.py new file mode 100644 index 0000000..a1ff1a3 --- /dev/null +++ b/edkrepo/commands/humble/checkout_humble.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 +# +## @file +# checkout_humble.py +# +# Copyright (c) 2020, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +NO_COMBO =3D 'A combination named: {} does not exist in the workspace mani= fest' --=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 (#59618): https://edk2.groups.io/g/devel/message/59618 Mute This Topic: https://groups.io/mt/74218371/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-