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

move to xdg base directory specification #1723

Closed
totaam opened this issue Dec 13, 2017 · 8 comments
Closed

move to xdg base directory specification #1723

totaam opened this issue Dec 13, 2017 · 8 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Dec 13, 2017

Issue migrated from trac ticket # 1723

component: platforms | priority: major | resolution: fixed

2017-12-13 16:37:43: antoine created the issue


Now that we've moved sockets and log files to $XDG_RUNTIME_DIR (see #1129), we could move the config files to $XDG_CONFIG_HOME (.config/.

We will probably have to support the old location for quite some time, if not indefinitely.
We can load the old location first, then override with the new one - if any are present.

@totaam
Copy link
Collaborator Author

totaam commented Dec 13, 2017

2017-12-13 16:40:02: antoine changed status from new to assigned

@totaam
Copy link
Collaborator Author

totaam commented Dec 13, 2017

2017-12-13 16:40:02: antoine edited the issue description

@totaam
Copy link
Collaborator Author

totaam commented Jun 27, 2018

2018-06-27 10:27:30: antoine changed status from assigned to new

@totaam
Copy link
Collaborator Author

totaam commented Jun 27, 2018

2018-06-27 10:27:30: antoine changed owner from antoine to maxmylyn

@totaam
Copy link
Collaborator Author

totaam commented Jun 27, 2018

2018-06-27 10:27:30: antoine commented


Specification: XDG Base Directory Specification.

Done in r19741, we now look for paths:

  • the html5 client in XDG_DATA_DIRS + xpra/www (typically: /usr/local/share/xpra/www or /usr/share/xpra/www})
  • same for xpra resources (icons, etc), ie: .. /xpra/icons
  • ppd filters in XDG_DATA_DIRS + some subdirs thereof
  • xpra user config files in XDG_CONFIG_HOME, typically: ~/.config/xpra, we still load the legacy location ~/.xpra/ if it exists for backwards compatibility
  • we no longer write sockets or log files in ~/.xpra - though this can be re-enabled with XPRA_LEGACY_DOTXPRA=1
  • the system-wide config files are loaded from /etc/xpra / /usr/local/etc/xpra and the new XDG_CONFIG_DIRS (typically /etc/xdg/xpra - but the packaging has not been changed so we still use /etc/xpra, I expect too much breakage with third party packaging if we moved to /etc/xdg/xpra right away.

Note: by being more "standards compliant", the behaviour may have changed slightly in some cases: we may load files from /usr/local if they exist whereas we would not have done so previously. This should not be a problem in most cases, as only custom installations place files there.

New output from the paths script:

$ ./xpra/platform/paths.py 
* app
  - default
    - dir                         : /usr/share/xpra
* default_conf
  - dirs                          : []
* download
  - dir                           : ~/Downloads
* home                            : /home/antoine
* icons                           : /usr/share/xpra/icons
* install
  - prefix                        : /usr
* libexec
  - dir                           : /usr/libexec/
* log
  - dirs                          : /run/user/$UID/xpra, /tmp
* mmap
  - dir                           : /run/user/$UID/xpra
* nodock_command                  : xpra
* resources                       : /usr/share/xpra
* socket
  - dirs                          : /run/user/$UID/xpra, /run/xpra
* sound_command                   : xpra
* sshpass_command                 : /usr/bin/sshpass
* system_conf
  - dirs                          : /etc/xpra, /usr/local/etc/xpra, /etc/xdg/xpra
* user_conf
  - dirs                          : ~/.xpra, ~/.config/xpra
* xpra-tmp
  - dir                           : /run/user/$UID/xpra/tmp

We can now nuke ~/.xpra and it should never be re-created by running the client or the server.

Some code and scripts may still look for files there, but they should all continue to work without.
(this does not apply to versions older than 0.17 which only look for run-xpra in ~/.xpra by default - but those have been EOL for a while now, see #1129#comment:8)

@maxmylyn: FYI, feel free to close.

@totaam
Copy link
Collaborator Author

totaam commented Jun 27, 2018

2018-06-27 17:21:03: maxmylyn changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Jun 27, 2018

2018-06-27 17:21:03: maxmylyn set resolution to fixed

@totaam
Copy link
Collaborator Author

totaam commented Jun 27, 2018

2018-06-27 17:21:03: maxmylyn commented


Noted and closing.

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