Re: [edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Allow pin file to be checked out when combo is not in project manifest

2020-04-03 Thread Nate DeSimone
Pushed: https://github.com/tianocore/edk2-staging/commit/1c768b9f

-Original Message-
From: Desimone, Ashley E  
Sent: Tuesday, March 31, 2020 5:51 PM
To: devel@edk2.groups.io
Cc: Desimone, Nathaniel L ; Pandya, Puja 
; Bjorge, Erik C ; Bret 
Barkelew ; Agyeman, Prince 

Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Allow pin file to be checked 
out when combo is not in project manifest

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 
Cc: Nate DeSimone 
Cc: Puja Pandya 
Cc: Erik Bjorge 
Cc: Bret Barkelew 
Cc: Prince Agyeman 
---
 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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#56956): https://edk2.groups.io/g/devel/message/56956
Mute This Topic: https://groups.io/mt/72690981/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Allow pin file to be checked out when combo is not in project manifest

2020-04-02 Thread Nate DeSimone
Reviewed-by: Nate DeSimone 

-Original Message-
From: Desimone, Ashley E  
Sent: Tuesday, March 31, 2020 5:51 PM
To: devel@edk2.groups.io
Cc: Desimone, Nathaniel L ; Pandya, Puja 
; Bjorge, Erik C ; Bret 
Barkelew ; Agyeman, Prince 

Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Allow pin file to be checked 
out when combo is not in project manifest

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 
Cc: Nate DeSimone 
Cc: Puja Pandya 
Cc: Erik Bjorge 
Cc: Bret Barkelew 
Cc: Prince Agyeman 
---
 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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#56885): https://edk2.groups.io/g/devel/message/56885
Mute This Topic: https://groups.io/mt/72690981/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-