On Thu, 2026-07-23 at 06:02 +0000, Baban via lists.openembedded.org wrote:
> 'devtool update-recipe' and 'devtool finish' default to guessing the
> recipe update mode: 'srcrev' when the source tree HEAD sits on the
> upstream branch (the "checked out another upstream revision" workflow),
> 'patch' otherwise. The guesser matches SRC_URI entries against a
> literal 'git://' prefix, so a gitsm:// recipe never has any git URIs
> from its point of view and always falls into patch mode.
> 
> In that case there are no local commits to export either, so checking
> out a different upstream revision and running update-recipe reports
> "No patches or files need updating" and silently leaves the recipe's
> SRCREV untouched, while the same operation on a git:// recipe updates
> SRCREV. Forcing -m srcrev works, since _update_recipe_srcrev() is
> scheme-agnostic; only the guess is broken.
> 
> Accept gitsm:// URIs the same way e7076f1742 ("devtool: gitsm://
> should be handled same as git:// in upgrades") did for the upgrade
> path, where the same omission was fixed; the guesser itself dates from
> 9b9733b7d7 (2015), before gitsm handling was a consideration.
> 
> Note this changes the guessed mode for existing gitsm:// recipes from
> 'patch' to 'srcrev' when HEAD is on the upstream branch — the behavior
> git:// recipes have had since 2015. Trees carrying local commits still
> guess 'patch', because their HEAD is not reachable from the upstream
> branch.
> 
> AI-Generated: Uses Claude (claude-sonnet-5)
> Signed-off-by: Babanpreet Singh <[email protected]>
> ---
>  scripts/lib/devtool/standard.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
> index b2b27c7ced..2dff62a7ca 100644
> --- a/scripts/lib/devtool/standard.py
> +++ b/scripts/lib/devtool/standard.py
> @@ -1816,7 +1816,7 @@ def _guess_recipe_update_mode(srctree, rdata):
>      """Guess the recipe update mode to use"""
>      import bb.process
>      src_uri = (rdata.getVar('SRC_URI') or '').split()
> -    git_uris = [uri for uri in src_uri if uri.startswith('git://')]
> +    git_uris = [uri for uri in src_uri if uri.startswith('git://') or 
> uri.startswith('gitsm://')]

There is a slightly neater python syntax for that:

    git_uris = [uri for uri in src_uri if uri.startswith(('git://', 
'gitsm://'))]

as startswith can take a tuple.

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#241838): 
https://lists.openembedded.org/g/openembedded-core/message/241838
Mute This Topic: https://lists.openembedded.org/mt/120407042/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to