From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web12.2123.1585702282618140971 for ; Tue, 31 Mar 2020 17:51:22 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: ashley.e.desimone@intel.com) IronPort-SDR: 4Pa/i5BvLEtvtG3//8e/hcATR6CrrRJsC0DfA7w5LdiifIqKHQb6Yy6/2vKTjGwbaSubAGHNQ1 AA7171J9aElg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2020 17:51:22 -0700 IronPort-SDR: IL0lhznIzZIshbuClUSoZOx6o2mkH4OoIEZCMTrGAjOx3L+ZBWyvS73ZTM+BHFcVolYoegwbas tqG+2C/46KLA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,329,1580803200"; d="scan'208";a="252431568" Received: from aedesimo-desk.amr.corp.intel.com ([10.7.159.171]) by orsmga006.jf.intel.com with ESMTP; 31 Mar 2020 17:51:22 -0700 From: "Desimone, Ashley E" To: devel@edk2.groups.io Cc: Nate DeSimone , Puja Pandya , Erik Bjorge , Bret Barkelew , Prince Agyeman 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 Message-Id: <20200401005118.24224-1-ashley.e.desimone@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 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