Fix considering base path when ignoring known bad unix paths #2644
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2627
This updates the logic when considering paths to ignore/filter out during the indexing phase of the directory file resolver. Currently we ignore known common paths that mount to filesystems that provide no packages (e.g.
/dev
and/proc
). This currently doesn't consider cases when the filesystem being scanned isn't mounted at root (when there is abase-path
to consider). For example, when scanning/some/mount/path
and there is a path/some/mount/path/dev
, we should be considering that latter path during indexing to be/dev
. Ultimately the index value is correct, but filter functions do not have the option to observe the value ofbase-path
(i.e./some/mount/path
) to calculate the relative path of the target.This PR changes the behavior to allow filter functions to have access to
base-path
. We currently have some filter functions that need to consider the relative path and some that need to consider the real path, so a further-upstream-change of this function could not be made (that is, pass down the relative path into the filter functions).