[mythtv] [PATCH] Add support for specifying directory to use for configuration

Jeremiah Morris jm at whpress.com
Sun Feb 13 01:49:23 UTC 2005


On Feb 12, 2005, at 7:32 PM, Nathan Neulinger wrote:

> This patch adds a global named "relative_conf_dir" to mythcontext, and 
> uses
> that instead of the hardwired .mythtv everywhere.

While there may be other ways to solve your specific problem, I think 
that avoiding the hardwired path is a great idea -- centralizing the 
hardcoded paths is good design IMHO. I've been wanting to do this in 
order to change the default by platform, so this directory can live in 
the expected preferences location on Mac OS X machines. Another use 
might be the opposite of what you want: allow multiple users to share a 
central mysql.txt and themecache, without having to create symlinks in 
everyone's home directory.

I'd suggest a few changes in the implementation, to better match the 
existing code:

- Instead of a global variable (especially one without a "g" or other 
prefix to make it obvious), just add a MythContext method, similar to 
GetShareDir() -- maybe GetConfDir().

- Allow absolute paths instead of confining it to the home directory. 
You can always set it to "$HOME/.mythtv-fullscreen" or whatever, but it 
should be more flexible.

- MythContext accepts an environment variable to change the install 
prefix (used by GetShareDir() and others), so perhaps the conf dir 
should be set by an environment variable too. That way, you don't have 
to add separate patches for mythfrontend, setup, etc.

With these changes, I'd support the addition of such a feature.

- Jer

P.S. Style comment: please keep lines wrapped to 80 characters, and 
convert all tabs to spaces before making a patch.



More information about the mythtv-dev mailing list