public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: peter.kjellerstedt@axis.com, openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH] devtool: standard: Add new patches in correct order when finishing
Date: Thu, 12 Feb 2026 15:15:30 +0000	[thread overview]
Message-ID: <4a2c5d68e143c2260023afbdb67ab25573c7a49c.camel@linuxfoundation.org> (raw)
In-Reply-To: <20260206011344.1788785-1-pkj@axis.com>

Hi Peter,

On Fri, 2026-02-06 at 02:13 +0100, Peter Kjellerstedt via lists.openembedded.org wrote:
> Make sure that new patches that are added as a result of using devtool
> finish are added to the SRC_URI in the same order they were committed.
> 
> Previously, the order was a result of the arbitrary order the patch
> files were returned by os.walk(), which typically resulted in them being
> added to the SRC_URI in the reverse order they were committed.
> 
> Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> ---
>  meta/lib/oeqa/selftest/cases/devtool.py | 30 +++++++++++++++++++------
>  scripts/lib/devtool/standard.py         |  6 ++++-
>  2 files changed, 28 insertions(+), 8 deletions(-)
> 
> 
> 
[....]

> diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
> index 1fd5947c41..7afb4654cc 100644
> --- a/scripts/lib/devtool/standard.py
> +++ b/scripts/lib/devtool/standard.py
> @@ -1322,7 +1322,11 @@ def _export_patches(srctree, rd, start_revs, destdir, changed_revs=None):
>      patch_pathspec = _git_exclude_path(srctree, 'oe-local-files')
>      GitApplyTree.extractPatches(srctree, start_revs, destdir, patch_pathspec)
>      for dirpath, dirnames, filenames in os.walk(destdir):
> -        new_patches = filenames
> +        # Sort the filenames to avoid the arbitrary order resulting from using
> +        # os.walk(). This matters for added patches, and the assumption is that
> +        # they are prefixed by a four digit number resulting from the order in
> +        # which they were committed.
> +        new_patches = sorted(filenames)
>          reldirpath = os.path.relpath(dirpath, destdir)
>          for new_patch in new_patches:
>              # Strip numbering from patch names. If it's a git sequence named patch,

This looks like a good find and something we should fix.

I did wonder if we always number the patches? I ask as the code in
extractPatches() calls:

"git", "format-patch", "--no-signature", "--no-numbered"

which hints that it might not?

Could we pass the patch list from that function in the correct order
rather than relying on a directory listing?

Cheers,

Richard


  reply	other threads:[~2026-02-12 15:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06  1:13 [PATCH] devtool: standard: Add new patches in correct order when finishing Peter Kjellerstedt
2026-02-12 15:15 ` Richard Purdie [this message]
2026-02-24 23:23   ` [OE-core] " Peter Kjellerstedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4a2c5d68e143c2260023afbdb67ab25573c7a49c.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=peter.kjellerstedt@axis.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox