]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
lib/oe/patch: Make GitApplyTree.extractPatches() return the patches
authorPeter Kjellerstedt <pkj@axis.com>
Tue, 24 Feb 2026 23:22:35 +0000 (00:22 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 2 Mar 2026 18:02:33 +0000 (18:02 +0000)
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>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/patch.py

index 246fc6221f9cd8d5512abea2e5b3ab3609b64809..afc42df8a7e29483ec00f0b1c05780bde3d84f81 100644 (file)
@@ -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)