diff options
author | Sam Thursfield <sam@afuera.me.uk> | 2014-10-24 16:28:30 +0000 |
---|---|---|
committer | Sam Thursfield <sam@afuera.me.uk> | 2014-10-24 16:33:39 +0000 |
commit | 35178357f0ba7eafdeebfc621d70ba69f2cd270a (patch) | |
tree | f7af3af1949913b69c79d29a3230e4718e5d0f39 /morphlib/buildcommand.py | |
parent | 8df5d7df210f9c712c2377cecc6f3f3a7efce01a (diff) | |
download | morph-35178357f0ba7eafdeebfc621d70ba69f2cd270a.tar.gz |
build: Allow passing in the name of the original ref to create_source_pool()
This means that we can force the building of a specific commit without
losing the original branch name in the metadata of the resulting system.
Diffstat (limited to 'morphlib/buildcommand.py')
-rw-r--r-- | morphlib/buildcommand.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py index 650ee13a..544d88d8 100644 --- a/morphlib/buildcommand.py +++ b/morphlib/buildcommand.py @@ -50,7 +50,7 @@ class BuildCommand(object): self.lac, self.rac = self.new_artifact_caches() self.lrc, self.rrc = self.new_repo_caches() - def build(self, repo_name, ref, filename): + def build(self, repo_name, ref, filename, original_ref=None): '''Build a given system morphology.''' self.app.status( @@ -58,7 +58,8 @@ class BuildCommand(object): repo_name=repo_name, ref=ref, filename=filename) self.app.status(msg='Deciding on task order') - srcpool = self.create_source_pool(repo_name, ref, filename) + srcpool = self.create_source_pool( + repo_name, ref, filename, original_ref) self.validate_sources(srcpool) root_artifact = self.resolve_artifacts(srcpool) self.build_in_order(root_artifact) @@ -84,7 +85,7 @@ class BuildCommand(object): return morphlib.buildenvironment.BuildEnvironment(self.app.settings, arch) - def create_source_pool(self, repo_name, ref, filename): + def create_source_pool(self, repo_name, ref, filename, original_ref=None): '''Find the source objects required for building a the given artifact The SourcePool will contain every stratum and chunk dependency of the @@ -94,7 +95,8 @@ class BuildCommand(object): ''' self.app.status(msg='Creating source pool', chatty=True) srcpool = self.app.create_source_pool( - self.lrc, self.rrc, repo_name, ref, filename) + self.lrc, self.rrc, repo_name, ref, filename, + original_ref=original_ref) return srcpool |