-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
Also load portals from XDG_DATA_DIRS #1561
base: main
Are you sure you want to change the base?
Conversation
5efb882
to
c0322a2
Compare
I really would want to have tests for the configs. With the pytest setup we currently have, we can only test config in $HOME but we could modify things for this test to launch x-d-p in a new mount namespace with Is that something you could look into? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reserving judgement on whether this is a desired feature or not (other maintainers might have an opinion on that, I think it's a reasonable thing to want):
If x-d-p is going to look in more than one directory, then I think it should remember all the filenames that it has already seen, and ignore any file of the same name in the lower-precedence directories. (Probably easiest done with a global hash table.)
if(dir_set_from_env) | ||
return | ||
|
||
const char * const *dirs = g_get_system_data_dirs (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're going to load from XDG_DATA_DIRS
then we should also try XDG_DATA_HOME
, for completeness and to be consistent with the basedir spec.
If we do this, please only do it as additional test coverage, and not as the only way some other thing gets tested. Linux distributions' autobuilders usually can't create new mount namespaces so this would have to be skipped. |
Alternative to unshare for testing: introduce environment variables that overwrites the "system" dirs. Should work everywhere then at least. |
Addresses issue #603. The only place it searches for portals is the
DATADIR
orXDG_DESKTOP_PORTAL_DIR
, but ifXDG_DESKTOP_PORTAL_DIR
is set, then it doesn't read configuration files.This is a problem because any system that doesn't follow the FHS must set
XDG_DESKTOP_PORTAL_DIR
for it to find the portals, but then can't load any configuration files which leaves everything broken. A simple solution is to search all the directories inXDG_DATA_DIRS
.