public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Robert Yang <liezhi.yang@windriver.com>
To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>,
	"openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>
Cc: "alex.kanavin@gmail.com" <alex.kanavin@gmail.com>
Subject: Re: [OE-core] [PATCH v3 2/2] lib/buildcfg: Add is_bitbake_in_separate_repo()
Date: Thu, 12 Sep 2024 17:10:16 +0800	[thread overview]
Message-ID: <f4f9df7b-6830-40f7-a29e-43cd86fe6abf@windriver.com> (raw)
In-Reply-To: <DB5PR02MB1021387DDF9A7CA5E3FF95BF4EF642@DB5PR02MB10213.eurprd02.prod.outlook.com>



On 9/12/24 13:13, Peter Kjellerstedt wrote:
>> -----Original Message-----
>> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Robert Yang via lists.openembedded.org
>> Sent: den 11 september 2024 16:36
>> To: openembedded-core@lists.openembedded.org
>> Cc: alex.kanavin@gmail.com
>> Subject: [OE-core] [PATCH v3 2/2] lib/buildcfg: Add is_bitbake_in_separate_repo()
>>
>> From: Robert Yang <liezhi.yang@windriver.com>
>>
>> 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 <alex.kanavin@gmail.com>
>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>> ---
>>   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)

Thanks, updated in the pull request:

   https://github.com/robertlinux/yocto rbt/bbrev
   https://github.com/robertlinux/yocto/tree/rbt/bbrev

// Robert

> 
>> +
>>   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
> 


      reply	other threads:[~2024-09-12  9:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-11 14:35 [PATCH v3 0/2] classes: Print bitbake branch and revision liezhi.yang
2024-09-11 14:35 ` [PATCH v3 1/2] " liezhi.yang
2024-09-17 11:12   ` [OE-core] " Richard Purdie
2024-09-18  7:56     ` Robert Yang
2024-09-11 14:36 ` [PATCH v3 2/2] lib/buildcfg: Add is_bitbake_in_separate_repo() liezhi.yang
2024-09-12  5:13   ` [OE-core] " Peter Kjellerstedt
2024-09-12  9:10     ` Robert Yang [this message]

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=f4f9df7b-6830-40f7-a29e-43cd86fe6abf@windriver.com \
    --to=liezhi.yang@windriver.com \
    --cc=alex.kanavin@gmail.com \
    --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