Browse Source

🔨 Fix config.ini custom items, and 'all' (#24720)

ButchMonkey 1 year ago
parent
commit
c46ed8f57d
No account linked to committer's email address
1 changed files with 9 additions and 5 deletions
  1. 9
    5
      buildroot/share/PlatformIO/scripts/configuration.py

+ 9
- 5
buildroot/share/PlatformIO/scripts/configuration.py View File

@@ -78,8 +78,8 @@ def apply_opt(name, val, conf=None):
78 78
                 elif not isdef:
79 79
                     break
80 80
                 linenum += 1
81
-            lines.insert(linenum, f"{prefix}#define {added} // Added by config.ini\n")
82
-            fullpath.write_text('\n'.join(lines), encoding='utf-8')
81
+            lines.insert(linenum, f"{prefix}#define {added:30} // Added by config.ini\n")
82
+            fullpath.write_text(''.join(lines), encoding='utf-8')
83 83
 
84 84
 # Fetch configuration files from GitHub given the path.
85 85
 # Return True if any files were fetched.
@@ -127,7 +127,7 @@ def apply_ini_by_name(cp, sect):
127 127
         iniok = False
128 128
         items = section_items(cp, 'config:base') + section_items(cp, 'config:root')
129 129
     else:
130
-        items = cp.items(sect)
130
+        items = section_items(cp, sect)
131 131
 
132 132
     for item in items:
133 133
         if iniok or not item[0].startswith('ini_'):
@@ -195,8 +195,12 @@ def apply_config_ini(cp):
195 195
             fetch_example(ckey)
196 196
             ckey = 'base'
197 197
 
198
-        # Apply keyed sections after external files are done
199
-        apply_sections(cp, 'config:' + ckey)
198
+        elif ckey == 'all':
199
+            apply_sections(cp)
200
+
201
+        else:
202
+            # Apply keyed sections after external files are done
203
+            apply_sections(cp, 'config:' + ckey)
200 204
 
201 205
 if __name__ == "__main__":
202 206
     #

Loading…
Cancel
Save