mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
bitbake/cache.py: Simplify logic
This commit is contained in:
@@ -59,18 +59,16 @@ class Cache:
|
|||||||
if self.cachedir in [None, '']:
|
if self.cachedir in [None, '']:
|
||||||
self.has_cache = False
|
self.has_cache = False
|
||||||
bb.msg.note(1, bb.msg.domain.Cache, "Not using a cache. Set CACHE = <directory> to enable.")
|
bb.msg.note(1, bb.msg.domain.Cache, "Not using a cache. Set CACHE = <directory> to enable.")
|
||||||
else:
|
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 not self.has_cache:
|
self.has_cache = True
|
||||||
return
|
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
|
# If any of configuration.data's dependencies are newer than the
|
||||||
# cache there isn't even any point in loading it...
|
# cache there isn't even any point in loading it...
|
||||||
|
|||||||
+9
-11
@@ -59,18 +59,16 @@ class Cache:
|
|||||||
if self.cachedir in [None, '']:
|
if self.cachedir in [None, '']:
|
||||||
self.has_cache = False
|
self.has_cache = False
|
||||||
bb.msg.note(1, bb.msg.domain.Cache, "Not using a cache. Set CACHE = <directory> to enable.")
|
bb.msg.note(1, bb.msg.domain.Cache, "Not using a cache. Set CACHE = <directory> to enable.")
|
||||||
else:
|
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 not self.has_cache:
|
self.has_cache = True
|
||||||
return
|
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
|
# If any of configuration.data's dependencies are newer than the
|
||||||
# cache there isn't even any point in loading it...
|
# cache there isn't even any point in loading it...
|
||||||
|
|||||||
Reference in New Issue
Block a user