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

respect XDG by default on posixlikes #8

Open
asottile opened this issue Dec 31, 2022 · 0 comments
Open

respect XDG by default on posixlikes #8

asottile opened this issue Dec 31, 2022 · 0 comments

Comments

@asottile
Copy link

👋 I'm down a bit of a rabbit hole -- let me explain first where I'm coming from and then my quick proposal

I am building a docker image which intentionally does not provide a writable home directory -- but instead provides a bunch of writable $XDG_... directories. I've noticed that cpan uses this module to determine where to write its configuration on first startup but File::HomeDir->my_data is always returning the home directory

I can work around this by installing xdg-user-dirs manually, or providing a placeholder executable by the same name -- but I don't think that executable should be necessary at all since most modern posixlikes support the XDG "standard"

personally, I would like to see the FreeDeskptop implementation be the default on posixlikes but that might be too aggressive of a change -- perhaps a more middle ground would be to have the default Unix implementation respect the $XDG_* variables even if the xdg-user-dirs executable isn't present (since it's kind of rare to install this in a docker image, even if you want the functionality)

the directories from xdg-user-dirs are also easily derivable without running the xdg-user-dir subprocess -- since they're specified: https://wiki.archlinux.org/title/XDG_user_directories

asottile added a commit to pre-commit-ci/runner-image that referenced this issue Dec 31, 2022
- libfile-homedir-perl: makes cpan respect XDG
- xdg-user-dirs: makes File::HomeDir respect XDG
- maybe one day I won't need the second: perl5-utils/File-HomeDir#8
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

No branches or pull requests

1 participant