This discussion started in another topic, but I guess it deserves its own
Em quinta-feira, 29 de março de 2012 15h54min09s UTC-3, Phil Bordelon escreveu:
On 03/29/2012 01:17 PM, MestreLion wrote:
> No apologies needed. You already said you were OK with those changes, and
> we agreed about *how* those changes should be presented/published/merged.
> As for *when*, it doesn't matter to me, so take your time.I merged fix_events_translating, respect_singledir, and
translation_pt_BR. I'm still a little leery of the XDG patches,
particularly the one that does some funny things with symlinks.
Lol, that is fine. They were the last merges in "master" for a reason ;)
There
are very verbose comments in both commit messages and code about how
they work, but here is some "inside info" that may help clarify a few
things:
- If ~/.endgame exists, no xdg dir will be used. ever.
period. I swear. :) This only affects new, fresh installs. I will also
/not/ move files over to the new location. The only way for a user to
"benefit" from xdg changes is to delete his current ~/.endgame dir.
-
XDG_CONFIG_HOME and XDG_DATA_HOME will only be used /if they already
exist/. So, if the user does not already have a ~/.config and
~/.local/share, E:S will not be the first to create them, and default
~/.endgame is used instead. XDG spec allows an app to create them
(actually it /requires/ this), but I wasn't bold enough to.
-
There are 2 main motivations for using xdg: first, to un-clutter the
user's home dir. I don't know about you, but hate to hit CTRL+H in
Nautilus and see literally /dozens/ of config dirs and files. For stuff
~/.bashrc or ~/.ssh/ it's ok, afterall this is a 20+ years tradition I
won't fight against. But E:S is a desktop, modern game. All (or most)
Gnome and KDE apps are already in ~/.config, no reason for E:S to act
like a legacy app.
- The other reason is conformity: the package
name is singularity (in Ubuntu, Debian, Fedora, Arch), the main .py file
is singularity, why the config folder is ~/.endgame?
- Ok, you
bought the ~/.endgame -> ~/.config/singularity idea. Now we have a
problem: XDG spec enforces that only user *configuration* should be
placed there. No data files, no cache files, and certainly no music
files either. For that, they have a /data/ home dir. So the proper place
for music is ~/.local/share/singularity/music.
- But that sucks:
~/.local/share/ is kind of an obscure dir. And user may be used to put
music in E:S config dir/music. Hell, E:S even *creates* that empty dir
as a "hint" for the user that he can place music files there. He will
/never/ look into ~/.local/share, so creating empty dir there is useless
as a hint, and users might dislike not having everything under a single
dir.
Hence the symlink ;)
- Of course, if configdir/music already exists (either at ~/.config/singularity or ~/.endgame), no symlink will be created. And again, files will /not/ be moved over. Symlink is for fresh installs only, and it is still just a hint for the proper location, like before.
- E:S will read from 3 places: "game dir"/music, "xdg_data"/music and "config dir"/music. But it will be smart enough not to read from last one if it is a symlink to the previous, to avoid duplicates in music list.
XDG conformity, 100% backward compatibility, "everything under a single dir" from user perspective, read from everywhere with no dupes. Many pros, and the only "con" I can see is the (I admit) "funny things with symlinks"
ML