bitbake-setup: Add strip to value from settings.conf
PATCH v3 1/1 bitbake-setup: Add strip to value from settings.conf
If user add "" to dl-dir as DL_DIR, it will show FetchError as following.
raise FetchError("Unable to fetch URL from any source.", u)
bb.fetch2.FetchError: Fetcher failure for URL: 'git://git.openembedded.org/bitbake;protocol=https;rev=master;branch=master;destsuffix=bitbake'. Unable to fetch URL from any source.
But from this log, user can't locate the real reason which is that the path "/aa/bb" is invalid.
So I make this fix, even if user add "" to dl-dir, the dl-dir will be the valid path. Other settings value also need this fix.
--- bin/bitbake-setup | 6 ++++++ 1 file changed, 6 insertions(+)
bin/bitbake-setup +6 -0
@@ -920,6 +920,12 @@ def load_settings(settings_path): if os.path.exists(settings_path): logger.info('Loading settings from {}'.format(settings_path)) settings.read_file(open(settings_path)) + + for section in settings.sections(): + for key in settings[section]: + value = settings[section][key] + settings[section][key] = value.strip('\"\'') + return settings def change_setting(top_dir, args):
Signature · 1 line
2.43.0
bin/bitbake-setup def load_settings(settings_path): · line 927
Quoted 4 lines · Yiding Liu (Fujitsu) via lists.openembedded.org
bin/bitbake-setup +4
-0+ for section in settings.sections(): + for key in settings[section]: + value = settings[section][key] + settings[section][key] = value.strip('\"\'')
I think this can be simplified further:
for section in settings.sections():
for key, value in settings[section].items():
settings[section][key] = value.strip('\"\'')
Otherwise, looks good.
Alex