diff --git a/buildroot/share/PlatformIO/scripts/configuration.py b/buildroot/share/PlatformIO/scripts/configuration.py index 64f73d0dcf..aed9fc2f3d 100644 --- a/buildroot/share/PlatformIO/scripts/configuration.py +++ b/buildroot/share/PlatformIO/scripts/configuration.py @@ -78,8 +78,8 @@ def apply_opt(name, val, conf=None): elif not isdef: break linenum += 1 - lines.insert(linenum, f"{prefix}#define {added} // Added by config.ini\n") - fullpath.write_text('\n'.join(lines), encoding='utf-8') + lines.insert(linenum, f"{prefix}#define {added:30} // Added by config.ini\n") + fullpath.write_text(''.join(lines), encoding='utf-8') # Fetch configuration files from GitHub given the path. # Return True if any files were fetched. @@ -127,7 +127,7 @@ def apply_ini_by_name(cp, sect): iniok = False items = section_items(cp, 'config:base') + section_items(cp, 'config:root') else: - items = cp.items(sect) + items = section_items(cp, sect) for item in items: if iniok or not item[0].startswith('ini_'): @@ -195,8 +195,12 @@ def apply_config_ini(cp): fetch_example(ckey) ckey = 'base' - # Apply keyed sections after external files are done - apply_sections(cp, 'config:' + ckey) + elif ckey == 'all': + apply_sections(cp) + + else: + # Apply keyed sections after external files are done + apply_sections(cp, 'config:' + ckey) if __name__ == "__main__": #