diff --git a/repos_cmp/repos.py b/repos_cmp/repos.py index b45a3d0..74918a3 100644 --- a/repos_cmp/repos.py +++ b/repos_cmp/repos.py @@ -435,12 +435,15 @@ def _is_build_kind(kind): class BuildReporter: - def __init__(self, from_repo, to_repo, ignore=(), prefer=(), caching=True): + def __init__(self, from_repo, to_repo, + ignore=(), prefer=(), + caching=True, ignore_file_deps=False): self.from_repo = from_repo self.to_repo = to_repo self.ignore = ignore self.prefer = prefer self._cache = {} if caching else None + self.ignore_file_deps = ignore_file_deps self._warned_on = set() def _warn(self, text, subject): @@ -506,6 +509,10 @@ class BuildReporter: # skip some platform-specific stuff if any(x in dep.name for x in _SPECIAL_DEPS): continue + # ignore file dependencies if we're asked to + if self.ignore_file_deps and not _is_build_kind(kind): + if dep.name.startswith(b'/'): + continue # skip dependencies already present in to_repo if any(self.to_repo.providers(dep)): continue