summaryrefslogtreecommitdiff
path: root/giscanner/cachestore.py
diff options
context:
space:
mode:
Diffstat (limited to 'giscanner/cachestore.py')
-rw-r--r--giscanner/cachestore.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/giscanner/cachestore.py b/giscanner/cachestore.py
index 0dbf1fb8..351bac38 100644
--- a/giscanner/cachestore.py
+++ b/giscanner/cachestore.py
@@ -45,6 +45,11 @@ def _get_versionhash():
def _get_cachedir():
if 'GI_SCANNER_DISABLE_CACHE' in os.environ:
return None
+
+ xdg_cache_home = os.environ.get('XDG_CACHE_HOME')
+ if xdg_cache_home is not None and os.path.exists(xdg_cache_home):
+ return xdg_cache_home
+
homedir = os.path.expanduser('~')
if homedir is None:
return None