minor fixes to buildplan logic
authorAndrew Gaffney <agaffney@gentoo.org>
Sun, 29 Nov 2009 00:22:03 +0000 (18:22 -0600)
committerAndrew Gaffney <agaffney@gentoo.org>
Sun, 29 Nov 2009 00:22:03 +0000 (18:22 -0600)
modules/catalyst/target/__init__.py

index 9ad8b6424961c2a21b1ea5d6f7a95cf14b36a0b5..966e307e0045a0cad8ade2512d709c3b05e9eee6 100644 (file)
@@ -4,6 +4,7 @@ Parent module of all target modules
 
 import os
 import catalyst.util
+from catalyst.error import CatalystError
 from catalyst.output import warn
 
 def find_target_modules():
@@ -44,6 +45,10 @@ def find_built_targets(build_dir):
 def build_targets():
        buildplan = build_target_buildplan()
 
+       print "buildplan = "
+       for x in buildplan:
+               print "\t" + str(x)
+
        for target in buildplan:
                try:
                        target['object'].run()
@@ -79,16 +84,19 @@ def build_target_buildplan():
                        continue
 
                for x in target['depends']:
+                       if target['parent']:
+                               break
+
                        for y in built_targets:
                                info = y.get_target_info()
-                               if info['target'] == y and info['version_stamp'] == target['info']['version_stamp'] and \
+                               if info['target'] == x and info['version_stamp'] == target['info']['version_stamp'] and \
                                        info['arch'] == target['info']['arch'] and info['rel_type'] == target['info']['rel_type']:
                                        targets[i]['parent'] = 'built'
                                        break
 
                        for y in targets:
-                               info = y.get_target_info()
-                               if info['target'] == y and info['version_stamp'] == target['info']['version_stamp'] and \
+                               info = y['info']
+                               if info['target'] == x and info['version_stamp'] == target['info']['version_stamp'] and \
                                        info['arch'] == target['info']['arch'] and info['rel_type'] == target['info']['rel_type']:
                                        targets[i]['parent'] = info['target']
                                        break
@@ -105,7 +113,7 @@ def build_target_buildplan():
                                continue
                        else:
                                for j, foo in enumerate(targets):
-                                       if foo['target'] == target['parent']:
+                                       if foo['info']['target'] == target['parent']:
                                                if i < j:
                                                        tmp_target = targets.pop(j)
                                                        targets.insert(i, tmp_target)