summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README8
-rwxr-xr-xmorphlib/app.py2
-rw-r--r--morphlib/artifactresolver.py2
-rw-r--r--morphlib/artifactresolver_tests.py16
-rw-r--r--morphlib/cachekeycomputer_tests.py4
-rw-r--r--morphlib/morph2.py5
-rw-r--r--morphlib/morph2_tests.py12
-rw-r--r--morphlib/morphologyfactory.py2
-rw-r--r--morphlib/plugins/branch_and_merge_plugin.py8
-rwxr-xr-xscripts/clean-git-cache4
-rwxr-xr-xtests.as-root/disk-builds-rootfs-and-kernel.script2
-rwxr-xr-xtests.as-root/make-patch.script2
-rwxr-xr-xtests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script2
-rwxr-xr-xtests.as-root/setup2
-rwxr-xr-xtests.as-root/syslinux-disk-builds-rootfs-and-kernel.script2
-rwxr-xr-xtests.as-root/syslinux-fails-if-no-mbr-found.script2
-rwxr-xr-xtests.as-root/system-overlap.script4
-rw-r--r--tests.branching/edit-updates-stratum.stdout11
-rw-r--r--tests.branching/petrify.stdout8
-rwxr-xr-xtests.branching/setup2
-rwxr-xr-xtests/build-stratum-with-submodules.script2
-rw-r--r--tests/hello-stratum.morph2
-rwxr-xr-xtests/morphless-chunks.script2
-rwxr-xr-xtests/setup2
-rwxr-xr-xtests/show-dependencies.setup4
-rwxr-xr-xtests/stratum-overlap-warns.setup2
26 files changed, 57 insertions, 57 deletions
diff --git a/README b/README
index 06409919..b42c8c14 100644
--- a/README
+++ b/README
@@ -112,7 +112,7 @@ For strata, use the following fields:
* `build-depends`: a list of strings, each of which refers to another
stratum that the current stratum depends on. This list may be omitted
or empty if the stratum does not depend on anything else.
-* `sources`: a list of key/value mappings, where each mapping corresponds
+* `chunks`: a list of key/value mappings, where each mapping corresponds
to a chunk to be included in the stratum; the mappings may use the
following keys: `name` is the chunk's name (may be different from the
morphology name), `repo` is the repository in which to find (defaults to
@@ -121,13 +121,13 @@ For strata, use the following fields:
of the morphology to use and is optional. In addition to these keys,
each of the sources MUST specify a list of build dependencies using the
`build-depends` field. This field may be omitted to make the source
- depend on all other chunks that are listed earlier in the `sources`
+ depend on all other chunks that are listed earlier in the `chunks`
list. The field may be an empty list to indicate that the chunk does
not depend on anything else in the same stratum. To specify one ore
more chunk dependencies, `build-depends` needs to be set to a list
that contains the names of chunks that the source depends on in the
same stratum. These names correspond to the values of the `name`
- fields of the other sources.
+ fields of the other chunks.
For systems, use the following fields:
@@ -158,7 +158,7 @@ Example stratum:
{
"name": "foundation",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "fhs-dirs",
"ref": "baserock/bootstrap",
diff --git a/morphlib/app.py b/morphlib/app.py
index 2b848edc..5cb620eb 100755
--- a/morphlib/app.py
+++ b/morphlib/app.py
@@ -245,7 +245,7 @@ class Morph(cliapp.Application):
queue.extend((reponame, ref, '%s.morph' % s)
for s in morphology['build-depends'])
queue.extend((c['repo'], c['ref'], '%s.morph' % c['morph'])
- for c in morphology['sources'])
+ for c in morphology['chunks'])
def _traverse_morphs(self, *args):
warnings.warn('_traverse_morphs is deprecated, '
diff --git a/morphlib/artifactresolver.py b/morphlib/artifactresolver.py
index 929dae57..c6e7fbf3 100644
--- a/morphlib/artifactresolver.py
+++ b/morphlib/artifactresolver.py
@@ -197,7 +197,7 @@ class ArtifactResolver(object):
processed_artifacts = []
name_to_processed_artifact = {}
- for info in stratum.source.morphology['sources']:
+ for info in stratum.source.morphology['chunks']:
chunk_source = self._source_pool.lookup(
info['repo'],
info['ref'],
diff --git a/morphlib/artifactresolver_tests.py b/morphlib/artifactresolver_tests.py
index 5869cb27..952ffd85 100644
--- a/morphlib/artifactresolver_tests.py
+++ b/morphlib/artifactresolver_tests.py
@@ -56,9 +56,9 @@ class FakeStratumMorphology(morphlib.morph2.Morphology):
assert(isinstance(build_depends, list))
if source_list:
- sources = []
+ chunks = []
for source_name, morph, repo, ref in source_list:
- sources.append({
+ chunks.append({
'name': source_name,
'morph': morph,
'repo': repo,
@@ -69,11 +69,11 @@ class FakeStratumMorphology(morphlib.morph2.Morphology):
"name": "%s",
"kind": "stratum",
"build-depends": %s,
- "sources": %s
+ "chunks": %s
}
''' % (name,
json.dumps(build_depends),
- json.dumps(sources)))
+ json.dumps(chunks)))
else:
text = ('''
{
@@ -497,7 +497,7 @@ class ArtifactResolverTests(unittest.TestCase):
{
"name": "stratum",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "chunk1",
"repo": "repo",
@@ -647,7 +647,7 @@ class ArtifactResolverTests(unittest.TestCase):
{
"name": "stratum",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "chunk",
"repo": "repo",
@@ -701,7 +701,7 @@ class ArtifactResolverTests(unittest.TestCase):
{
"name": "stratum",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "chunk1",
"repo": "repo",
@@ -744,7 +744,7 @@ class ArtifactResolverTests(unittest.TestCase):
{
"name": "stratum",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "chunk",
"repo": "repo",
diff --git a/morphlib/cachekeycomputer_tests.py b/morphlib/cachekeycomputer_tests.py
index 3aba2175..24cc636d 100644
--- a/morphlib/cachekeycomputer_tests.py
+++ b/morphlib/cachekeycomputer_tests.py
@@ -49,7 +49,7 @@ class CacheKeyComputerTests(unittest.TestCase):
'stratum.morph': '''{
"name": "stratum",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "chunk",
"repo": "repo",
@@ -60,7 +60,7 @@ class CacheKeyComputerTests(unittest.TestCase):
'stratum2.morph': '''{
"name": "stratum2",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "chunk2",
"repo": "repo",
diff --git a/morphlib/morph2.py b/morphlib/morph2.py
index ad9e1d89..d4d9fe07 100644
--- a/morphlib/morph2.py
+++ b/morphlib/morph2.py
@@ -31,8 +31,7 @@ class Morphology(object):
('build-commands', None),
('test-commands', None),
('install-commands', None),
- ('chunks', {}),
- ('sources', []),
+ ('chunks', []),
('strata', []),
('max-jobs', None),
('description', ''),
@@ -80,7 +79,7 @@ class Morphology(object):
self._set_stratum_defaults()
def _set_stratum_defaults(self):
- for source in self['sources']:
+ for source in self['chunks']:
if 'repo' not in source:
source['repo'] = source['name']
if 'morph' not in source:
diff --git a/morphlib/morph2_tests.py b/morphlib/morph2_tests.py
index bed6b918..b7d0a7c8 100644
--- a/morphlib/morph2_tests.py
+++ b/morphlib/morph2_tests.py
@@ -38,7 +38,7 @@ class MorphologyTests(unittest.TestCase):
self.assertEqual(m['test-commands'], None)
self.assertEqual(m['install-commands'], None)
self.assertEqual(m['max-jobs'], None)
- self.assertEqual(m['chunks'], {})
+ self.assertEqual(m['chunks'], [])
def test_makes_max_jobs_be_an_integer(self):
m = Morphology('''
@@ -51,12 +51,12 @@ class MorphologyTests(unittest.TestCase):
self.assertEqual(m['max-jobs'], 42)
- def test_sets_stratum_sources_repo_and_morph_from_name(self):
+ def test_sets_stratum_chunks_repo_and_morph_from_name(self):
m = Morphology('''
{
"name": "foo",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "le-chunk"
}
@@ -64,9 +64,9 @@ class MorphologyTests(unittest.TestCase):
}
''')
- self.assertEqual(m['sources'][0]['repo'], 'le-chunk')
- self.assertEqual(m['sources'][0]['morph'], 'le-chunk')
- self.assertEqual(m['sources'][0]['build-depends'], None)
+ self.assertEqual(m['chunks'][0]['repo'], 'le-chunk')
+ self.assertEqual(m['chunks'][0]['morph'], 'le-chunk')
+ self.assertEqual(m['chunks'][0]['build-depends'], None)
def test_parses_system_disk_size(self):
m = Morphology('''
diff --git a/morphlib/morphologyfactory.py b/morphlib/morphologyfactory.py
index ab56afde..a4e7b4e8 100644
--- a/morphlib/morphologyfactory.py
+++ b/morphlib/morphologyfactory.py
@@ -109,7 +109,7 @@ class MorphologyFactory(object):
def _check_and_tweak_stratum(self, morphology, reponame, sha1, filename):
'''Check and tweak a stratum morphology.'''
- for source in morphology['sources']: # pragma: no cover
+ for source in morphology['chunks']: # pragma: no cover
if source.get('build-depends', None) is None:
name = source.get('name', source.get('repo', 'unknown'))
raise morphlib.Error('No build dependencies '
diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py
index e5c5fb44..4eede82c 100644
--- a/morphlib/plugins/branch_and_merge_plugin.py
+++ b/morphlib/plugins/branch_and_merge_plugin.py
@@ -125,7 +125,7 @@ class BranchAndMergePlugin(cliapp.Plugin):
def morphs_for_repo(cls, app, morphs_dirname, repo):
for filename, morph in cls.load_morphologies(morphs_dirname):
if morph['kind'] == 'stratum':
- for spec in morph['sources']:
+ for spec in morph['chunks']:
spec_repo = cls.resolve_reponame(app, spec['repo'])
if spec_repo == repo:
yield filename, morph
@@ -134,7 +134,7 @@ class BranchAndMergePlugin(cliapp.Plugin):
@classmethod
def find_edit_ref(cls, app, morphs_dirname, repo):
for filename, morph in cls.morphs_for_repo(app, morphs_dirname, repo):
- for spec in morph['sources']:
+ for spec in morph['chunks']:
spec_repo = cls.resolve_reponame(app, spec['repo'])
if spec_repo == repo:
return spec['ref']
@@ -168,7 +168,7 @@ class BranchAndMergePlugin(cliapp.Plugin):
app.status(msg='Petrifying %(filename)s', filename=filename)
- for source in morph['sources']:
+ for source in morph['chunks']:
reponame = source.get('repo', source['name'])
ref = source['ref']
app.status(msg='Looking up sha1 for %(repo_name)s %(ref)s',
@@ -318,7 +318,7 @@ class BranchAndMergePlugin(cliapp.Plugin):
for filename, morph in self.morphs_for_repo(app, morphs_dirname, repo):
changed = False
- for spec in morph['sources']:
+ for spec in morph['chunks']:
spec_repo = self.resolve_reponame(app, spec['repo'])
if spec_repo == repo and spec['ref'] != system_branch:
app.status(msg='Replacing ref "%(ref)s" with "%(branch)s"'
diff --git a/scripts/clean-git-cache b/scripts/clean-git-cache
index bcc106aa..c52e40d8 100755
--- a/scripts/clean-git-cache
+++ b/scripts/clean-git-cache
@@ -191,10 +191,10 @@ class CleanGitCache(cliapp.Application):
tree = json.loads(self._cat_file(morphs_dir, morphs_ref, filename))
- if tree['kind'] != 'stratum' or 'sources' not in tree:
+ if tree['kind'] != 'stratum' or 'chunks' not in tree:
continue
- for chunk in tree['sources']:
+ for chunk in tree['chunks']:
repo = chunk['repo']
directory = quote_url(self.resolver.pull_url(repo))
gits_in_use_list.append(directory)
diff --git a/tests.as-root/disk-builds-rootfs-and-kernel.script b/tests.as-root/disk-builds-rootfs-and-kernel.script
index 3b3c62c4..aacebae8 100755
--- a/tests.as-root/disk-builds-rootfs-and-kernel.script
+++ b/tests.as-root/disk-builds-rootfs-and-kernel.script
@@ -43,7 +43,7 @@ cat <<EOF >stratum.morph
{
"name": "stratum",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "hello",
"repo": "test:chunk-repo",
diff --git a/tests.as-root/make-patch.script b/tests.as-root/make-patch.script
index bd14c5a9..9fd58303 100755
--- a/tests.as-root/make-patch.script
+++ b/tests.as-root/make-patch.script
@@ -24,7 +24,7 @@ cat <<EOF > "$DATADIR/morphs-repo/hello-stratum.morph"
{
"name": "hello-stratum",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "hello",
"repo": "test:chunk-repo",
diff --git a/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script b/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script
index 30055745..ed1dd642 100755
--- a/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script
+++ b/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script
@@ -45,7 +45,7 @@ cat <<EOF >stratum.morph
{
"name": "stratum",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "hello",
"repo": "test:chunk-repo",
diff --git a/tests.as-root/setup b/tests.as-root/setup
index 7564292a..5b63b685 100755
--- a/tests.as-root/setup
+++ b/tests.as-root/setup
@@ -90,7 +90,7 @@ cat <<EOF > hello-stratum.morph
{
"name": "hello-stratum",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "hello",
"repo": "test:chunk-repo",
diff --git a/tests.as-root/syslinux-disk-builds-rootfs-and-kernel.script b/tests.as-root/syslinux-disk-builds-rootfs-and-kernel.script
index f23ac55f..7f2a6f01 100755
--- a/tests.as-root/syslinux-disk-builds-rootfs-and-kernel.script
+++ b/tests.as-root/syslinux-disk-builds-rootfs-and-kernel.script
@@ -50,7 +50,7 @@ cat <<EOF >stratum.morph
{
"name": "stratum",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "hello",
"repo": "test:chunk-repo",
diff --git a/tests.as-root/syslinux-fails-if-no-mbr-found.script b/tests.as-root/syslinux-fails-if-no-mbr-found.script
index ef0cf33d..3e46f918 100755
--- a/tests.as-root/syslinux-fails-if-no-mbr-found.script
+++ b/tests.as-root/syslinux-fails-if-no-mbr-found.script
@@ -50,7 +50,7 @@ cat <<EOF >stratum.morph
{
"name": "stratum",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "hello",
"repo": "test:chunk-repo",
diff --git a/tests.as-root/system-overlap.script b/tests.as-root/system-overlap.script
index 4b39aa04..17f1bf17 100755
--- a/tests.as-root/system-overlap.script
+++ b/tests.as-root/system-overlap.script
@@ -43,7 +43,7 @@ cat <<EOF >foo-baz-stratum.morph
{
"name": "foo-baz-stratum",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "overlap-foo-baz",
"repo": "test:chunk-repo",
@@ -63,7 +63,7 @@ cat <<EOF >foo-barqux-stratum.morph
{
"name": "foo-barqux-stratum",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "overlap-foobar",
"repo": "test:chunk-repo",
diff --git a/tests.branching/edit-updates-stratum.stdout b/tests.branching/edit-updates-stratum.stdout
index 71038a16..e58e8187 100644
--- a/tests.branching/edit-updates-stratum.stdout
+++ b/tests.branching/edit-updates-stratum.stdout
@@ -1,5 +1,5 @@
diff --git a/hello-stratum.morph b/hello-stratum.morph
-index 77fb1d0..c5ed672 100644
+index 06ae459..ad8c08b 100644
--- a/hello-stratum.morph
+++ b/hello-stratum.morph
@@ -1,12 +1,14 @@
@@ -7,9 +7,7 @@ index 77fb1d0..c5ed672 100644
- "name": "hello-stratum",
- "kind": "stratum",
+ "build-system": "manual",
-+ "kind": "stratum",
-+ "name": "hello-stratum",
- "sources": [
+ "chunks": [
{
- "name": "hello",
- "ref": "master",
@@ -21,5 +19,8 @@ index 77fb1d0..c5ed672 100644
+ "ref": "newbranch",
+ "repo": "baserock:hello"
}
- ]
+- ]
++ ],
++ "kind": "stratum",
++ "name": "hello-stratum"
}
diff --git a/tests.branching/petrify.stdout b/tests.branching/petrify.stdout
index 1ef133aa..ea0fb795 100644
--- a/tests.branching/petrify.stdout
+++ b/tests.branching/petrify.stdout
@@ -1,8 +1,6 @@
{
"build-system": "manual",
- "kind": "stratum",
- "name": "hello-stratum",
- "sources": [
+ "chunks": [
{
"build-depends": [],
"morph": "hello",
@@ -10,5 +8,7 @@
"ref": "f4d032b42c0134e67bdf19a43fa99072493667d7",
"repo": "baserock:hello"
}
- ]
+ ],
+ "kind": "stratum",
+ "name": "hello-stratum"
}
diff --git a/tests.branching/setup b/tests.branching/setup
index 84d1d545..b062f379 100755
--- a/tests.branching/setup
+++ b/tests.branching/setup
@@ -72,7 +72,7 @@ cat <<EOF > "$DATADIR/morphs/hello-stratum.morph"
{
"name": "hello-stratum",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "hello",
"ref": "master",
diff --git a/tests/build-stratum-with-submodules.script b/tests/build-stratum-with-submodules.script
index c2d97817..fee57d7c 100755
--- a/tests/build-stratum-with-submodules.script
+++ b/tests/build-stratum-with-submodules.script
@@ -49,7 +49,7 @@ cat <<EOF > "$morphs/submod-stratum.morph"
{
"name": "submod-stratum",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "parent",
"repo": "test:parent-repo",
diff --git a/tests/hello-stratum.morph b/tests/hello-stratum.morph
index 11ac4e1c..d5b97365 100644
--- a/tests/hello-stratum.morph
+++ b/tests/hello-stratum.morph
@@ -1,7 +1,7 @@
{
"name": "hello",
"kind": "stratum",
- "sources": {
+ "chunks": {
"hello": {
"repo": "hello",
"ref": "master"
diff --git a/tests/morphless-chunks.script b/tests/morphless-chunks.script
index 41137d68..8ef653f6 100755
--- a/tests/morphless-chunks.script
+++ b/tests/morphless-chunks.script
@@ -46,7 +46,7 @@ cat << EOF > alfred.morph
{
"name": "alfred",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "morphless",
"repo": "test:morphless",
diff --git a/tests/setup b/tests/setup
index 8d3ab5b5..19c400fa 100755
--- a/tests/setup
+++ b/tests/setup
@@ -90,7 +90,7 @@ cat <<EOF > hello-stratum.morph
{
"name": "hello-stratum",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "hello",
"repo": "test:chunk-repo",
diff --git a/tests/show-dependencies.setup b/tests/show-dependencies.setup
index d30e22bf..924a626b 100755
--- a/tests/show-dependencies.setup
+++ b/tests/show-dependencies.setup
@@ -78,7 +78,7 @@ cat <<EOF > gtk-stack.morph
"kind": "stratum",
"build-depends": [
],
- "sources": [
+ "chunks": [
{
"name": "freetype",
"repo": "test:test-repo",
@@ -200,7 +200,7 @@ cat <<EOF > xfce-core.morph
"build-depends": [
"gtk-stack"
],
- "sources": [
+ "chunks": [
{
"name": "libxfce4util",
"repo": "test:test-repo",
diff --git a/tests/stratum-overlap-warns.setup b/tests/stratum-overlap-warns.setup
index 4dff3ddb..a699bf2d 100755
--- a/tests/stratum-overlap-warns.setup
+++ b/tests/stratum-overlap-warns.setup
@@ -29,7 +29,7 @@ cat <<EOF >overlap-stratum.morph
{
"name": "overlap-stratum",
"kind": "stratum",
- "sources": [
+ "chunks": [
{
"name": "dirs",
"repo": "test:chunk-repo",