whitequark / rust-xdg

A library that makes it easy to follow the X Desktop Group specifications
https://wiki.freedesktop.org/www/Specifications/
Apache License 2.0
146 stars 29 forks source link

Is `list_config_files_once` stable? #37

Closed hxzhao527 closed 2 years ago

hxzhao527 commented 2 years ago

Now the method list_config_files_once impl: https://github.com/whitequark/rust-xdg/blob/c2921e01ad47759fdffcbd77cb7e595936b923ad/src/lib.rs#L728-L745

travel $HOME first.

But is it stable?

e.g. Autostart Directories depends on the travel order.

whitequark commented 2 years ago

Could you point out the part that would make it unstable?

hxzhao527 commented 2 years ago

emm, it is the travel order. Now it is implemented that list $HOME first, then config_dirs.

In document, https://github.com/whitequark/rust-xdg/blob/c2921e01ad47759fdffcbd77cb7e595936b923ad/src/lib.rs#L523-L525 it is not clear where is the first occurence.

whitequark commented 2 years ago

If I remember correctly, this function implements the following part of the XDG Base Directories spec:

The order of base directories denotes their importance; the first directory listed is the most important. When the same information is defined in multiple places the information defined relative to the more important base directory takes precedent. The base directory defined by $XDG_DATA_HOME is considered more important than any of the base directories defined by $XDG_DATA_DIRS. The base directory defined by $XDG_CONFIG_HOME is considered more important than any of the base directories defined by $XDG_CONFIG_DIRS.

(from Environment variables).

hxzhao527 commented 2 years ago

If I remember correctly, this function implements the following part of the XDG Base Directories spec:

The order of base directories denotes their importance; the first directory listed is the most important. When the same information is defined in multiple places the information defined relative to the more important base directory takes precedent. The base directory defined by $XDG_DATA_HOME is considered more important than any of the base directories defined by $XDG_DATA_DIRS. The base directory defined by $XDG_CONFIG_HOME is considered more important than any of the base directories defined by $XDG_CONFIG_DIRS.

(from Environment variables).

thanks. no more question.