> -----Original Message-----
> From: [email protected]
> <[email protected]> On Behalf Of Robert Yang via
> lists.openembedded.org
> Sent: den 11 september 2024 16:36
> To: [email protected]
> Cc: [email protected]
> Subject: [OE-core] [PATCH v3 2/2] lib/buildcfg: Add
> is_bitbake_in_separate_repo()
>
> From: Robert Yang <[email protected]>
>
> This would help various tooling that is being developed for setting up layers
> and builds, or creating configurations for those tasks out of pre-existing
> yocto setups.
>
> Suggested-by: Alexander Kanavin <[email protected]>
> Signed-off-by: Robert Yang <[email protected]>
> ---
> meta/lib/oe/buildcfg.py | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/meta/lib/oe/buildcfg.py b/meta/lib/oe/buildcfg.py
> index dab4aa7831..9256b327ed 100644
> --- a/meta/lib/oe/buildcfg.py
> +++ b/meta/lib/oe/buildcfg.py
> @@ -71,6 +71,16 @@ def is_layer_modified(path):
> # output and a 129 return code when a layer isn't a git repo at all.
> return " -- modified"
>
> +def is_bitbake_in_separate_repo(bitbake_dir):
> + """
> + Check whether bitbake is in a separate git repo
> + """
> + bitbake_git_dir = os.path.join(bitbake_dir, '.git')
> + if os.path.exists(bitbake_git_dir):
> + return True
> + else:
> + return False
That if-statement can be simplified to:
return os.path.exists(bitbake_git_dir)
> +
> def get_branch_rev3(revisions):
> # Return 3 items for each revision
> return ["%-20s = \"%s:%s\"" % (r[1], r[2], r[3]) for r in revisions]
> --
> 2.44.1
//Peter
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#204419):
https://lists.openembedded.org/g/openembedded-core/message/204419
Mute This Topic: https://lists.openembedded.org/mt/108394690/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-