cache cache status
authorTimo Savola <tsavola@movial.fi>
Sun, 6 Apr 2008 12:27:49 +0000 (15:27 +0300)
committerTimo Savola <tsavola@movial.fi>
Sun, 6 Apr 2008 12:27:49 +0000 (15:27 +0300)
matrix/cache.py
matrix/components.py

index 49535a7..b1172f0 100644 (file)
@@ -13,9 +13,12 @@ Error = RuntimeError
 regex = re.compile(r'([^\s]+)[\s]?([^\s]*)')
 
 def contains(c):
-       if c.from_platform:
-               return True
+       if c.cached is None:
+               c.cached = __contains(c)
 
+       return c.cached
+
+def __contains(c):
        for repo in (c.repo, c.meta):
                if repo.dirty_files():
                        if config.force:
index fcd3370..89e0d16 100644 (file)
@@ -13,7 +13,7 @@ from repositories import Repository
 Error = RuntimeError
 
 class Component(object):
-       from_platform = False
+       cached = None
 
        state = None
 
@@ -44,7 +44,7 @@ class PlatformProvidedComponent(Component):
        """A Component that is provided by the platform.
           The sources will not be built during install."""
 
-       from_platform = True
+       cached = True
 
 def init():
        targets = []