Re: [OE-core] [RFC 5/7] lib/oe/buildcfg.py: Add additional git functions

2024-02-19 Thread Jermain Horsman
> Was there a reason why this wasn't merged in the end (other than being sent 
> as RFC)?

I'm assuming you meant to reply to this one instead:
https://lists.openembedded.org/g/openembedded-core/message/190292

I did not include this in the final version as we ended up going in a bit of a 
different direction,
as a result I did not change the file that used these functions, and therefore 
did not include this patch.

I'd be more than happy to send this as a standalone though.

Sincerely,

Jermain Horsman

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#195866): 
https://lists.openembedded.org/g/openembedded-core/message/195866
Mute This Topic: https://lists.openembedded.org/mt/102444609/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [RFC 5/7] lib/oe/buildcfg.py: Add additional git functions

2024-02-18 Thread Martin Jansa
Was there a reason why this wasn't merged in the end (other than being sent
as RFC)?

We're using git describe in webOS for long time (through our bbclass:
https://github.com/webosose/meta-webosose/blob/master/meta-webos/classes/webos_base.bbclass#L114
)

I would be happy to drop it from our bbclass to use this shared function.

Regards,

On Tue, Nov 7, 2023 at 4:27 PM Jermain Horsman 
wrote:

> From: Jermain Horsman 
>
> Includes a function to determine the default remote.
>
> Signed-off-by: Jermain Horsman 
> ---
>  meta/lib/oe/buildcfg.py | 16 
>  1 file changed, 16 insertions(+)
>
> diff --git a/meta/lib/oe/buildcfg.py b/meta/lib/oe/buildcfg.py
> index f9cb0cc74c..2ca654e56e 100644
> --- a/meta/lib/oe/buildcfg.py
> +++ b/meta/lib/oe/buildcfg.py
> @@ -50,6 +50,22 @@ def get_metadata_git_remote_url(path, remote):
>  uri = ''
>  return uri.strip()
>
> +def get_metadata_git_default_remote(path):
> +remotes = get_metadata_git_remotes(path)
> +if len(remotes) == 1:
> +default_remote = remotes[0]
> +else:
> +try:
> +default_remote, _ = bb.process.run('git config --local
> checkout.defaultRemote', cwd=path)
> +except bb.process.ExecutionError:
> +default_remote = ""
> +if not default_remote:
> +try:
> +default_remote, _ = bb.process.run('git config
> checkout.defaultRemote', cwd=path)
> +except bb.process.ExecutionError:
> +default_remote = ""
> +return default_remote.strip()
> +
>  def get_metadata_git_describe(path):
>  try:
>  describe, _ = bb.process.run('git describe --tags', cwd=path)
> --
> 2.42.0.windows.2
>
>
> 
>
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#195832): 
https://lists.openembedded.org/g/openembedded-core/message/195832
Mute This Topic: https://lists.openembedded.org/mt/102444609/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [RFC 5/7] lib/oe/buildcfg.py: Add additional git functions

2023-11-07 Thread Jermain Horsman
From: Jermain Horsman 

Includes a function to determine the default remote.

Signed-off-by: Jermain Horsman 
---
 meta/lib/oe/buildcfg.py | 16 
 1 file changed, 16 insertions(+)

diff --git a/meta/lib/oe/buildcfg.py b/meta/lib/oe/buildcfg.py
index f9cb0cc74c..2ca654e56e 100644
--- a/meta/lib/oe/buildcfg.py
+++ b/meta/lib/oe/buildcfg.py
@@ -50,6 +50,22 @@ def get_metadata_git_remote_url(path, remote):
 uri = ''
 return uri.strip()
 
+def get_metadata_git_default_remote(path):
+remotes = get_metadata_git_remotes(path)
+if len(remotes) == 1:
+default_remote = remotes[0]
+else:
+try:
+default_remote, _ = bb.process.run('git config --local 
checkout.defaultRemote', cwd=path)
+except bb.process.ExecutionError:
+default_remote = ""
+if not default_remote:
+try:
+default_remote, _ = bb.process.run('git config 
checkout.defaultRemote', cwd=path)
+except bb.process.ExecutionError:
+default_remote = ""
+return default_remote.strip()
+
 def get_metadata_git_describe(path):
 try:
 describe, _ = bb.process.run('git describe --tags', cwd=path)
-- 
2.42.0.windows.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#190295): 
https://lists.openembedded.org/g/openembedded-core/message/190295
Mute This Topic: https://lists.openembedded.org/mt/102444609/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-