jhbuild r2503 - in trunk: . jhbuild/utils



Author: fpeters
Date: Tue Nov 11 13:08:01 2008
New Revision: 2503
URL: http://svn.gnome.org/viewvc/jhbuild?rev=2503&view=rev

Log:
* jhbuild/utils/httpcache.py: respect XDG_CACHE_HOME for cached
modulesets.  (closes: #560092, patch by James Sharpe)



Modified:
   trunk/ChangeLog
   trunk/jhbuild/utils/httpcache.py

Modified: trunk/jhbuild/utils/httpcache.py
==============================================================================
--- trunk/jhbuild/utils/httpcache.py	(original)
+++ trunk/jhbuild/utils/httpcache.py	Tue Nov 11 13:08:01 2008
@@ -68,7 +68,11 @@
         self.expires = expires
 
 class Cache:
-    cachedir = os.path.join(os.environ['HOME'], '.jhbuild', 'cache')
+    try:
+        cachedir = os.path.join(os.environ['XDG_CACHE_HOME'], 'jhbuild')
+    except KeyError:
+        cachedir = os.path.join(os.environ['HOME'], '.cache','jhbuild')
+
     # default to a 6 hour expiry time.
     default_age = 6 * 60 * 60
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]