Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added prefix filtering support #177

Merged
merged 1 commit into from
Feb 14, 2022

Conversation

virchau13
Copy link
Contributor

Added a way to only put paths starting with a certain prefix into the database, through a --filter-prefix flag. Should resolve #176, and is a way to solve NixOS/nixpkgs#39789.

--filter-prefix <PREFIX>    Only add paths starting with PREFIX (e.g. `/bin/`)

Some typos were also fixed.

@bennofs
Copy link
Collaborator

bennofs commented Feb 14, 2022

Thanks!

@bennofs bennofs merged commit e588599 into nix-community:master Feb 14, 2022
@wmertens
Copy link

Shouldn't this allow multiple paths? /bin and /sbin?

And this cannot be used to find .desktop files for something like a registry of all gui packages available, but maybe that would just use the entire index.

In any case, all those use cases could be covered with a regex match

@bennofs
Copy link
Collaborator

bennofs commented Feb 15, 2022

That's a good idea. I don't have much time right now to work on this but if anyone wants to replace the prefix filter by regex I am happy to review the changes.

@virchau13
Copy link
Contributor Author

virchau13 commented Feb 15, 2022

Yes... a regex match would probably be better, lol. I implemented it this way mainly as a benchmark for nixpkgs#39789, and also because the change is so simple that it's hard to get wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Speed up searches for bin/paths
3 participants