summaryrefslogtreecommitdiff
path: root/morphlib/plugins
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-10-29 14:07:22 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-10-29 14:07:22 +0000
commit481608ccad208bd7609aaca182baa12e3ef300eb (patch)
tree352bd3f45bdaee6a0165e02e542e7700aca5f95e /morphlib/plugins
parent42c7735d8d4107e3560b97913513ae8fdb96c69d (diff)
parenta0c24350042082fe3e1195f8f6160da363c94843 (diff)
downloadmorph-481608ccad208bd7609aaca182baa12e3ef300eb.tar.gz
Merge remote-tracking branch 'origin/sam/build-fix-3'
Reviewed-By: Richard Ipsum <richard.ipsum@codethink.co.uk> Reviewed-By: Richard Maw <richard.maw@codethink.co.uk>
Diffstat (limited to 'morphlib/plugins')
-rw-r--r--morphlib/plugins/distbuild_plugin.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/morphlib/plugins/distbuild_plugin.py b/morphlib/plugins/distbuild_plugin.py
index 653eeae8..970205c0 100644
--- a/morphlib/plugins/distbuild_plugin.py
+++ b/morphlib/plugins/distbuild_plugin.py
@@ -45,7 +45,7 @@ class SerialiseArtifactPlugin(cliapp.Plugin):
def enable(self):
self.app.add_subcommand('serialise-artifact', self.serialise_artifact,
- arg_synopsis='REPO REF MORPHOLOGY')
+ arg_synopsis='REPO REF MORPHOLOGY [ORIGINAL_REF]')
def disable(self):
pass
@@ -55,13 +55,22 @@ class SerialiseArtifactPlugin(cliapp.Plugin):
distbuild.add_crash_conditions(self.app.settings['crash-condition'])
- if len(args) != 3:
- raise cliapp.AppException('Must get triplet')
-
- repo_name, ref, morph_name = args
+ if len(args) not in [3, 4]:
+ raise cliapp.AppException(
+ 'This command takes a repo/ref/morph triplet, and optionally '
+ 'a ref name.')
+
+ repo_name, ref, morph_name = args[0:3]
+
+ if len(args) == 4:
+ original_ref = args[3]
+ else:
+ original_ref = ref
+
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)
+ srcpool = build_command.create_source_pool(
+ repo_name, ref, filename, original_ref=original_ref)
artifact = build_command.resolve_artifacts(srcpool)
self.app.output.write(distbuild.serialise_artifact(artifact))
self.app.output.write('\n')