Browse Source

🛠 Replace lib_deps for custom_marlin.FEATURE (#20858)

vanilla_fb_2.0.x
Scott Lahteine 3 years ago
committed by GitHub
parent
commit
a54154e760
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      buildroot/share/PlatformIO/scripts/common-dependencies.py

19
buildroot/share/PlatformIO/scripts/common-dependencies.py

@ -69,16 +69,23 @@ def add_to_feat_cnf(feature, flines):
except:
FEATURE_CONFIG[feature] = {}
# Get a reference to the FEATURE_CONFIG under construction
feat = FEATURE_CONFIG[feature]
atoms = re.sub(',\\s*', '\n', flines).strip().split('\n')
for dep in atoms:
parts = dep.split('=')
# Split up passed lines on commas or newlines and iterate
# Add common options to the features config under construction
# For lib_deps replace a previous instance of the same library
atoms = re.sub(r',\\s*', '\n', flines).strip().split('\n')
for line in atoms:
parts = line.split('=')
name = parts.pop(0)
rest = '='.join(parts)
if name in ['build_flags', 'extra_scripts', 'src_filter', 'lib_ignore']:
feat[name] = rest
feat[name] = '='.join(parts)
else:
feat['lib_deps'] += [dep]
for dep in line.split(','):
lib_name = re.sub(r'([@~^=]|[<>]=?)[\d.]+', '', dep.strip()).split('=').pop(0)
lib_re = re.compile('(?!^' + lib_name + '\\b)')
feat['lib_deps'] = list(filter(lib_re.match, feat['lib_deps'])) + [dep]
def load_config():
config = configparser.ConfigParser()

Loading…
Cancel
Save