reorganized component and repository code into separate modules
[matrix.git] / matrix / build.py
index b99af29..bde1197 100644 (file)
@@ -40,7 +40,7 @@ class Builder(object):
                                        log.error('kill: %s' % e)
 
                                c = self.jobs[pid]
-                               c.active_state = 'killed'
+                               c.state = 'killed'
 
                        while self.jobs:
                                self.wait()
@@ -96,14 +96,14 @@ class Builder(object):
                print progress, message
 
        def is_buildable(self, c):
-               if c.active_state:
+               if c.state:
                        if config.debug:
                                self.message('Component %s is in state: %s' % \
-                                       (c.name, c.active_state))
+                                       (c.name, c.state))
                        return False
 
-               for dep in c.active_depends:
-                       if config.components[dep.name].active_state != 'done':
+               for dep in c.depends:
+                       if config.components[dep.name].state != 'done':
                                if config.debug:
                                        self.message('Component %s depends ' \
                                                'on uninstalled %s' % \
@@ -116,7 +116,7 @@ class Builder(object):
                if not cache.contains(c):
                        return False
 
-               c.active_state = 'done'
+               c.state = 'done'
                self.progress(2)
 
                if config.debug:
@@ -145,7 +145,7 @@ class Builder(object):
        def start_job(self, c, make_target, state):
                pid = spawn_make(c, self.max_make_jobs, make_target)
                self.jobs[pid] = c
-               c.active_state = state
+               c.state = state
 
        def wait(self):
                pid, status = os.wait()
@@ -156,7 +156,7 @@ class Builder(object):
                c = self.jobs[pid]
                del self.jobs[pid]
 
-               if c.active_state == 'in-build':
+               if c.state == 'in-build':
                        if status:
                                log.error('Failed to build %s' % c.name)
                                return
@@ -165,10 +165,10 @@ class Builder(object):
                        if config.debug:
                                self.message('Built', c.repo.path)
 
-                       c.active_state = 'wait-install'
+                       c.state = 'wait-install'
                        self.wait_install.append(c)
 
-               elif c.active_state == 'in-install':
+               elif c.state == 'in-install':
                        assert c == self.in_install
 
                        if status:
@@ -178,12 +178,12 @@ class Builder(object):
                        self.progress()
                        self.message('Finished', c.repo.path)
 
-                       c.active_state = 'done'
+                       c.state = 'done'
                        self.in_install = None
                        cache.update(c)
 
-               elif c.active_state != 'killed':
-                       raise Error('Unexpected state: %s' % c.active_state)
+               elif c.state != 'killed':
+                       raise Error('Unexpected state: %s' % c.state)
 
 def spawn_make(c, jobs, target):
        board = config.boards[config.board]