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

POSIX: Follow XDG Base Directory Specification for User's Files #656

Merged
merged 8 commits into from Feb 2, 2016

Conversation

lordhoto
Copy link
Contributor

This patch makes our POSIX ports use locations for configuration, log, and save games conforming to the XDG Base Directory Specification version 0.8 (right now the latest version, which can be found here).

The new locations are as follows:

  • Configuration file is now placed at $XDG_CONFIG_HOME/scummvm/scummvm.ini
  • New default savegame directory is at $XDG_DATA_HOME/scummvm/saves/
  • The log file is now placed at $XDG_CACHE_HOME/scummvm/scummvm.log

We still use the old locations for the configuration file and the savegame directory if those exist from a previous ScummVM installation.

This 'fixes' bug #6036 POSIX: Use XDG dirs instead of HOME. There is some discussion on the bug report about using a more easily visible location for save files. If we want that, we should do go for it now instead of having to worry about it again later.

if (prefix) {
path = prefix;
path += '/';
path += dir;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any catches for '../../../'? Or these should be fine?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine, mkdir uses the CWD as base if the path is not absolute.

@sev-
Copy link
Member

sev- commented Feb 1, 2016

In general, I had a good impression, and think that this could make it to 1.8.0

@sev-
Copy link
Member

sev- commented Feb 2, 2016

OK, please update the patch (now it has conflicts) and merge.

Johannes Schickel added 2 commits February 2, 2016 08:45
This is kind of like 'mkdir -p' now. But the permissions are different from
standard POSIX behavior.
Johannes Schickel added 6 commits February 2, 2016 09:16
This makes use use the XDG Base Directory Specification for the log file path.
This tackles one part of bug #6036 "POSIX: Use XDG dirs instead of HOME".
…/scummvm.ini'.

This is what the XDG Base Directory Specification suggests to use. We still
use the old location of '~/.scummvmrc' in case that is present.

This tackles an aspect of bug #6036 "POSIX: Use XDG dirs instead of HOME".
This is what the XDG Base Directory Specification suggests to use. We still
use ~/.scummvm as default path in case the directory exists.

This tackles an aspect of bug #6036 "POSIX: Use XDG dirs instead of HOME".
lordhoto added a commit that referenced this pull request Feb 2, 2016
POSIX: Follow XDG Base Directory Specification for User's Files
@lordhoto lordhoto merged commit d88b1c9 into scummvm:master Feb 2, 2016
@lordhoto lordhoto deleted the xdg-dirs-posix branch February 28, 2016 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants