mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-02 21:06:16 +01:00
Merge branch 'xdg-config-home-fix' of https://github.com/hyperupcall/osc
Be a bit more compliant to the XDG base directory spec: "If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used." [1]. Now, if the $XDG_CONFIG_HOME env variable is empty, we use the default. [1] https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
This commit is contained in:
commit
820f7ce7e5
@ -1043,9 +1043,12 @@ def identify_conf():
|
|||||||
if 'OSC_CONFIG' in os.environ:
|
if 'OSC_CONFIG' in os.environ:
|
||||||
return os.environ.get('OSC_CONFIG')
|
return os.environ.get('OSC_CONFIG')
|
||||||
if os.path.exists(os.path.expanduser('~/.oscrc')):
|
if os.path.exists(os.path.expanduser('~/.oscrc')):
|
||||||
conffile = '~/.oscrc'
|
return '~/.oscrc'
|
||||||
|
|
||||||
|
if os.environ.get('XDG_CONFIG_HOME', '') != '':
|
||||||
|
conffile = os.environ.get('XDG_CONFIG_HOME') + '/osc/oscrc'
|
||||||
else:
|
else:
|
||||||
conffile = os.environ.get('XDG_CONFIG_HOME', '~/.config') + '/osc/oscrc'
|
conffile = '~/.config/osc/oscrc'
|
||||||
|
|
||||||
return conffile
|
return conffile
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user