* [edk2-staging/EdkRepo] [PATCH V2] EdkRepo: Only process the checkout command if a valid combo is used
@ 2020-05-15 0:29 Ashley E Desimone
2020-05-18 1:20 ` Nate DeSimone
2020-05-18 1:22 ` Nate DeSimone
0 siblings, 2 replies; 3+ messages in thread
From: Ashley E Desimone @ 2020-05-15 0:29 UTC (permalink / raw)
To: devel
Cc: Nate DeSimone, Puja Pandya, Erik Bjorge, Bret Barkelew,
Prince Agyeman
Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
---
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/checkout_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.<BR>
+# Copyright (c) 2017- 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
# Standard modules
@@ -14,8 +14,11 @@ import os
# Our modules
from edkrepo.commands.edkrepo_command import EdkrepoCommand, OverrideArgument
-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 EdkrepoInvalidParametersException
+from edkrepo.config.config_factory import get_workspace_manifest
class CheckoutCommand(EdkrepoCommand):
@@ -25,17 +28,20 @@ class CheckoutCommand(EdkrepoCommand):
def get_metadata(self):
metadata = {}
metadata['name'] = 'checkout'
- metadata['help-text'] = arguments.COMMAND_DESCRIPTION
+ metadata['help-text'] = arguments.COMMAND_DESCRIPTION
args = []
metadata['arguments'] = 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
def run_command(self, args, config):
- checkout(args.Combination, args.verbose, args.override)
+ if combination_is_in_manifest(args.Combination, get_workspace_manifest()):
+ 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.<BR>
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+NO_COMBO = 'A combination named: {} does not exist in the workspace manifest'
--
2.16.2.windows.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [edk2-staging/EdkRepo] [PATCH V2] EdkRepo: Only process the checkout command if a valid combo is used
2020-05-15 0:29 [edk2-staging/EdkRepo] [PATCH V2] EdkRepo: Only process the checkout command if a valid combo is used Ashley E Desimone
@ 2020-05-18 1:20 ` Nate DeSimone
2020-05-18 1:22 ` Nate DeSimone
1 sibling, 0 replies; 3+ messages in thread
From: Nate DeSimone @ 2020-05-18 1:20 UTC (permalink / raw)
To: Desimone, Ashley E, devel@edk2.groups.io
Cc: Pandya, Puja, Bjorge, Erik C, Bret Barkelew, Agyeman, Prince
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
> -----Original Message-----
> From: Desimone, Ashley E <ashley.e.desimone@intel.com>
> Sent: Thursday, May 14, 2020 5:30 PM
> To: devel@edk2.groups.io
> Cc: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Pandya, Puja
> <puja.pandya@intel.com>; Bjorge, Erik C <erik.c.bjorge@intel.com>; Bret
> Barkelew <Bret.Barkelew@microsoft.com>; Agyeman, Prince
> <prince.agyeman@intel.com>
> Subject: [edk2-staging/EdkRepo] [PATCH V2] EdkRepo: Only process the
> checkout command if a valid combo is used
>
> Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Puja Pandya <puja.pandya@intel.com>
> Cc: Erik Bjorge <erik.c.bjorge@intel.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Prince Agyeman <prince.agyeman@intel.com>
> ---
> 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/checkout_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.<BR>
> +# Copyright (c) 2017- 2020, Intel Corporation. All rights reserved.<BR>
> # SPDX-License-Identifier: BSD-2-Clause-Patent # # Standard modules @@
> -14,8 +14,11 @@ import os
>
> # Our modules
> from edkrepo.commands.edkrepo_command import EdkrepoCommand,
> OverrideArgument -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
> +EdkrepoInvalidParametersException from edkrepo.config.config_factory
> +import get_workspace_manifest
>
>
> class CheckoutCommand(EdkrepoCommand):
> @@ -25,17 +28,20 @@ class CheckoutCommand(EdkrepoCommand):
> def get_metadata(self):
> metadata = {}
> metadata['name'] = 'checkout'
> - metadata['help-text'] = arguments.COMMAND_DESCRIPTION
> + metadata['help-text'] = arguments.COMMAND_DESCRIPTION
> args = []
> metadata['arguments'] = 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
>
> def run_command(self, args, config):
> - checkout(args.Combination, args.verbose, args.override)
> + if combination_is_in_manifest(args.Combination,
> get_workspace_manifest()):
> + 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.<BR> #
> +SPDX-License-Identifier: BSD-2-Clause-Patent #
> +
> +NO_COMBO = 'A combination named: {} does not exist in the workspace
> manifest'
> --
> 2.16.2.windows.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [edk2-staging/EdkRepo] [PATCH V2] EdkRepo: Only process the checkout command if a valid combo is used
2020-05-15 0:29 [edk2-staging/EdkRepo] [PATCH V2] EdkRepo: Only process the checkout command if a valid combo is used Ashley E Desimone
2020-05-18 1:20 ` Nate DeSimone
@ 2020-05-18 1:22 ` Nate DeSimone
1 sibling, 0 replies; 3+ messages in thread
From: Nate DeSimone @ 2020-05-18 1:22 UTC (permalink / raw)
To: Desimone, Ashley E, devel@edk2.groups.io
Cc: Pandya, Puja, Bjorge, Erik C, Bret Barkelew, Agyeman, Prince
Pushed: 102fd2e2
> -----Original Message-----
> From: Desimone, Ashley E <ashley.e.desimone@intel.com>
> Sent: Thursday, May 14, 2020 5:30 PM
> To: devel@edk2.groups.io
> Cc: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Pandya, Puja
> <puja.pandya@intel.com>; Bjorge, Erik C <erik.c.bjorge@intel.com>; Bret
> Barkelew <Bret.Barkelew@microsoft.com>; Agyeman, Prince
> <prince.agyeman@intel.com>
> Subject: [edk2-staging/EdkRepo] [PATCH V2] EdkRepo: Only process the
> checkout command if a valid combo is used
>
> Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Puja Pandya <puja.pandya@intel.com>
> Cc: Erik Bjorge <erik.c.bjorge@intel.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Prince Agyeman <prince.agyeman@intel.com>
> ---
> 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/checkout_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.<BR>
> +# Copyright (c) 2017- 2020, Intel Corporation. All rights reserved.<BR>
> # SPDX-License-Identifier: BSD-2-Clause-Patent # # Standard modules @@
> -14,8 +14,11 @@ import os
>
> # Our modules
> from edkrepo.commands.edkrepo_command import EdkrepoCommand,
> OverrideArgument -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
> +EdkrepoInvalidParametersException from edkrepo.config.config_factory
> +import get_workspace_manifest
>
>
> class CheckoutCommand(EdkrepoCommand):
> @@ -25,17 +28,20 @@ class CheckoutCommand(EdkrepoCommand):
> def get_metadata(self):
> metadata = {}
> metadata['name'] = 'checkout'
> - metadata['help-text'] = arguments.COMMAND_DESCRIPTION
> + metadata['help-text'] = arguments.COMMAND_DESCRIPTION
> args = []
> metadata['arguments'] = 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
>
> def run_command(self, args, config):
> - checkout(args.Combination, args.verbose, args.override)
> + if combination_is_in_manifest(args.Combination,
> get_workspace_manifest()):
> + 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.<BR> #
> +SPDX-License-Identifier: BSD-2-Clause-Patent #
> +
> +NO_COMBO = 'A combination named: {} does not exist in the workspace
> manifest'
> --
> 2.16.2.windows.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-18 1:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-15 0:29 [edk2-staging/EdkRepo] [PATCH V2] EdkRepo: Only process the checkout command if a valid combo is used Ashley E Desimone
2020-05-18 1:20 ` Nate DeSimone
2020-05-18 1:22 ` Nate DeSimone
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox