-
Notifications
You must be signed in to change notification settings - Fork 59
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
Fix broken paths in default configuraiton on Unix #657
Conversation
The default paths for **FileSearch.Directories** and **SoundfontSearch.Directories** are somewhat broken. `SHARE_DIR` is defined as just `/usr/local/share/`. The paths `…/games/raze` are not added to **FileSearch.Directories**. `GAME_DIR` is defined as `.config/raze` on Unix. Combining it with the prefix `…/share/` is wrong. Excerpt from the default configuration: ```ini [FileSearch.Directories] … Path=/usr/local/share/ … [SoundfontSearch.Directories] … Path=/usr/local/share/.config/raze/soundfonts Path=/usr/local/share/games/.config/raze/soundfonts Path=/usr/share/.config/raze/soundfonts Path=/usr/share/games/.config/raze/soundfonts ```
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.
@Unrud I've added some comments to a few lines. If you don't mind please looking over them and remediating, we'd be appreciative.
@@ -133,7 +133,8 @@ FGameConfigFile::FGameConfigFile () | |||
SetValueForKey ("Path", "$GAMEDIR", true); | |||
#else | |||
SetValueForKey ("Path", "$HOME/" GAME_DIR, true); | |||
SetValueForKey ("Path", SHARE_DIR, true); | |||
SetValueForKey ("Path", "/usr/share/games/raze", true); | |||
SetValueForKey ("Path", "/usr/local/share/games/raze", true); |
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.
@Unrud for the paths that start /usr/local/share/
, can you please maintain the usage of the SHARE_DIR
macro?
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.
same
@@ -133,7 +133,8 @@ FGameConfigFile::FGameConfigFile () | |||
SetValueForKey ("Path", "$GAMEDIR", true); | |||
#else | |||
SetValueForKey ("Path", "$HOME/" GAME_DIR, true); | |||
SetValueForKey ("Path", SHARE_DIR, true); | |||
SetValueForKey ("Path", "/usr/share/games/raze", true); |
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.
@Unrud instead of hard coding Raze, can you please use the GAMENAMELOWERCASE
macro?
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.
I didn't use the macros for consistency They are not used in any of the other sections. IMHO it should be changed everywhere.
SetValueForKey("Path", "/usr/local/share/games/" GAME_DIR "/soundfonts", true); | ||
SetValueForKey("Path", "/usr/share/" GAME_DIR "/soundfonts", true); | ||
SetValueForKey("Path", "/usr/share/games/" GAME_DIR "/soundfonts", true); | ||
SetValueForKey("Path", "/usr/share/games/raze/soundfonts", true); |
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.
@Unrud can you please maintain the paths that don't have /games/
within?
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.
I left them out because paths without /games/
do not appear in any of the other sections. IMHO they should also be added everywhere.
What are really the problems here and what are the solutions actually trying to accomplish? To me this looks more like fixing a problem that doesn't exist by breaking things that already work. |
Change paths from something like /usr/share/games/.config/raze/soundfonts to /usr/share//games/raze/soundfonts. |
That isn't the right way to do things, at all. If you want to add a default search path it must be done additively, not take away from the ones that already exist. Please ensure to check mjr's comments as well. |
I'm not following you. The paths I modified/removed were obviously wrong. I doubt anyone uses the folder in
👌 |
I'm no expert on Unix/Linux systems but I do know one thing: standardizing the paths is an absolute a clusterfuck, even moreso with the absolute sheer number of possible distributions and combos available for each system. "Obviously wrong" is entirely subjective. Someone added them, at some point, and it's likely because there was a need for it at that point. So I am going to reject that argument on that basis alone. Any removals should go through a very thorough review and should not be arbitrarily removed by one person's pull request. |
If I may contribute some hopefully helpful insight, having an interest in seeing this improved myself, it's not all that subjective in practice. Specifications and conventions do exist and are defined, and most things chose to honour them. Most of them across unix flavors and Linux are additive on top the basic POSIX spec, which doesn't specify much. So while many things can be valid, some can just be outright against convention. For instance, by convention, which is codified in the File System Hierarchy Standard (FSH), this tidbit is listed:
And so, the idea is that configuration files placed in the user's
Neither of these specs are Linux-specific, or specific to any flavor of Unix either. /usr/share and /usr/local/share have defined purposes also, not just on Linux but on every Unix system, usually documented either by LSB hier(8), or the platform's hier(8) manpage, but they are, in this case, usually consistent: it's for shared, architecture independent, read only files and data used by applications. The LSB is somewhat more specific about it, and less useful for general cross platform support, but still indicates the general convention styles expected. And thus, in any case There is leeway in where you can store the game data system-wide, absolutely, but it should not be in a Hope this helps somewhat! |
The default paths for FileSearch.Directories and SoundfontSearch.Directories are somewhat broken.
SHARE_DIR
is defined as just/usr/local/share/
.The paths
…/games/raze
are not added to FileSearch.Directories.GAME_DIR
is defined as.config/raze
on Unix. Combining it with the prefix…/share/
is wrong.Excerpt from the default configuration: