summaryrefslogtreecommitdiff
path: root/morphlib/plugins
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-05-13 16:46:34 +0000
committerAdam Coldrick <adam.coldrick@codethink.co.uk>2015-05-14 12:08:52 +0000
commit1da8ee6f66718de5d5dd413e188425ee4bdcfb47 (patch)
treefd2aba3c1437818d8012549d3cc025839c293bf1 /morphlib/plugins
parentd7e86046706680828b141a21a77ab95419dfb58f (diff)
downloadmorph-1da8ee6f66718de5d5dd413e188425ee4bdcfb47.tar.gz
Fix prototype of create_source_pool()
This fixes an issue in `morph list-artifacts` and probably other commands: ERROR: Command failed: morph list-artifacts --quiet file:///ws/master/git.baserock.org/baserock/baserock/definitions HEAD systems/build-system-armv7lhf-jetson.morph systems/weston-system-armv7lhf-jetson.morph systems/genivi-baseline-system-armv7lhf-jetson.morph Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/cliapp/app.py", line 190, in _run self.process_args(args) File "/usr/lib/python2.7/site-packages/morphlib/app.py", line 290, in process_args cliapp.Application.process_args(self, args) File "/usr/lib/python2.7/site-packages/cliapp/app.py", line 539, in process_args method(args[1:]) File "/usr/lib/python2.7/site-packages/morphlib/plugins/list_artifacts_plugin.py", line 67, in list_artifacts repo, ref, system_filename) File "/usr/lib/python2.7/site-packages/morphlib/plugins/list_artifacts_plugin.py", line 91, in list_artifacts_for_system status_cb=self.app.status) File "/usr/lib/python2.7/site-packages/morphlib/sourceresolver.py", line 641, in create_source_pool definitions_original_ref=original_ref) File "/usr/lib/python2.7/site-packages/morphlib/sourceresolver.py", line 583, in traverse_morphs definitions_absref, definitions_tree, visit) File "/usr/lib/python2.7/site-packages/morphlib/sourceresolver.py", line 408, in _process_definitions_with_children definitions_queue = collections.deque(system_filenames) TypeError: 'NoneType' object is not iterable The issue is that the sourceresolver.create_source_pool() function did not work correctly if passed a single filename. This was a regression from commit 4cc75039a78bd8aef9ef464bc0eb6c3ff16809d0. In order to have a logical function prototype, the create_source_pool() function now only takes a list of systems, instead of taking either a single system or a list. Change-Id: I8f5ec8859a7e26d8107ed1c268fe925818d080a5
Diffstat (limited to 'morphlib/plugins')
-rw-r--r--morphlib/plugins/anchor_plugin.py2
-rw-r--r--morphlib/plugins/build_plugin.py2
-rw-r--r--morphlib/plugins/certify_plugin.py2
-rw-r--r--morphlib/plugins/cross-bootstrap_plugin.py3
-rw-r--r--morphlib/plugins/deploy_plugin.py3
-rw-r--r--morphlib/plugins/distbuild_plugin.py4
-rw-r--r--morphlib/plugins/graphing_plugin.py2
-rw-r--r--morphlib/plugins/list_artifacts_plugin.py2
-rw-r--r--morphlib/plugins/show_build_log_plugin.py2
-rw-r--r--morphlib/plugins/show_dependencies_plugin.py2
-rw-r--r--morphlib/plugins/system_manifests_plugin.py2
11 files changed, 14 insertions, 12 deletions
diff --git a/morphlib/plugins/anchor_plugin.py b/morphlib/plugins/anchor_plugin.py
index f3973418..40cd4c48 100644
--- a/morphlib/plugins/anchor_plugin.py
+++ b/morphlib/plugins/anchor_plugin.py
@@ -128,7 +128,7 @@ class AnchorPlugin(cliapp.Plugin):
for system in systems:
bc = BuildCommand(self.app)
srcpool = bc.create_source_pool(branch_repo, branch_ref,
- system)
+ [system])
artifact = bc.resolve_artifacts(srcpool)
sources = set(a.source for a in artifact.walk())
for source in sources:
diff --git a/morphlib/plugins/build_plugin.py b/morphlib/plugins/build_plugin.py
index 8411dcb6..9030799b 100644
--- a/morphlib/plugins/build_plugin.py
+++ b/morphlib/plugins/build_plugin.py
@@ -377,7 +377,7 @@ class BuildPlugin(cliapp.Plugin):
return
self.app.status(msg='Deciding on task order')
- srcpool = bc.create_source_pool(repo, commit, system_filename,
+ srcpool = bc.create_source_pool(repo, commit, [system_filename],
original_ref)
bc.validate_sources(srcpool)
root = bc.resolve_artifacts(srcpool)
diff --git a/morphlib/plugins/certify_plugin.py b/morphlib/plugins/certify_plugin.py
index a44c4e53..8228be4d 100644
--- a/morphlib/plugins/certify_plugin.py
+++ b/morphlib/plugins/certify_plugin.py
@@ -69,7 +69,7 @@ class CertifyPlugin(cliapp.Plugin):
self.app.status(
msg='Creating source pool for %s' % system_filename, chatty=True)
source_pool = morphlib.sourceresolver.create_source_pool(
- self.lrc, self.rrc, repo, ref, system_filename,
+ self.lrc, self.rrc, repo, ref, [system_filename],
cachedir=self.app.settings['cachedir'],
update_repos = not self.app.settings['no-git-update'],
status_cb=self.app.status)
diff --git a/morphlib/plugins/cross-bootstrap_plugin.py b/morphlib/plugins/cross-bootstrap_plugin.py
index eb889645..b8da515e 100644
--- a/morphlib/plugins/cross-bootstrap_plugin.py
+++ b/morphlib/plugins/cross-bootstrap_plugin.py
@@ -255,7 +255,8 @@ class CrossBootstrapPlugin(cliapp.Plugin):
build_command = morphlib.buildcommand.BuildCommand(self.app, build_env)
morph_name = morphlib.util.sanitise_morphology_path(system_name)
- srcpool = build_command.create_source_pool(root_repo, ref, morph_name)
+ srcpool = build_command.create_source_pool(
+ root_repo, ref, [morph_name])
# FIXME: this is a quick fix in order to get it working for
# Baserock 13 release, it is not a reasonable fix
diff --git a/morphlib/plugins/deploy_plugin.py b/morphlib/plugins/deploy_plugin.py
index c8e8959f..b98f3b3c 100644
--- a/morphlib/plugins/deploy_plugin.py
+++ b/morphlib/plugins/deploy_plugin.py
@@ -476,7 +476,8 @@ class DeployPlugin(cliapp.Plugin):
try:
# Find the artifact to build
morph = morphlib.util.sanitise_morphology_path(system['morph'])
- srcpool = build_command.create_source_pool(build_repo, ref, morph)
+ srcpool = build_command.create_source_pool(
+ build_repo, ref, [morph])
artifact = build_command.resolve_artifacts(srcpool)
diff --git a/morphlib/plugins/distbuild_plugin.py b/morphlib/plugins/distbuild_plugin.py
index c5ea5ed6..2d6d932e 100644
--- a/morphlib/plugins/distbuild_plugin.py
+++ b/morphlib/plugins/distbuild_plugin.py
@@ -201,7 +201,7 @@ class CalculateBuildGraphPlugin(cliapp.Plugin):
filename = morphlib.util.sanitise_morphology_path(morph_name)
build_command = morphlib.buildcommand.BuildCommand(self.app)
srcpool = build_command.create_source_pool(
- repo_name, ref, filename, original_ref=original_ref)
+ repo_name, ref, [filename], original_ref=original_ref)
artifact = build_command.resolve_artifacts(srcpool)
self.app.output.write(distbuild.encode_artifact(artifact,
repo_name,
@@ -234,7 +234,7 @@ class WorkerBuild(cliapp.Plugin):
bc = morphlib.buildcommand.BuildCommand(self.app)
source_pool = bc.create_source_pool(artifact_reference.repo,
artifact_reference.ref,
- artifact_reference.root_filename)
+ [artifact_reference.root_filename])
root = bc.resolve_artifacts(source_pool)
diff --git a/morphlib/plugins/graphing_plugin.py b/morphlib/plugins/graphing_plugin.py
index 0db63ffc..68e153fa 100644
--- a/morphlib/plugins/graphing_plugin.py
+++ b/morphlib/plugins/graphing_plugin.py
@@ -64,7 +64,7 @@ class GraphingPlugin(cliapp.Plugin):
'%(repo_name)s %(ref)s %(filename)s',
repo_name=repo_name, ref=ref, filename=filename)
builder = morphlib.buildcommand.BuildCommand(self.app)
- srcpool = builder.create_source_pool(repo_name, ref, filename)
+ srcpool = builder.create_source_pool(repo_name, ref, [filename])
root_artifact = builder.resolve_artifacts(srcpool)
basename, ext = os.path.splitext(filename)
diff --git a/morphlib/plugins/list_artifacts_plugin.py b/morphlib/plugins/list_artifacts_plugin.py
index b7a5e080..c2e6b459 100644
--- a/morphlib/plugins/list_artifacts_plugin.py
+++ b/morphlib/plugins/list_artifacts_plugin.py
@@ -85,7 +85,7 @@ class ListArtifactsPlugin(cliapp.Plugin):
self.app.status(
msg='Creating source pool for %s' % system_filename, chatty=True)
source_pool = morphlib.sourceresolver.create_source_pool(
- self.lrc, self.rrc, repo, ref, system_filename,
+ self.lrc, self.rrc, repo, ref, [system_filename],
cachedir=self.app.settings['cachedir'],
update_repos = not self.app.settings['no-git-update'],
status_cb=self.app.status)
diff --git a/morphlib/plugins/show_build_log_plugin.py b/morphlib/plugins/show_build_log_plugin.py
index 2c80ff50..a6bb1783 100644
--- a/morphlib/plugins/show_build_log_plugin.py
+++ b/morphlib/plugins/show_build_log_plugin.py
@@ -63,7 +63,7 @@ class ShowBuildLog(cliapp.Plugin):
build_command = morphlib.buildcommand.BuildCommand(self.app, None)
srcpool = build_command.create_source_pool(definitions_repo_path, ref,
- system)
+ [system])
root = build_command.resolve_artifacts(srcpool)
arch = root.source.morphology['arch']
diff --git a/morphlib/plugins/show_dependencies_plugin.py b/morphlib/plugins/show_dependencies_plugin.py
index ee96cb40..42f8f273 100644
--- a/morphlib/plugins/show_dependencies_plugin.py
+++ b/morphlib/plugins/show_dependencies_plugin.py
@@ -68,7 +68,7 @@ class ShowDependenciesPlugin(cliapp.Plugin):
self.app.output.write('dependency graph for %s|%s|%s:\n' %
(repo, ref, morph))
- srcpool = build_command.create_source_pool(repo, ref, filename)
+ srcpool = build_command.create_source_pool(repo, ref, [filename])
root_artifact = build_command.resolve_artifacts(srcpool)
for artifact in reversed(root_artifact.walk()):
diff --git a/morphlib/plugins/system_manifests_plugin.py b/morphlib/plugins/system_manifests_plugin.py
index f5aa25b8..1aea8341 100644
--- a/morphlib/plugins/system_manifests_plugin.py
+++ b/morphlib/plugins/system_manifests_plugin.py
@@ -104,7 +104,7 @@ class SystemManifestsPlugin(cliapp.Plugin):
msg='Creating source pool for %(system)s',
system=system_filename, chatty=True)
source_pool = morphlib.sourceresolver.create_source_pool(
- self.lrc, self.rrc, repo, ref, system_filename,
+ self.lrc, self.rrc, repo, ref, [system_filename],
cachedir=self.app.settings['cachedir'],
update_repos = not self.app.settings['no-git-update'],
status_cb=self.app.status)