diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-01-02 23:57:03 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-01-03 00:10:10 +0000 |
commit | 28fd9dadbdf842d5db32e893be85068f9b2b114a (patch) | |
tree | 0fe12d50231d874750c73b65ad3fd8855c3f7ad3 /bitbake/lib | |
parent | 250b02115454d4754b734209daa45d894f76039e (diff) | |
download | openembedded-core-28fd9dadbdf842d5db32e893be85068f9b2b114a.tar.gz openembedded-core-28fd9dadbdf842d5db32e893be85068f9b2b114a.tar.bz2 openembedded-core-28fd9dadbdf842d5db32e893be85068f9b2b114a.zip |
bitbake/cache.py: Simplify logic
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/cache.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index a4a4f47cef..a6b81333d1 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py @@ -59,18 +59,16 @@ class Cache: if self.cachedir in [None, '']: self.has_cache = False bb.msg.note(1, bb.msg.domain.Cache, "Not using a cache. Set CACHE = <directory> to enable.") - else: - self.has_cache = True - self.cachefile = os.path.join(self.cachedir,"bb_cache.dat") - - bb.msg.debug(1, bb.msg.domain.Cache, "Using cache in '%s'" % self.cachedir) - try: - os.stat( self.cachedir ) - except OSError: - bb.mkdirhier( self.cachedir ) + return - if not self.has_cache: - return + self.has_cache = True + self.cachefile = os.path.join(self.cachedir,"bb_cache.dat") + + bb.msg.debug(1, bb.msg.domain.Cache, "Using cache in '%s'" % self.cachedir) + try: + os.stat( self.cachedir ) + except OSError: + bb.mkdirhier( self.cachedir ) # If any of configuration.data's dependencies are newer than the # cache there isn't even any point in loading it... |