patchFreeciv - Patches: patch #4387, Store client options inside...

 
 
Show feedback again

patch #4387: Store client options inside .freeciv/

Submitted by:  Marko Lindqvist <cazfi>
Submitted on:  Thu 02 Jan 2014 04:31:27 AM UTC  
 
Category: clientPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Planned Release: 2.6.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sun 23 Mar 2014 02:11:38 AM UTC, SVN revision 24714:

Save client options file inside .freeciv -directory.

See patch #4387

(Browse SVN revision 24714)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Tue 18 Mar 2014 12:24:17 AM UTC, comment #12:

Since there has been no patch to promote XDG solution, I'm back to my original patch.

Updated against current svn. Consider this commit candidate.

(file #20372)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Tue 14 Jan 2014 04:41:44 AM UTC, comment #11:

> I can cook up a patch if needed.


I'm still not saying we're going that way, but the patch should be easy to do (not too fancy at first, just for testing this simple case) and it itself could speak for itself - I'd like to test such a thing on different builds before deciding if it's a good idea or not.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 05 Jan 2014 03:20:39 AM UTC, comment #10:

> Hmm, I don't notice anything explicit in the base directory
> spec requiring symlinks -- is it an implied requirement?


Could be just internal detail to their implementation (even that though they have moved files to XDG mandated places, they also keep them available from old locations via symlinks for backward compatibility)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sat 04 Jan 2014 12:13:37 PM UTC, comment #9:

(Since we're discussing the XDG directory spec here) another thing that makes me a bit uneasy about using that for Freeciv is that it mandates a default fallback to a system-wide directory (under /etc/xdg) for config.
I'm not sure that's appropriate for .freeciv-client-rc, although I can't quite articulate why. I like the current property of being able to blow it away from my home directory and restore factory configuration without having to go on a hunt to determine which system-wide files and environment variables might be changing my experience from the developer default (e.g. when reporting bugs upstream), and I'm struggling to see many realistic applications for a system-wide client RC.

> Windows build problems with new fontconfig-2.11.0 seem to be
> caused by new XDG compliance code... XDG requiring working
> symlinks, to be exact.

Hmm, I don't notice anything explicit in the base directory spec requiring symlinks -- is it an implied requirement? Or could it be a different XDG spec? -- fontconfig is a freedesktop.org (fka XDG) project, after all.

Jacob Nevins <jtn>
Project Administrator
Sat 04 Jan 2014 08:03:44 AM UTC, comment #8:

Just a quick note that I've tried to get fontconfig in crosser (cross-compilation to windows) updated. While going through fontconfig mailing lists to see if the problems I'm encountering are already reported, I notice how all the Windows build problems with new fontconfig-2.11.0 seem to be caused by new XDG compliance code... XDG requiring working symlinks, to be exact.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Thu 02 Jan 2014 10:42:37 PM UTC, comment #7:

> For Windows, [...] or the current Freeciv code is used instead
> to find a sensible default.

Aside: Freeciv's current default behaviour on Windows is not sensible, as noted in bug #20738 and friends. Possibly any separation into config/state/cache would benefit Windows too.

Jacob Nevins <jtn>
Project Administrator
Thu 02 Jan 2014 09:57:12 PM UTC, comment #6:

For Windows, I think the scheme can be adapted easily. Indeed, on XDG-compliant systems, either $XDG_CONFIG_HOME is set and the program uses it, or it uses ~/.config instead. For Windows, the same logic could be used, either $XDG_CONFIG_HOME is set and the program uses it, or the current Freeciv code is used instead to find a sensible default. Same thing for the other XDG variables, assuming we need them.

Guillaume Melquiond <silene>
Thu 02 Jan 2014 08:07:57 PM UTC, comment #5:

I'm getting quite undecided about this, so patch probably waits a bit.

- You're right we don't want to move file to one place now, and another place later, with backward compatibility code then searching all the places it has ever been. We want the file to go directly to correct place.
- As for partially supporting XDG that sounds like rather confusing situation. After seeing all our other files in .freeciv user would expect also client settings to be there, and not in XDG directory. And the other way around, user who sees our files in XDG directories would expect all our files to comply. But slowly moving files to be more and more XDG compliant is probably still the best way to go forward with XDG compliance if we target it.
- I wanted all the files in one directory, XDG defines separate directories for different kinds of files. Still, system where I want files to place other than under home dir, has to do it for all similar files, so XDG would point to sensible place. No need to configure freeciv separately.
- What this means for our Windows port? We have already had hard time making sensible choices what is considered user home dir etc. Playing with env variables is not very Windows.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Thu 02 Jan 2014 03:49:50 PM UTC, comment #4:

You make it sound like an all-or-nothing situation. I'm not suggesting to fully support XDG at once (nor ever). I am just suggesting that, instead of moving from ~/.freeciv-client-rc-2.6 to ~/.freeciv/freeciv-client-rc-2.6, you move to $XDG_CONFIG_HOME/freeciv/freeciv-client-rc-2.6 (that is, ~/.config/freeciv/freeciv-client-rc-2.6 on any standard setup).

Whatever is decided for other parts of Freeciv is orthogonal, you can decide whether you want to follow XDG or not at the time you decide to move other files around. But, at least for configuration files, I don't see any reason not to follow this standard.

As for configuring a writable directory on a non-writable setup, assuming I correctly understand what you mean, I think the XDG specification is well-suited. Indeed, the specification states that, if a configuration file is not found in the user home (or whatever $XDG_CONFIG_HOME points to), it is looked for in $XDG_CONFIG_DIRS (e.g. /etc). Which means that you can just put a default configuration in a $XDG_CONFIG_DIRS location (non-writable) and have this configuration points to whichever writable location you want.

Guillaume Melquiond <silene>
Thu 02 Jan 2014 03:12:48 PM UTC, comment #3:

In principle I'd like to follow standard when there's no reason not to, but as jtn said the transition would require significant work (especially scenarios directory that is supposed to be shared between past and future versions). Every now and then I have considered making it goal of next release, but there has always been more important things.
That said, original reason for this particular patch was to get client settings file inside same directory most other freeciv files are in - cleaning home dir is only the additional immediate benefit. For supporting setups where boot media is not writable, I'd want to have just one writable directory location easily configurable. I'm not sure how well XDG would work in that respect.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Thu 02 Jan 2014 11:06:09 AM UTC, comment #2:

Use of XDG .config and .local has been discussed/suggested a couple of times before (e.g. Aug 2010, May 2013).

(Instinctively I don't like it for some reason, but I haven't tried to work out why that is. The transition would be quite hard to manage well, I think.)

Jacob Nevins <jtn>
Project Administrator
Thu 02 Jan 2014 10:47:57 AM UTC, comment #1:

Would it be possible to convince you to use the XDG specification [1] rather than hardcoding the configuration directory? This specification has now been the de facto standard for several years and it would be unfortunate if Freeciv was not following it.

For most people, the consequence would be that files would not be stored under $HOME/.freeciv but under $HOME/.config/freeciv. (This greatly helps reducing the clutter under $HOME.)

I can cook up a patch if needed.

[1] http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

Guillaume Melquiond <silene>
Thu 02 Jan 2014 04:31:27 AM UTC, original submission:

To reduce user homepage pollution, put client settings file inside .freeciv -directory. As the directory itself has leading dot, do not have it in settings file too.
Search for old settings files includes 2.6 file from old location.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #19611:  ClientOptionsSubdir.patch added by cazfi (6kB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jtn (Posted a comment)
  • -unavailable- added by silene (Posted a comment)
  • -unavailable- added by cazfi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 23 Mar 2014 02:11:47 AM UTCcazfiStatusReady For Test=>Done
      Assigned toNone=>cazfi
      Open/ClosedOpen=>Closed
    Tue 18 Mar 2014 12:24:17 AM UTCcazfiAttached File-=>Added ClientOptionsSubdir-2.patch, #20372
    Thu 02 Jan 2014 04:31:27 AM UTCcazfiAttached File-=>Added ClientOptionsSubdir.patch, #19611
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup