From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web12.418.1585694573550368246 for ; Tue, 31 Mar 2020 15:42:53 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: erik.c.bjorge@intel.com) IronPort-SDR: cqIfpMJp0usRiFrKNuxpaawfv6kJfCiSiiQnQi1y4VA310YWheaetsJ8bEVTxrRWplzdFJPHO8 ZjY31RvV6rWQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2020 15:42:53 -0700 IronPort-SDR: dOixnZrVr0f5povOpn9l+uF/gdeOUEhRUkDFOjo13E4vKiJVRD1Cm4qLVemOl2rhv0A6y1oKPc Lyxbp3142IQQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,329,1580803200"; d="scan'208";a="284168274" Received: from ecbjorge-mobl1.amr.corp.intel.com ([10.134.71.242]) by fmsmga002.fm.intel.com with ESMTP; 31 Mar 2020 15:42:53 -0700 From: "Bjorge, Erik C" To: devel@edk2.groups.io Cc: Nate DeSimone , Puja Pandya , Bret Barkelew , Prince Agyeman Subject: [edk2-staging/EdkRepo] [PATCH v1 2/7] EdkRepo: Added ability to display archived combinations Date: Tue, 31 Mar 2020 15:41:58 -0700 Message-Id: X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Added support for using the -a / --archived flags to include archived combinations. Signed-off-by: Erik Bjorge Cc: Nate DeSimone Cc: Puja Pandya Cc: Bret Barkelew Cc: Prince Agyeman --- edkrepo/commands/arguments/combo_args.py | 5 +++-- edkrepo/commands/combo_command.py | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/edkrepo/commands/arguments/combo_args.py b/edkrepo/commands/arguments/combo_args.py index af3ded9..dabb464 100644 --- a/edkrepo/commands/arguments/combo_args.py +++ b/edkrepo/commands/arguments/combo_args.py @@ -3,7 +3,7 @@ ## @file # combo_args.py # -# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -11,4 +11,5 @@ combo command meta data. ''' -COMMAND_DESCRIPTION = 'Displays the currently checked out combination and lists all available combinations.' \ No newline at end of file +COMMAND_DESCRIPTION = 'Displays the currently checked out combination and lists all available combinations.' +ARCHIVED_HELP = 'Include a listing of archived combinations.' diff --git a/edkrepo/commands/combo_command.py b/edkrepo/commands/combo_command.py index 68d6854..9e13f47 100644 --- a/edkrepo/commands/combo_command.py +++ b/edkrepo/commands/combo_command.py @@ -3,10 +3,11 @@ ## @file # combo_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 # from colorama import Fore +from colorama import Style from edkrepo.commands.edkrepo_command import EdkrepoCommand from edkrepo.commands.edkrepo_command import ColorArgument @@ -25,6 +26,11 @@ class ComboCommand(EdkrepoCommand): metadata['help-text'] = arguments.COMMAND_DESCRIPTION args = [] metadata['arguments'] = args + args.append({'name': 'archived', + 'short-name': 'a', + 'positional': False, + 'required': False, + 'help-text': arguments.ARCHIVED_HELP}) args.append(ColorArgument) return metadata @@ -32,9 +38,18 @@ class ComboCommand(EdkrepoCommand): init_color_console(args.color) manifest = get_workspace_manifest() - for combo in [c.name for c in manifest.combinations]: + combo_archive = [] + combo_list = [c.name for c in manifest.combinations] + if args.archived: + combo_archive = [c.name for c in manifest.archived_combinations] + combo_list.extend(combo_archive) + if manifest.general_config.current_combo not in combo_list: + combo_list.append(manifest.general_config.current_combo) + for combo in sorted(combo_list): if combo == manifest.general_config.current_combo: print("* {}{}{}".format(Fore.GREEN, combo, Fore.RESET)) + elif combo in combo_archive: + print(" {}{}{}{}".format(Fore.YELLOW, Style.BRIGHT, combo, Style.RESET_ALL)) else: print(" {}".format(combo)) if args.verbose: -- 2.21.0.windows.1