diff mbox series

[bitbake-devel,v2] bitbake-setup: Tell the user what to do if they don't like the top dir

Message ID 20251113161524.4068231-1-JPEWhacker@gmail.com
State New
Headers show
Series [bitbake-devel,v2] bitbake-setup: Tell the user what to do if they don't like the top dir | expand

Commit Message

Joshua Watt Nov. 13, 2025, 4:15 p.m. UTC
If the top level directory look new (e.g. doesn't contain a site.conf
file), then instruct the user on how to choose a different directory if
they desire. This should help clarify what bitbake-setup is about to do
and how to change it if desired.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 bin/bitbake-setup | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Comments

Alexander Kanavin Nov. 17, 2025, 6:43 p.m. UTC | #1
I had the vague feeling during the call there's a patch I've seen
which was missed, and this is the patch.

Can you tweak it, so that this message:
Bitbake-setup is using /home/alex/bitbake-builds as top directory
("bitbake-setup settings --help" shows how to change it).

does not anymore include the bit in ( )
(RP pointed out that "bitbake-setup settings --help" doesn't actually
show that, but the newly added prints would address that)

Alex




On Thu, 13 Nov 2025 at 17:15, Joshua Watt via lists.openembedded.org
<JPEWhacker=gmail.com@lists.openembedded.org> wrote:
>
> If the top level directory look new (e.g. doesn't contain a site.conf
> file), then instruct the user on how to choose a different directory if
> they desire. This should help clarify what bitbake-setup is about to do
> and how to change it if desired.
>
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>  bin/bitbake-setup | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/bin/bitbake-setup b/bin/bitbake-setup
> index 3a281defa..b54e98ba2 100755
> --- a/bin/bitbake-setup
> +++ b/bin/bitbake-setup
> @@ -671,7 +671,16 @@ def create_siteconf(top_dir, non_interactive, settings):
>      if os.path.exists(siteconfpath):
>          print('A site.conf file already exists. Please remove it if you would like to replace it with a default one')
>      else:
> -        print('A common site.conf file will be created, please edit or replace before running builds\n    {}\n'.format(siteconfpath))
> +        print(f'{top_dir} looks like a new top directory. If you would like to use a different directory, answer "n" below and either:')
> +        print('\t1) Pass one or more options to bitbake-setup change the top level directory:')
> +        print('\t\tbitbake-setup --setting default top-dir-prefix <PATH> ...')
> +        print('\t\tbitbake-setup --setting default top-dir-name <NAME> ...')
> +        print('\t2) Change the default bitbake-setup configuration with:')
> +        print('\t\tbitbake-setup settings set default top-level-prefix <PATH>')
> +        print('\t\tbitbake-setup settings set default top-level-name <NAME>')
> +        print()
> +
> +        print('A common site.conf file will be created, please check it is correct before running builds\n    {}\n'.format(siteconfpath))
>          if not non_interactive:
>              y_or_n = input('Proceed? (y/N): ')
>              if y_or_n != 'y':
> --
> 2.51.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#18379): https://lists.openembedded.org/g/bitbake-devel/message/18379
> Mute This Topic: https://lists.openembedded.org/mt/116276734/1686489
> Group Owner: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 3a281defa..b54e98ba2 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -671,7 +671,16 @@  def create_siteconf(top_dir, non_interactive, settings):
     if os.path.exists(siteconfpath):
         print('A site.conf file already exists. Please remove it if you would like to replace it with a default one')
     else:
-        print('A common site.conf file will be created, please edit or replace before running builds\n    {}\n'.format(siteconfpath))
+        print(f'{top_dir} looks like a new top directory. If you would like to use a different directory, answer "n" below and either:')
+        print('\t1) Pass one or more options to bitbake-setup change the top level directory:')
+        print('\t\tbitbake-setup --setting default top-dir-prefix <PATH> ...')
+        print('\t\tbitbake-setup --setting default top-dir-name <NAME> ...')
+        print('\t2) Change the default bitbake-setup configuration with:')
+        print('\t\tbitbake-setup settings set default top-level-prefix <PATH>')
+        print('\t\tbitbake-setup settings set default top-level-name <NAME>')
+        print()
+
+        print('A common site.conf file will be created, please check it is correct before running builds\n    {}\n'.format(siteconfpath))
         if not non_interactive:
             y_or_n = input('Proceed? (y/N): ')
             if y_or_n != 'y':