Updates for incdirs

This commit is contained in:
Byron Lathi
2025-03-20 22:38:04 -07:00
parent 7801876c85
commit b8cd278cf1
2 changed files with 21 additions and 21 deletions

View File

@@ -35,7 +35,7 @@ name = "rtl-manifest" # REQUIRED, is the only field that cannot be marked as dy
# https://packaging.python.org/guides/single-sourcing-package-version/
# dynamic = ["version"]
version = "0.3.0" # REQUIRED, although can be dynamic
version = "0.3.1" # REQUIRED, although can be dynamic
# This is a one-line description or tagline of what your project does. This
# corresponds to the "Summary" metadata field:

View File

@@ -34,9 +34,8 @@ def parse(source_file: str) -> Tuple[List[str], List[str]]:
files = []
incdirs = []
def _recursive_parse(source_file: str):
base_dir = pathlib.Path(source_file).parent
with open(source_file, "r") as file:
for line in file:
path = line.strip()
@@ -46,14 +45,15 @@ def parse(source_file: str) -> Tuple[List[str], List[str]]:
continue
if path.startswith("`include "):
abs_path = pathlib.Path(base_dir / path.split()[1]).absolute()
incdirs.append(abs_path)
incdirs.append(str(abs_path))
continue
if (path.endswith("sources.list")):
new_path = pathlib.Path(base_dir) / path
for recursive_path in parse(new_path):
files.append(recursive_path)
_recursive_parse(new_path)
else:
abs_path = pathlib.Path(base_dir / path).absolute()
files.append(str(abs_path))
_recursive_parse(source_file)
return files, incdirs