Handle dependencies like 'a | b' in buildorder.py

This commit is contained in:
Fredrik Fornwall 2018-06-16 22:50:06 +02:00
parent 999ef72856
commit 11c80acb01

View File

@ -53,10 +53,13 @@ def parse_build_file_dependencies(path):
for char in "\"'\n": for char in "\"'\n":
dependencies_string = dependencies_string.replace(char, '') dependencies_string = dependencies_string.replace(char, '')
for dependency_value in dependencies_string.split(','): # Split also on '|' to dependencies with '|', as in 'nodejs | nodejs-current':
for dependency_value in re.split(',|\\|', dependencies_string):
# Replace parenthesis to ignore version qualifiers as in "gcc (>= 5.0)": # Replace parenthesis to ignore version qualifiers as in "gcc (>= 5.0)":
dependency_value = re.sub(r'\(.*?\)', '', dependency_value).strip() dependency_value = re.sub(r'\(.*?\)', '', dependency_value).strip()
# Handle dependencies on *-dev packages:
dependency_value = re.sub('-dev$', '', dependency_value) dependency_value = re.sub('-dev$', '', dependency_value)
dependencies.append(dependency_value) dependencies.append(dependency_value)
return set(dependencies) return set(dependencies)