From 7f72010b604468e5c8e24deba10f5c181b72a131 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 29 Feb 2012 13:47:36 +0000 Subject: Refactor SystemBuilder and add helper class The helper class, Factory, has unit tests, which is why it's currently separate. It may later get integrated with BlobBuilder, or the other way around. Classes that don't have unit tests are marked out of coverage. --- morph | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'morph') diff --git a/morph b/morph index 4ba2d4c5..ea055de0 100755 --- a/morph +++ b/morph @@ -135,15 +135,14 @@ class Morph(cliapp.Application): morph_loader = MorphologyLoader(self.settings) source_manager = morphlib.sourcemanager.SourceManager(self, update=not self.settings['no-git-update']) + factory = morphlib.builder.Factory(tempdir) builder = morphlib.builder.Builder(tempdir, self, morph_loader, - source_manager) + source_manager, factory) # Unpack manually specified build dependencies. - staging = tempdir.join('staging') - os.mkdir(staging) - ex = morphlib.execute.Execute('/', self.msg) + factory.create_staging() for bin in self.settings['staging-filler']: - morphlib.bins.unpack_binary(bin, staging, ex) + factory.unpack_binary_from_file(bin) # derive a build order from the dependency graph graph = BuildDependencyGraph(source_manager, morph_loader, @@ -227,12 +226,15 @@ class Morph(cliapp.Application): morph_loader = MorphologyLoader(self.settings) source_manager = morphlib.sourcemanager.SourceManager(self, update=False) + factory = morphlib.builder.Factory(tempdir) builder = morphlib.builder.Builder(tempdir, self, morph_loader, - source_manager) + source_manager, factory) if not os.path.exists(self.settings['cachedir']): os.mkdir(self.settings['cachedir']) + factory.create_staging() + if len(args) >= 3: repo, ref, filename = args[:3] args = args[3:] -- cgit v1.2.1