Feature Request: Add support for $HOME in/etc/spring/datadir

Feature Request: Add support for $HOME in/etc/spring/datadir

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
hollowsoul
Posts: 665
Joined: 06 Jun 2006, 19:49

Feature Request: Add support for $HOME in/etc/spring/datadir

Post by hollowsoul »

Currently u can set spring datadir via /etc/spring/datadir to point to datadir.

Any chance someone could check in if its easy enough to add support for global export VARIABLES i.e $HOME
So we can use the following

Code: Select all

/etc/spring/datadir
$HOME/.spring
That way no matter which user runs taspring it would point to /home/<user>/.spring

Idea is to use symlinks where possible to point to main install & copy over files / directorys that spring needs write access.

Currently Layout
  • aidll/globalai/<bots>
    base/spring
    demos
    docs
    gamedata
    maps/paths
    mods
    omni <havent checked if omni needs write access to which files yet >
    shaders
    startscripts

Below = proper directorys & symlink files where it makes sense
  • aidll/globalai/ - copied bot configs / directorys over
    demos
    maps/path
    mods
    uikeys.txt - copied file
    selectkeys.txt - copied file
Possible exception to bots as in to copy over entire configs & not use symlinks so user can edit them easier. Maybe add option for that in whatever script i come up with,

Reasons for this setup i can think of
1) Allow us to setup configs / logs / maps seperate to each user
2) Instead of plain copying all the files over & basicly installing taspring to each user. This wont eat up as much filespace
3) Only 4 directorys (that i checked quickly would need symlink files). Rest are symlinked directorys, where Spring only needs read access.
4) Users still have ability to remove symlinks & copy over the files if they want to & thus allowing them to alter game files & still not effect other users. No security risks etc..
5) Possible to leave a Version file with svn version number in /usr/share/games/taspring-linux-svn & use it for to check against to inform user a new install to update thier setup <need lookin into on best way to pull it off>

So i try out the above setup, & should be make a script to setup user's .spring directory without to much work.

Any constructive comments plz, or critics plz.

Recap = Anyone care to check if its quick & easy to fix|add support for $HOME variable in /etc/spring/datadir plz

Rest of my post was to explain my train of thought on why i am asking
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

I'll add environment var expansion as soon as I got a new CPU fan.. 8)

E: Note tho that it's either everything or nothing in a datadir. So in your example if the global datadir exists it won't even look at the $HOME datadir. So you probably want to swap them around or only put the $HOME one in it.

It's more work to modify the code to use all datadirs, but it's something that's planned..
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Just committed it. Use env vars as much as you like now in datadir paths :-)
Post Reply

Return to “Engine”