| Message ID | 20251117194805.2322020-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 |
This doesn't apply on current master. I'll rebase and resend as part of further tweaks to address the remaining issues. Alex On Mon, 17 Nov 2025 at 20:48, 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 | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > > diff --git a/bin/bitbake-setup b/bin/bitbake-setup > index 3a281defa..7e9491fac 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': > @@ -896,7 +905,7 @@ def main(): > settings_func(top_dir, all_settings, args) > return > > - print('Bitbake-setup is using {} as top directory ("bitbake-setup settings --help" shows how to change it).\n'.format(top_dir, global_settings_path(args))) > + print('Bitbake-setup is using {} as top directory.\n'.format(top_dir, global_settings_path(args))) > > d = init_bb_cache(top_dir, all_settings, args) > args.func(top_dir, all_settings, args, d) > -- > 2.51.1 > > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#18436): https://lists.openembedded.org/g/bitbake-devel/message/18436 > 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] > -=-=-=-=-=-=-=-=-=-=-=- >
On Mon, 17 Nov 2025 at 20:48, Joshua Watt via lists.openembedded.org <JPEWhacker=gmail.com@lists.openembedded.org> wrote: > - 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>') I'm going to slightly tweak this: changing the default should come first, and 'Pass one or more options to bitbake-setup change the top level directory' is not good grammar. Alex
diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 3a281defa..7e9491fac 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': @@ -896,7 +905,7 @@ def main(): settings_func(top_dir, all_settings, args) return - print('Bitbake-setup is using {} as top directory ("bitbake-setup settings --help" shows how to change it).\n'.format(top_dir, global_settings_path(args))) + print('Bitbake-setup is using {} as top directory.\n'.format(top_dir, global_settings_path(args))) d = init_bb_cache(top_dir, all_settings, args) args.func(top_dir, all_settings, args, d)
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 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)