summaryrefslogtreecommitdiff
path: root/morphlib/sourceresolver.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2015-04-29 20:42:21 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2015-05-11 10:52:50 +0000
commit4cc75039a78bd8aef9ef464bc0eb6c3ff16809d0 (patch)
tree213f7ae9ba02546c00e4d6a2f8825ed037c68938 /morphlib/sourceresolver.py
parent43ae0cc28988fb9bf0b0db5daa963ad3a59a1275 (diff)
downloadmorph-4cc75039a78bd8aef9ef464bc0eb6c3ff16809d0.tar.gz
SourceResolver: Allow the resolution of multiple systems
The existing Source resolution code handles resolution of multiple systems sufficiently. It is not appropriate to then take this source pool and attempt to create a build graph from it though, as the logical structure of the input of what we want to build, and the logical structure of what we will produce are conflated in the Source object. If we do not intend to create a build graph from the Source Pool we generate, then it is an appropriate data structure that may be used to analyse changes in the input to a build. Change-Id: If8e4a726f16f8aca000e59ecbbeb7d926cc08391
Diffstat (limited to 'morphlib/sourceresolver.py')
-rw-r--r--morphlib/sourceresolver.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/morphlib/sourceresolver.py b/morphlib/sourceresolver.py
index e338dd4d..b8907bfe 100644
--- a/morphlib/sourceresolver.py
+++ b/morphlib/sourceresolver.py
@@ -600,7 +600,7 @@ class SourceResolver(object):
def create_source_pool(lrc, rrc, repo, ref, filename, cachedir,
original_ref=None, update_repos=True,
- status_cb=None): # pragma: no cover
+ status_cb=None, filenames=None): # pragma: no cover
'''Find all the sources involved in building a given system.
Given a system morphology, this function will traverse the tree of stratum
@@ -616,6 +616,8 @@ def create_source_pool(lrc, rrc, repo, ref, filename, cachedir,
'''
pool = morphlib.sourcepool.SourcePool()
+ if filenames is None and filenames is not None:
+ filenames = (filename,)
def add_to_pool(reponame, ref, filename, absref, tree, morphology):
sources = morphlib.source.make_sources(reponame, ref,
@@ -634,7 +636,7 @@ def create_source_pool(lrc, rrc, repo, ref, filename, cachedir,
resolver = SourceResolver(lrc, rrc, tree_cache_manager,
buildsystem_cache_manager, update_repos,
status_cb)
- resolver.traverse_morphs(repo, ref, [filename],
+ resolver.traverse_morphs(repo, ref, filenames,
visit=add_to_pool,
definitions_original_ref=original_ref)
return pool