summaryrefslogtreecommitdiff
path: root/morph
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-02-29 13:47:36 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-02 17:09:34 +0000
commit7f72010b604468e5c8e24deba10f5c181b72a131 (patch)
tree96d25d0bccc9066c0b55f7ea82fcf41eafc9efdb /morph
parentade75b0ef48df72c8526d3901a55c63cfa1f118b (diff)
downloadmorph-7f72010b604468e5c8e24deba10f5c181b72a131.tar.gz
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.
Diffstat (limited to 'morph')
-rwxr-xr-xmorph14
1 files changed, 8 insertions, 6 deletions
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:]