Jason Tackaberry wrote:
> Can someone plleeease fix the whole cache dir situation in freevo 1.x?
> Setting OS_CACHEDIR or FREEVO_CACHEDIR in local_conf.py is pointless
> because it gets created in config.py before local_conf.py gets
> evaluated. The best solution I can come up with is
> symlinking /var/cache/freevo where I want it to be, and that's so lame.
>
> Jason.
It gets set in config.py which of course processes local_conf.py, I
noticed that it just creates an empty /var/cache/freevo directory when
set FREEVO_CACHEDIR is set in local_conf.py.
This patch uses the environment variables OS_CACHEDIR and
FREEVO_CACHEDIR to override the defaults.
Let me know if this is what you want before I commit it.
Duncan
Index: src/config.py
===================================================================
--- src/config.py (revision 8793)
+++ src/config.py (working copy)
@@ -386,12 +386,20 @@
#
# Under Linux, use /var/cache. Under FreeBSD, use /var/db.
#
-if os.uname()[0] == 'FreeBSD':
+if os.environ.has_key('OS_CACHEDIR'):
+ OS_CACHEDIR = os.environ['OS_CACHEDIR']
+elif os.uname()[0] == 'FreeBSD':
OS_CACHEDIR = '/var/db'
else:
OS_CACHEDIR = '/var/cache'
+print 'OS_CACHEDIR:', OS_CACHEDIR
-FREEVO_CACHEDIR = OS_CACHEDIR + '/freevo'
+if os.environ.has_key('FREEVO_CACHEDIR'):
+ FREEVO_CACHEDIR = os.environ['FREEVO_CACHEDIR']
+else:
+ FREEVO_CACHEDIR = OS_CACHEDIR + '/freevo'
+
+print 'FREEVO_CACHEDIR:', FREEVO_CACHEDIR
if not os.path.isdir(FREEVO_CACHEDIR):
try:
os.makedirs(FREEVO_CACHEDIR)
Duncan
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel