add "install-only" command for building specific component quickly
authorTimo Savola <tsavola@movial.fi>
Fri, 11 Apr 2008 18:49:36 +0000 (21:49 +0300)
committerTimo Savola <tsavola@movial.fi>
Fri, 11 Apr 2008 18:49:36 +0000 (21:49 +0300)
matrix/build.py
matrix/matrix.py

index a7146db..e4f3992 100644 (file)
@@ -52,6 +52,22 @@ def build(targets):
        if not count:
                print 'Nothing to build'
 
+def build_only(targets):
+       all = [config.components[i] for i in targets]
+       count = len(all)
+
+       # Set weights based on user-specified order.  Weight recalculation
+       # won't happen because the reverse dependency tree is flat.
+       #
+       # NOTE: config.jobs can still cause parallel builds!
+       #
+       weight = count
+       for c in all:
+               c.weight = weight
+               weight -= 1
+
+       Builder(all, count).run()
+
 def initial_roots(selected):
        return [c for c in selected if not c.get_depends()]
 
index 17de4f1..b4590fc 100644 (file)
@@ -13,7 +13,7 @@ import components
 import config
 import git
 import log
-from build import build
+from build import build, build_only
 from rootfs import RootFS
 
 Error = RuntimeError
@@ -49,6 +49,8 @@ def main():
 
        if command == 'install':
                build(targets)
+       elif command == 'install-only':
+               build_only(targets)
        elif command == 'clone':
                clone(targets)
        elif command == 'clean':
@@ -91,6 +93,8 @@ Options:
 Commands and parameters:
        clone           Download the components' git repositories.
        install         Download, build and install the components.
+       install-only    Download, build and install the specified components
+                       without dependencies.
        clean           Remove all non-tracked files from the component git
                        repository directories.
        rebase          Update repositories from server by rebasing.