summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-04 20:16:21 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-04 20:16:21 +0100
commite4b58fe4d67a66c0a59231ac2d08ef06ec480218 (patch)
tree563aa1fd20b12886708162a63e1a7f7297f32aae
parent366974980fe6014a6c8f0246514294d277b7f7dc (diff)
parentdd07215e27148ade2bf3a1f394cbaded4617badd (diff)
downloadmorph-e4b58fe4d67a66c0a59231ac2d08ef06ec480218.tar.gz
Merge branch 'master' of gitorious.org:baserock/morph
-rw-r--r--morphlib/builddependencygraph.py10
-rw-r--r--morphlib/builder.py5
-rw-r--r--morphlib/morphology.py2
-rw-r--r--morphlib/morphology_tests.py4
-rw-r--r--morphlib/morphologyloader.py2
5 files changed, 10 insertions, 13 deletions
diff --git a/morphlib/builddependencygraph.py b/morphlib/builddependencygraph.py
index 90c4f084..7fd93b66 100644
--- a/morphlib/builddependencygraph.py
+++ b/morphlib/builddependencygraph.py
@@ -39,10 +39,10 @@ class BuildDependencyGraph(object): # pragma: no cover
self.root_filename = filename
self.blobs = set()
- def create_blob(self, treeish, filename):
+ def create_blob(self, treeish, filename, chunk_name=None):
'''Creates a blob from a morphology.'''
- morph = self.morph_loader.load(treeish, filename)
+ morph = self.morph_loader.load(treeish, filename, chunk_name)
if morph.kind == 'stratum':
return morphlib.blobs.Stratum(morph)
@@ -51,7 +51,7 @@ class BuildDependencyGraph(object): # pragma: no cover
else:
return morphlib.blobs.System(morph)
- def get_blob(self, treeish, filename):
+ def get_blob(self, treeish, filename, chunk_name=None):
'''Takes a repo, ref, filename and looks up the blob for them.
Loads the corresponding morphology and chunk/stratum/system object
@@ -62,7 +62,7 @@ class BuildDependencyGraph(object): # pragma: no cover
key = (treeish, filename)
blob = self.cached_blobs.get(key, None)
if not blob:
- blob = self.create_blob(treeish, filename)
+ blob = self.create_blob(treeish, filename, chunk_name)
self.cached_blobs[key] = blob
return blob
@@ -166,7 +166,7 @@ class BuildDependencyGraph(object): # pragma: no cover
# load the chunk on demand
treeish = self.source_manager.get_treeish(repo, ref)
- chunk = self.get_blob(treeish, filename)
+ chunk = self.get_blob(treeish, filename, source['name'])
chunk.add_parent(stratum)
# store (name -> chunk) association to avoid loading the chunk
diff --git a/morphlib/builder.py b/morphlib/builder.py
index bcd934ef..23a1c2ca 100644
--- a/morphlib/builder.py
+++ b/morphlib/builder.py
@@ -279,10 +279,7 @@ class ChunkBuilder(BlobBuilder): # pragma: no cover
'''
bs_name = self.blob.morph.build_system
- if bs_name:
- bs = morphlib.buildsystem.lookup_build_system(bs_name)
- else:
- bs = {}
+ bs = morphlib.buildsystem.lookup_build_system(bs_name)
def run_them(runner, what):
attr = '%s_commands' % what
diff --git a/morphlib/morphology.py b/morphlib/morphology.py
index e44e59b3..aec63c90 100644
--- a/morphlib/morphology.py
+++ b/morphlib/morphology.py
@@ -68,7 +68,7 @@ class Morphology(object):
@property
def build_system(self):
- return self._dict.get('build-system', None)
+ return self._dict.get('build-system', 'manual')
@property
def max_jobs(self):
diff --git a/morphlib/morphology_tests.py b/morphlib/morphology_tests.py
index 560677b5..c314f63c 100644
--- a/morphlib/morphology_tests.py
+++ b/morphlib/morphology_tests.py
@@ -105,7 +105,7 @@ class MorphologyTests(unittest.TestCase):
u'hello-dev': [u'usr/include/*', u'usr/lib/*'],
})
- def test_build_system_defaults_to_None(self):
+ def test_build_system_defaults_to_manual(self):
morph = morphlib.morphology.Morphology(
FakeTreeish(),
MockFile('''
@@ -113,7 +113,7 @@ class MorphologyTests(unittest.TestCase):
"name": "hello",
"kind": "chunk"
}'''))
- self.assertEqual(morph.build_system, None)
+ self.assertEqual(morph.build_system, 'manual')
def test_max_jobs_defaults_to_None(self):
morph = morphlib.morphology.Morphology(
diff --git a/morphlib/morphologyloader.py b/morphlib/morphologyloader.py
index 02c58f80..b0da97dc 100644
--- a/morphlib/morphologyloader.py
+++ b/morphlib/morphologyloader.py
@@ -34,7 +34,7 @@ class MorphologyLoader(object):
else:
try:
morph = self._get_morph_from_git(treeish, filename)
- except morphlib.excecute.CommandFailure: # pragma: no cover
+ except morphlib.execute.CommandFailure: # pragma: no cover
morph = None
if morph is None and chunk_name is not None: # pragma: no cover
morph = self._autodetect_morph(treeish, filename, chunk_name)