From: "Desimone, Ashley E" <ashley.e.desimone@intel.com>
To: devel@edk2.groups.io
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>,
Puja Pandya <puja.pandya@intel.com>,
Erik Bjorge <erik.c.bjorge@intel.com>,
Bret Barkelew <Bret.Barkelew@microsoft.com>,
Prince Agyeman <prince.agyeman@intel.com>
Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Allow pin file to be checked out when combo is not in project manifest
Date: Tue, 31 Mar 2020 17:51:18 -0700 [thread overview]
Message-ID: <20200401005118.24224-1-ashley.e.desimone@intel.com> (raw)
When a pin file is based on a combo that is not in the project
manifest file but otherwise matches the project print a warning
instead of throwing and exception and allow the pin to be
checked out.
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_pin_command.py | 10 ++++++++--
edkrepo/commands/humble/checkout_pin_humble.py | 4 +++-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/edkrepo/commands/checkout_pin_command.py b/edkrepo/commands/checkout_pin_command.py
index 619fcf8..72075bf 100644
--- a/edkrepo/commands/checkout_pin_command.py
+++ b/edkrepo/commands/checkout_pin_command.py
@@ -90,11 +90,17 @@ class CheckoutPinCommand(EdkrepoCommand):
elif not set(pin.remotes).issubset(set(manifest.remotes)):
raise EdkrepoProjectMismatchException(humble.MANIFEST_MISMATCH)
elif pin.general_config.current_combo not in [c.name for c in manifest.combinations]:
- raise EdkrepoProjectMismatchException(humble.MANIFEST_MISMATCH)
+ print(humble.COMBO_NOT_FOUND.format(pin.general_config.current_combo))
combo_name = pin.general_config.current_combo
pin_sources = pin.get_repo_sources(combo_name)
pin_root_remote = {source.root:source.remote_name for source in pin_sources}
- manifest_sources = manifest.get_repo_sources(combo_name)
+ try:
+ # If the pin and the project manifest have the same combo get the
+ # repo sources from that combo. Otherwise get the default combo's
+ # repo sources
+ manifest_sources = manifest.get_repo_sources(combo_name)
+ except ValueError:
+ manifest_sources = manifest.get_repo_sources(manifest.general_config.default_combo)
manifest_root_remote = {source.root:source.remote_name for source in manifest_sources}
if set(pin_root_remote.items()).isdisjoint(set(manifest_root_remote.items())):
raise EdkrepoProjectMismatchException(humble.MANIFEST_MISMATCH)
diff --git a/edkrepo/commands/humble/checkout_pin_humble.py b/edkrepo/commands/humble/checkout_pin_humble.py
index ac7467d..ec6938d 100644
--- a/edkrepo/commands/humble/checkout_pin_humble.py
+++ b/edkrepo/commands/humble/checkout_pin_humble.py
@@ -12,4 +12,6 @@ NOT_FOUND = 'The selected PIN file was not found.'
MANIFEST_MISMATCH = ('The selected PIN file does not refer to the same project '
'as the local manifest file. {}'.format(CHP_EXIT))
COMMIT_NOT_FOUND = 'The commit referenced by the PIN file does not exist. {}'.format(CHP_EXIT)
-PIN_COMBO = 'Pin: {}'
\ No newline at end of file
+PIN_COMBO = 'Pin: {}'
+COMBO_NOT_FOUND = ('Warning: The combo listed in PIN file: {} is no longer '
+ 'listed in the project manifest file.')
\ No newline at end of file
--
2.16.2.windows.1
next reply other threads:[~2020-04-01 0:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-01 0:51 Desimone, Ashley E [this message]
2020-04-02 6:09 ` [edk2-staging/EdkRepo] [PATCH] EdkRepo: Allow pin file to be checked out when combo is not in project manifest Nate DeSimone
2020-04-03 22:24 ` Nate DeSimone
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200401005118.24224-1-ashley.e.desimone@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox