summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--morphlib/buildcommand.py9
-rw-r--r--morphlib/sourceresolver.py6
2 files changed, 10 insertions, 5 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py
index efd10f26..6a5373ab 100644
--- a/morphlib/buildcommand.py
+++ b/morphlib/buildcommand.py
@@ -84,7 +84,8 @@ class BuildCommand(object):
return morphlib.buildenvironment.BuildEnvironment(self.app.settings,
arch)
- def create_source_pool(self, repo_name, ref, filename, original_ref=None):
+ def create_source_pool(self, repo_name, ref, filename=None,
+ original_ref=None, filenames=None):
'''Find the source objects required for building a the given artifact
The SourcePool will contain every stratum and chunk dependency of the
@@ -93,12 +94,14 @@ class BuildCommand(object):
'''
self.app.status(msg='Creating source pool', chatty=True)
+ if filenames is None and filename is not None:
+ filenames = (filename,)
srcpool = morphlib.sourceresolver.create_source_pool(
- self.lrc, self.rrc, repo_name, ref, filename,
+ self.lrc, self.rrc, repo_name, ref, filename=None,
cachedir=self.app.settings['cachedir'],
original_ref=original_ref,
update_repos=not self.app.settings['no-git-update'],
- status_cb=self.app.status)
+ status_cb=self.app.status, filenames=filenames)
return srcpool
def validate_sources(self, srcpool):
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