---
morphlib/app.py | 2 +-
morphlib/morphologyfactory.py | 5 +++++
morphlib/morphologyfactory_tests.py | 14 +++++++++++++-
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/morphlib/app.py b/morphlib/app.py
index f1c683c..96c98cf 100755
--- a/morphlib/app.py
+++ b/morphlib/app.py
@@ -211,7 +211,7 @@ class BuildCommand(object):
self.cache_artifacts_locally(deps)
staging_area = self.create_staging_area(artifact)
if self.app.settings['staging-chroot']:
- if artifact.source.morphology['kind'] != 'stratum':
+ if artifact.source.morphology.needs_staging_area:
self.install_fillers(staging_area)
self.install_chunk_artifacts(staging_area,
deps)
diff --git a/morphlib/morphologyfactory.py b/morphlib/morphologyfactory.py
index c53d247..ac743f7 100644
--- a/morphlib/morphologyfactory.py
+++ b/morphlib/morphologyfactory.py
@@ -114,6 +114,8 @@ class MorphologyFactory(object):
# FIXME: -rootfs is a misnomer, should be -disk, but can't
# change this during refactoring.
morphology.builds_artifacts = [name + '-rootfs']
+
+ morphology.needs_staging_area = False
def _check_and_tweak_stratum(self, morphology, reponame, sha1, filename):
'''Check and tweak a stratum morphology.'''
@@ -128,6 +130,7 @@ class MorphologyFactory(object):
(filename, name))
morphology.builds_artifacts = [morphology['name']]
+ morphology.needs_staging_area = False
def _check_and_tweak_chunk(self, morphology, reponame, sha1, filename):
'''Check and tweak a chunk morphology.'''
@@ -137,3 +140,5 @@ class MorphologyFactory(object):
else:
morphology.builds_artifacts = [morphology['name']]
+ morphology.needs_staging_area = True
+
diff --git a/morphlib/morphologyfactory_tests.py b/morphlib/morphologyfactory_tests.py
index 89b66d0..4aa3c01 100644
--- a/morphlib/morphologyfactory_tests.py
+++ b/morphlib/morphologyfactory_tests.py
@@ -182,7 +182,7 @@ class MorphologyFactoryTests(unittest.TestCase):
self.assertEqual(morph.builds_artifacts,
['local-foo-runtime', 'local-foo-devel'])
- def test_sets_builds_artifacts_for_artifact(self):
+ def test_sets_builds_artifacts_for_stratum(self):
morph = self.mf.get_morphology('reponame', 'sha1',
'stratum.morph')
self.assertEqual(morph.builds_artifacts, ['foo-stratum'])
@@ -197,3 +197,15 @@ class MorphologyFactoryTests(unittest.TestCase):
self.assertEqual(sorted(morph.builds_artifacts),
sorted(['foo-system-rootfs',
'foo-system-kernel']))
+ def test_sets_needs_staging_for_chunk(self):
+ morph = self.mf.get_morphology('reponame', 'sha1',
'chunk.morph')
+ self.assertEqual(morph.needs_staging_area, True)
+
+ def test_does_not_set_needs_staging_for_stratum(self):
+ morph = self.mf.get_morphology('reponame', 'sha1',
'stratum.morph')
+ self.assertEqual(morph.needs_staging_area, False)
+
+ def test_does_not_set_needs_staging_for_system(self):
+ morph = self.mf.get_morphology('reponame', 'sha1',
'system.morph')
+ self.assertEqual(morph.needs_staging_area, False)
+
--
1.7.2.5