summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-10-08 17:26:13 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-10-08 17:26:13 +0000
commit4cba7db4b5c34e567e2795dbc99d8b8b485ec5b1 (patch)
tree7b6daa33a67799d6d6c38b3f10b2a061000c1c80
parent53f9395fa3570c7f0a07825e125fc4713864af3c (diff)
parent1d9b4442eec790f1b18bc8df380a29ac0ff23e00 (diff)
downloadmorph-4cba7db4b5c34e567e2795dbc99d8b8b485ec5b1.tar.gz
Merge remote-tracking branch 'origin/baserock/richardipsum'
Reviewed-by: Lars Wirzenius Reviewed-by: Richard Maw
-rw-r--r--morphlib/plugins/artifact_inspection_plugin.py5
-rw-r--r--yarns/branches-workspaces.yarn8
-rw-r--r--yarns/implementations.yarn37
3 files changed, 48 insertions, 2 deletions
diff --git a/morphlib/plugins/artifact_inspection_plugin.py b/morphlib/plugins/artifact_inspection_plugin.py
index 6c321abb..9181d488 100644
--- a/morphlib/plugins/artifact_inspection_plugin.py
+++ b/morphlib/plugins/artifact_inspection_plugin.py
@@ -78,7 +78,8 @@ class AutotoolsVersionGuesser(ProjectVersionGuesser):
break
# Then, try running autoconf against the configure script
- version = self._check_autoconf_package_version(filename, data)
+ version = self._check_autoconf_package_version(
+ repo, ref, filename, data)
if version:
self.app.status(
msg='%(repo)s: Version of %(ref)s detected '
@@ -107,7 +108,7 @@ class AutotoolsVersionGuesser(ProjectVersionGuesser):
return version
return None
- def _check_autoconf_package_version(self, filename, data):
+ def _check_autoconf_package_version(self, repo, ref, filename, data):
tempdir = morphlib.tempdir.Tempdir(self.app.settings['tempdir'])
with open(tempdir.join(filename), 'w') as f:
f.write(data)
diff --git a/yarns/branches-workspaces.yarn b/yarns/branches-workspaces.yarn
index f523ebcd..cd3f7a0e 100644
--- a/yarns/branches-workspaces.yarn
+++ b/yarns/branches-workspaces.yarn
@@ -352,3 +352,11 @@ Petrifying also leaves null refs unmolested
AND remembering all refs in foo
AND petrifying foo
THEN in branch foo, system test-system refs test-stratum in None
+
+Generating a manifest works
+
+ SCENARIO morph generates a manifest
+ GIVEN a workspace
+ AND a system artifact
+ WHEN morph generates a manifest
+ THEN the manifest is generated
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn
index e35e4219..824ce608 100644
--- a/yarns/implementations.yarn
+++ b/yarns/implementations.yarn
@@ -382,3 +382,40 @@ Tagging.
assert_morphologies_are_petrified "$MATCH_1" temptemptemp
done
+Generating a manifest.
+
+ IMPLEMENTS GIVEN a system artifact
+ mkdir "$DATADIR/hello_world"
+
+ git init "$DATADIR/hello_world"
+ touch "$DATADIR/hello_world/configure.ac"
+ run_in "$DATADIR/hello_world" git add configure.ac
+ run_in "$DATADIR/hello_world" git commit -m 'Add configure.ac'
+
+ mkdir "$DATADIR/baserock"
+ run_in "$DATADIR/hello_world" cat << EOF \
+ > "$DATADIR/baserock/hello_world.meta"
+ {
+ "artifact-name": "hello_world",
+ "cache-key":
+ "ab8d00a80298a842446ce23507cea6b4d0e34c7ddfa05c67f460318b04d21308",
+ "kind": "chunk",
+ "morphology": "hello_world.morph",
+ "original_ref": "$(run_in "$DATADIR/hello_world" git rev-parse HEAD)",
+ "repo": "file://$DATADIR/hello_world",
+ "repo-alias": "upstream:hello_world",
+ "sha1": "$(run_in "$DATADIR/hello_world" git rev-parse HEAD)",
+ "source-name": "hello_world"
+ }
+ EOF
+ run_in "$DATADIR" tar -c baserock > "$DATADIR/artifact.tar"
+
+ IMPLEMENTS WHEN morph generates a manifest
+ run_morph generate-manifest "$DATADIR/artifact.tar" > "$DATADIR/manifest"
+
+ IMPLEMENTS THEN the manifest is generated
+
+ # Generated manifest should contain the name of the repository
+ if ! grep -q hello_world "$DATADIR/manifest"; then
+ die "Output isn't what we expect"
+ fi