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

Implement the XDG base directory specification properly #25

Merged
merged 1 commit into from
Oct 12, 2024

Conversation

zimward
Copy link

@zimward zimward commented Oct 11, 2024

Problem

Currently the search paths are hard coded, which leads to failing of the mime db if the system doesn't place it at the canonical location (for example nixos).
Looking into the XDG Base Directory Specification it states:

There is a set of preference ordered base directories relative to which data files should be searched. This set of directories is defined by the environment variable $XDG_DATA_DIRS.

Implementation

The tests all pass with this implementation (and should do so on all systems, as long as XDG_DATA_DIRS is properly set up. [citation needed] :) ). As home crate is also not needed anymore (as these paths should also be in the env var) it is therefore removed from the dependencies (Fixes: #22 ).

Copy link
Owner

@mbrubeck mbrubeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work! Just needs a few minor additions.

src/fdo_magic/builtin/runtime.rs Outdated Show resolved Hide resolved
src/fdo_magic/builtin/runtime.rs Outdated Show resolved Hide resolved
Copy link
Owner

@mbrubeck mbrubeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@mbrubeck mbrubeck merged commit ceeab00 into mbrubeck:mini Oct 12, 2024
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.

Don’t depend on home crate when with_gpl_data is enabled
2 participants