[edk2-devel] [edk2-staging/EdkRepo] [PATCH v1 2/2] EdkRepo: Adding backwards compatibility for old pin files

Bjorge, Erik C erik.c.bjorge at intel.com
Tue Jun 9 23:04:06 UTC 2020


Older pin files used the invalid enable_submodule attribute.  This has
been fixed for new pin files but we need to be able to support older pin
files as well.

Cc: Ashley E Desimone <ashley.e.desimone at intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone at intel.com>
Cc: Puja Pandya <puja.pandya at intel.com>
Cc: Bret Barkelew <Bret.Barkelew at microsoft.com>
Cc: Prince Agyeman <prince.agyeman at intel.com>
Cc: Erik Bjorge <erik.c.bjorge at intel.com>
Signed-off-by: Erik Bjorge <erik.c.bjorge at intel.com>
---
 edkrepo_manifest_parser/edk_manifest.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/edkrepo_manifest_parser/edk_manifest.py b/edkrepo_manifest_parser/edk_manifest.py
index adf6d52..00ad392 100644
--- a/edkrepo_manifest_parser/edk_manifest.py
+++ b/edkrepo_manifest_parser/edk_manifest.py
@@ -795,7 +795,11 @@ class _RepoSource():
             # If enableSubmodule is not set to True then default to False
             self.enableSub = (element.attrib['enableSubmodule'].lower() == 'true')
         except Exception:
-            self.enableSub = False
+            try:
+                # Adding backwards compatibility with pin files that used incorrect attribute
+                self.enableSub = (element.attrib['enable_submodule'].lower() == 'true')
+            except Exception:
+                self.enableSub = False

         if self.branch is None and self.commit is None and self.tag is None:
             raise KeyError(ATTRIBUTE_MISSING_ERROR)
--
2.27.0.windows.1


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

View/Reply Online (#60998): https://edk2.groups.io/g/devel/message/60998
Mute This Topic: https://groups.io/mt/74786172/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list