Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-edk2toollib for 
openSUSE:Factory checked in at 2026-10-20 12:44:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-edk2toollib (Old)
 and      /work/SRC/openSUSE:Factory/.python-edk2toollib.new.3698736 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-edk2toollib"

Tue Oct 20 12:44:05 2026 rev:4 rq:1386429 version:0.23.17

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-edk2toollib/python-edk2toollib.changes    
2026-08-25 13:21:30.331955911 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-edk2toollib.new.3698736/python-edk2toollib.changes
       2026-10-20 12:44:11.397222217 +0200
@@ -1,0 +2,8 @@
+Fri Oct 16 14:27:06 UTC 2026 - Martin Pluskal <[email protected]>
+
+- Update to 0.23.17:
+  * dsc_parser: Restore TargetFilePath after nested !include
+  * EDK2Path: Handle os.PathLike objects correctly for Python 3.14+
+  * fmp_capsule_header: Bugfix counts
+
+-------------------------------------------------------------------

Old:
----
  edk2-pytool-library-0.23.16.tar.gz

New:
----
  edk2-pytool-library-0.23.17.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-edk2toollib.spec ++++++
--- /var/tmp/diff_new_pack.JLOc1p/_old  2026-10-20 12:44:12.360262505 +0200
+++ /var/tmp/diff_new_pack.JLOc1p/_new  2026-10-20 12:44:12.361262547 +0200
@@ -18,7 +18,7 @@
 
 %{?sle15_python_module_pythons}
 Name:           python-edk2toollib
-Version:        0.23.16
+Version:        0.23.17
 Release:        0
 Summary:        Tianocore Edk2 PyTool Library
 License:        BSD-2-Clause-Patent
@@ -39,6 +39,9 @@
 BuildRequires:  %{python_module setuptools_scm}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  %{python_module wheel}
+BuildRequires:  fdupes
+BuildRequires:  git-core
+BuildRequires:  python-rpm-macros
 Requires:       python-GitPython >= 3.1.30
 Requires:       python-SQLAlchemy >= 2.0.0
 Requires:       python-cryptography >= 39.0.1
@@ -46,9 +49,6 @@
 Requires:       python-pyasn1 >= 0.4.8
 Requires:       python-pyasn1-modules >= 0.2.8
 Requires:       python-pygount >= 1.6.1
-BuildRequires:  fdupes
-BuildRequires:  git-core
-BuildRequires:  python-rpm-macros
 BuildArch:      noarch
 %python_subpackages
 

++++++ edk2-pytool-library-0.23.16.tar.gz -> edk2-pytool-library-0.23.17.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/edk2-pytool-library-0.23.16/edk2toollib/uefi/edk2/parsers/dsc_parser.py 
new/edk2-pytool-library-0.23.17/edk2toollib/uefi/edk2/parsers/dsc_parser.py
--- old/edk2-pytool-library-0.23.16/edk2toollib/uefi/edk2/parsers/dsc_parser.py 
2026-08-25 00:29:02.000000000 +0200
+++ new/edk2-pytool-library-0.23.17/edk2toollib/uefi/edk2/parsers/dsc_parser.py 
2026-09-17 22:14:44.000000000 +0200
@@ -60,6 +60,7 @@
         self.PcdValueDict = {}
         self._no_fail_mode = False
         self._dsc_file_paths = set()  # This includes the full paths for every 
DSC that makes up the file
+        self._target_file_stack = []  # previous TargetFilePath values for 
nested !include
 
     def ReplacePcds(self, line: str) -> str:
         """Attempts to replace a token if it is a PCD token."""
@@ -289,6 +290,8 @@
                 if len(line) > 0:
                     self.Lines.append(line)
                 self.__ProcessMore(add, file_name=new_file)
+                if add:
+                    self._PopTargetFile()
             except Exception as e:
                 # check if we're in no fail mode or not
                 if not self._no_fail_mode:  # if we are, fail
@@ -314,6 +317,8 @@
             try:
                 (line, add) = self.__ParseDefineLine(raw_line)
                 self.__ProcessDefines(add)
+                if add:
+                    self._PopTargetFile()
             except Exception:
                 # Since we're going to do this in ProcessMore, don't warn 
people if there's an exception
                 # otherwise, raise the exception and act normally
@@ -472,6 +477,7 @@
         # add more DSC parser based state reset here, if necessary
         #
         super(DscParser, self).ResetParserState()
+        self._target_file_stack = []
 
     def ParseFile(self, filepath: str) -> None:
         """Parses the DSC file at the provided path."""
@@ -496,9 +502,15 @@
         self.Parsed = True
 
     def _PushTargetFile(self, targetFile: str) -> None:
+        if self.TargetFilePath:
+            self._target_file_stack.append(self.TargetFilePath)
         self.TargetFilePath = os.path.abspath(targetFile)
         self._dsc_file_paths.add(self.TargetFilePath)
 
+    def _PopTargetFile(self) -> None:
+        if self._target_file_stack:
+            self.TargetFilePath = self._target_file_stack.pop()
+
     def GetMods(self) -> list:
         """Returns a list with all Mods."""
         return self.ThreeMods + self.SixMods + self.OtherMods
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/edk2-pytool-library-0.23.16/edk2toollib/uefi/edk2/path_utilities.py 
new/edk2-pytool-library-0.23.17/edk2toollib/uefi/edk2/path_utilities.py
--- old/edk2-pytool-library-0.23.16/edk2toollib/uefi/edk2/path_utilities.py     
2026-08-25 00:29:02.000000000 +0200
+++ new/edk2-pytool-library-0.23.17/edk2toollib/uefi/edk2/path_utilities.py     
2026-09-17 22:14:44.000000000 +0200
@@ -58,11 +58,11 @@
         # Other code is dependent the following types, so keep it that way:
         #   - self.PackagePathList: List[str]
         #   - self.WorkspacePath: str
-        ws = ws.replace("\\", "/")
-        workspace_candidate_path = Path(ws)
+        normalized_workspace = ws.replace("\\", "/") if isinstance(ws, str) 
else ws
+        workspace_candidate_path = Path(normalized_workspace)
 
         if not workspace_candidate_path.is_absolute():
-            workspace_candidate_path = Path.cwd() / ws
+            workspace_candidate_path = Path.cwd() / normalized_workspace
 
         if not workspace_candidate_path.is_dir():
             raise NotADirectoryError(errno.ENOENT, os.strerror(errno.ENOENT), 
workspace_candidate_path.resolve())
@@ -71,7 +71,11 @@
 
         candidate_package_path_list = []
         start_time = timeit.default_timer()
-        for a in [Path(path.replace("\\", "/")) for path in package_path_list]:
+        for path in package_path_list:
+            if isinstance(path, str):
+                path = path.replace("\\", "/")
+
+            a = Path(path)
             if a.is_absolute():
                 candidate_package_path_list.append(a)
             else:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/edk2-pytool-library-0.23.16/edk2toollib/uefi/fmp_capsule_header.py 
new/edk2-pytool-library-0.23.17/edk2toollib/uefi/fmp_capsule_header.py
--- old/edk2-pytool-library-0.23.16/edk2toollib/uefi/fmp_capsule_header.py      
2026-08-25 00:29:02.000000000 +0200
+++ new/edk2-pytool-library-0.23.17/edk2toollib/uefi/fmp_capsule_header.py      
2026-09-17 22:14:44.000000000 +0200
@@ -322,7 +322,7 @@
                 Length = offset_list[Index + 1] - Offset
             else:
                 Length = len(Buffer) - Offset
-            self.AddEmbeddedDriver(Buffer[Offset : Offset + Length])
+            self._EmbeddedDriverList.append(Buffer[Offset : Offset + Length])
 
         #
         # Parse the Payloads that are FMP Capsule Images
@@ -335,7 +335,7 @@
                 Length = len(Buffer) - Offset
             FmpCapsuleImageHeader = FmpCapsuleImageHeaderClass()
             FmpCapsuleImageHeader.Decode(Buffer[Offset : Offset + Length])
-            self.AddFmpCapsuleImageHeader(FmpCapsuleImageHeader)
+            self._FmpCapsuleImageHeaderList.append(FmpCapsuleImageHeader)
 
         return Result
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/edk2-pytool-library-0.23.16/tests.unit/parsers/test_dsc_parser.py 
new/edk2-pytool-library-0.23.17/tests.unit/parsers/test_dsc_parser.py
--- old/edk2-pytool-library-0.23.16/tests.unit/parsers/test_dsc_parser.py       
2026-08-25 00:29:02.000000000 +0200
+++ new/edk2-pytool-library-0.23.17/tests.unit/parsers/test_dsc_parser.py       
2026-09-17 22:14:44.000000000 +0200
@@ -157,6 +157,38 @@
         finally:
             os.chdir(cwd)
 
+    def test_dsc_two_sibling_relative_includes(self):
+        """Sibling !include paths are resolved from the parent, not the 
previous include (issue 394)."""
+        workspace = tempfile.mkdtemp()
+        pkg = os.path.join(workspace, "Platforms", "PlatformPkg")
+        includes = os.path.join(pkg, "includes")
+        os.makedirs(includes, exist_ok=True)
+
+        parent = os.path.join(pkg, "PlatformPkg.dsc")
+        inc1 = os.path.join(includes, "PCDs1.dsc.inc")
+        inc2 = os.path.join(includes, "PCDs2.dsc.inc")
+
+        TestDscParserIncludes.write_to_file(
+            parent,
+            textwrap.dedent(
+                """\
+                [Defines]
+                    PLATFORM_NAME = SomePlatformPkg
+                !include includes/PCDs1.dsc.inc
+                !include includes/PCDs2.dsc.inc
+                """
+            ),
+        )
+        TestDscParserIncludes.write_to_file(inc1, "    DEFINE FIRST_INC = 
TRUE\n")
+        TestDscParserIncludes.write_to_file(inc2, "    DEFINE SECOND_INC = 
TRUE\n")
+
+        parser = DscParser()
+        parser.SetEdk2Path(Edk2Path(workspace, []))
+        parser.ParseFile(parent)
+
+        self.assertEqual(parser.LocalVars.get("FIRST_INC"), "TRUE")
+        self.assertEqual(parser.LocalVars.get("SECOND_INC"), "TRUE")
+
     def test_dsc_define_statements(self):
         """This test some dsc define statements"""
         SAMPLE_DSC_FILE1 = textwrap.dedent("""\
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/edk2-pytool-library-0.23.16/tests.unit/test_fmp_capsule_header.py 
new/edk2-pytool-library-0.23.17/tests.unit/test_fmp_capsule_header.py
--- old/edk2-pytool-library-0.23.16/tests.unit/test_fmp_capsule_header.py       
2026-08-25 00:29:02.000000000 +0200
+++ new/edk2-pytool-library-0.23.17/tests.unit/test_fmp_capsule_header.py       
2026-09-17 22:14:44.000000000 +0200
@@ -7,8 +7,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 import unittest
+
 import pytest
-from edk2toollib.uefi.fmp_capsule_header import FmpCapsuleHeaderClass
+from edk2toollib.uefi.fmp_capsule_header import FmpCapsuleHeaderClass, 
FmpCapsuleImageHeaderClass
 
 
 class TestFmpCapsuleHeaderClass(unittest.TestCase):
@@ -38,3 +39,19 @@
         encode_1 = test_header.Encode()
         encode_2 = test_header.Encode()
         self.assertEqual(encode_1, encode_2)
+
+    def test_decoding_should_preserve_item_counts(self):
+        image_header = FmpCapsuleImageHeaderClass()
+        image_header.UpdateImageIndex = 1
+
+        encoded_header = FmpCapsuleHeaderClass()
+        encoded_header.AddEmbeddedDriver(b"dummydriver")
+        encoded_header.AddFmpCapsuleImageHeader(image_header)
+
+        decoded_header = FmpCapsuleHeaderClass()
+        decoded_header.Decode(encoded_header.Encode())
+
+        self.assertEqual(decoded_header.EmbeddedDriverCount, 1)
+        self.assertEqual(decoded_header.PayloadItemCount, 1)
+        self.assertEqual(decoded_header.GetEmbeddedDriver(0), b"dummydriver")
+        
self.assertEqual(decoded_header.GetFmpCapsuleImageHeader(0).UpdateImageIndex, 1)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/edk2-pytool-library-0.23.16/tests.unit/test_path_utilities.py 
new/edk2-pytool-library-0.23.17/tests.unit/test_path_utilities.py
--- old/edk2-pytool-library-0.23.16/tests.unit/test_path_utilities.py   
2026-08-25 00:29:02.000000000 +0200
+++ new/edk2-pytool-library-0.23.17/tests.unit/test_path_utilities.py   
2026-09-17 22:14:44.000000000 +0200
@@ -83,6 +83,17 @@
         pathobj = Edk2Path(self.tmp, [])
         self.assertEqual(pathobj.WorkspacePath, self.tmp)
 
+    def test_basic_init_pathlike(self):
+        """Test edk2path with Path objects for the workspace and package 
path."""
+        workspace_path = Path(self.tmp)
+        package_path = workspace_path / "package_path"
+        package_path.mkdir()
+
+        pathobj = Edk2Path(workspace_path, [package_path])
+
+        self.assertEqual(pathobj.WorkspacePath, str(workspace_path))
+        self.assertEqual(pathobj.PackagePathList, [str(package_path)])
+
     def test_basic_init_ws_cwd(self):
         """Test edk2path with a relative path to workspace."""
         relpath = "testrootfolder"

Reply via email to