summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@gmail.com>2014-09-10 10:22:30 +0000
committerRichard Maw <richard.maw@gmail.com>2014-09-19 12:43:25 +0000
commit59e1a82ab96115b6630269de28aadecf61d9bba9 (patch)
tree1bab94717a4ea2ab6522996d2613f758485e7f63
parent90b3106de52d716f0ec08c5928a921db04b2eac8 (diff)
downloadmorph-59e1a82ab96115b6630269de28aadecf61d9bba9.tar.gz
Eliminate BuilderBase.new_artifact
It was an odd thing to have, when Artifact objects are part of your input. Its purpose appears to have been to allow the build step to produce an artifact called $morphology_name-rootfs, but since the split rules decide that the artifact is called that anyway, the new_artifact step is redundant.
-rw-r--r--morphlib/builder2.py11
-rw-r--r--morphlib/builder2_tests.py6
-rw-r--r--tests.as-root/run-in-artifact-with-different-artifacts.stdout2
-rw-r--r--tests.as-root/tarball-image-is-sensible.stdout2
4 files changed, 5 insertions, 16 deletions
diff --git a/morphlib/builder2.py b/morphlib/builder2.py
index 8031f26f..681ad6be 100644
--- a/morphlib/builder2.py
+++ b/morphlib/builder2.py
@@ -299,12 +299,6 @@ class BuilderBase(object):
json.dump(meta, f, indent=4, sort_keys=True, encoding='unicode-escape')
f.close()
- def new_artifact(self, artifact_name):
- '''Return an Artifact object for something built from our source.'''
- a = morphlib.artifact.Artifact(self.artifact.source, artifact_name)
- a.cache_key = self.artifact.cache_key
- return a
-
def runcmd(self, *args, **kwargs):
return self.staging_area.runcmd(*args, **kwargs)
@@ -607,9 +601,8 @@ class SystemBuilder(BuilderBase): # pragma: no cover
with self.build_watch('overall-build'):
arch = self.artifact.source.morphology['arch']
- rootfs_name = self.artifact.source.morphology['name'] + '-rootfs'
- rootfs_artifact = self.new_artifact(rootfs_name)
- handle = self.local_artifact_cache.put(rootfs_artifact)
+ rootfs_name = self.artifact.source.morphology['name']
+ handle = self.local_artifact_cache.put(self.artifact)
try:
fs_root = self.staging_area.destdir(self.artifact.source)
diff --git a/morphlib/builder2_tests.py b/morphlib/builder2_tests.py
index d0d56b17..075134a8 100644
--- a/morphlib/builder2_tests.py
+++ b/morphlib/builder2_tests.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2013 Codethink Limited
+# Copyright (C) 2012-2014 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -162,10 +162,6 @@ class BuilderBaseTests(unittest.TestCase):
self.max_jobs,
False)
- def test_returns_an_artifact(self):
- artifact = self.builder.new_artifact('le-artifact')
- self.assertEqual(type(artifact), morphlib.artifact.Artifact)
-
def test_runs_desired_command(self):
self.builder.runcmd(['foo', 'bar'])
self.assertEqual(self.commands_run, [['foo', 'bar']])
diff --git a/tests.as-root/run-in-artifact-with-different-artifacts.stdout b/tests.as-root/run-in-artifact-with-different-artifacts.stdout
index 7473990b..5b060383 100644
--- a/tests.as-root/run-in-artifact-with-different-artifacts.stdout
+++ b/tests.as-root/run-in-artifact-with-different-artifacts.stdout
@@ -15,7 +15,7 @@ linux-locale.meta
linux-misc.meta
linux-stratum-devel.meta
linux-stratum-runtime.meta
-linux-system-rootfs.meta
+linux-system.meta
tools-bins.meta
tools-devel.meta
tools-doc.meta
diff --git a/tests.as-root/tarball-image-is-sensible.stdout b/tests.as-root/tarball-image-is-sensible.stdout
index cf74a1ec..7577bdc4 100644
--- a/tests.as-root/tarball-image-is-sensible.stdout
+++ b/tests.as-root/tarball-image-is-sensible.stdout
@@ -7,7 +7,7 @@
./baserock/hello-misc.meta
./baserock/hello-stratum-devel.meta
./baserock/hello-stratum-runtime.meta
-./baserock/hello-tarball-rootfs.meta
+./baserock/hello-tarball.meta
./baserock/link-stratum-devel.meta
./baserock/link-stratum-runtime.meta
./baserock/links-bins.meta