From 95c0ef95dc0e5a5eb9373dc164aa4c61fc1d7776 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sun, 21 Aug 2005 19:09:21 +0000 Subject: [PATCH] Use basedir to get impl cache location (was already used for the iface cache). Only create the implementations cache when storing, not on startup. git-svn-id: file:///home/talex/Backups/sf.net/Subversion/zero-install/injector/injector@473 9f8c893c-44ee-0310-b757-c8ca8341c71e --- zeroinstall/zerostore/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zeroinstall/zerostore/__init__.py b/zeroinstall/zerostore/__init__.py index a6470b9..400c2f2 100644 --- a/zeroinstall/zerostore/__init__.py +++ b/zeroinstall/zerostore/__init__.py @@ -111,6 +111,8 @@ class Store: info("Not adding %s as it already exists!", required_digest) return + if not os.path.isdir(self.dir): + os.makedirs(self.dir) tmp = mkdtemp(dir = self.dir, prefix = 'tmp-') copytree2(path, tmp) try: @@ -173,9 +175,7 @@ class Stores(object): __slots__ = ['stores'] def __init__(self): - user_store = os.path.expanduser('~/.cache/0install.net/implementations') - if not os.path.isdir(user_store): - os.makedirs(user_store) + user_store = os.path.join(basedir.xdg_cache_home, '0install.net', 'implementations') self.stores = [Store(user_store)] impl_dirs = basedir.load_first_config('0install.net', 'injector', -- 2.11.4.GIT