diff mbox series

[PATCHv2,1/2] lib/oe/patch: Make GitApplyTree.extractPatches() return the patches

Message ID 20260224232236.2048910-1-pkj@axis.com
State New
Headers show
Series [PATCHv2,1/2] lib/oe/patch: Make GitApplyTree.extractPatches() return the patches | expand

Commit Message

Peter Kjellerstedt Feb. 24, 2026, 11:22 p.m. UTC
The list of patches will be used by _export_patches() in devtool to add
new patches in the correct order.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---

PATCHv2: New patch.

 meta/lib/oe/patch.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 246fc6221f..afc42df8a7 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -516,6 +516,7 @@  class GitApplyTree(PatchTree):
         import tempfile
         import shutil
         tempdir = tempfile.mkdtemp(prefix='oepatch')
+        patches = []
         try:
             for name, rev in startcommits.items():
                 shellcmd = ["git", "format-patch", "--no-signature", "--no-numbered", rev, "-o", tempdir]
@@ -553,11 +554,14 @@  class GitApplyTree(PatchTree):
                         outfile = notes.get(GitApplyTree.original_patch, os.path.basename(srcfile))
 
                         bb.utils.mkdirhier(os.path.join(outdir, name))
-                        with open(os.path.join(outdir, name, outfile), 'w') as of:
+                        patch = os.path.join(outdir, name, outfile)
+                        with open(patch, 'w') as of:
                             for line in patchlines:
                                 of.write(line)
+                        patches.append(patch)
         finally:
             shutil.rmtree(tempdir)
+        return patches
 
     def _need_dirty_check(self):
         fetch = bb.fetch2.Fetch([], self.d)