summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-07-23 17:14:28 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2015-07-23 16:43:17 +0000
commit1ae4b3d77bdf7f666c7817346baf08129a6247f3 (patch)
tree0e7fb3cd057bc3f7b971a79dad897d1205945e32
parent79eb63a0669842e2d8eff43f42683ed9ce28383a (diff)
downloadmorph-1ae4b3d77bdf7f666c7817346baf08129a6247f3.tar.gz
Remove support for Baserock definitions format versions 0, 1 and 2
The previous release of the Baserock reference systems (baserock-15.25 tag) used Baserock definitions version 3, so this version of Morph can still build the last release of the Baserock reference systems. In the course of fixing up the cmdtest tests to use version 5 definitions, I removed a couple of bits of redundant code. Change-Id: If9d480aa966d2ea5939cf04351f3d488cccea67f
-rw-r--r--morphlib/sourceresolver.py15
-rwxr-xr-xtests.build/only-build-systems.script28
-rw-r--r--tests.build/only-build-systems.stderr2
-rwxr-xr-xtests.build/setup3
-rwxr-xr-xtests/show-dependencies.setup26
-rw-r--r--yarns/implementations.yarn2
6 files changed, 13 insertions, 63 deletions
diff --git a/morphlib/sourceresolver.py b/morphlib/sourceresolver.py
index 47d9502e..af704945 100644
--- a/morphlib/sourceresolver.py
+++ b/morphlib/sourceresolver.py
@@ -33,7 +33,7 @@ tree_cache_filename = 'trees.cache.pickle'
buildsystem_cache_size = 10000
buildsystem_cache_filename = 'detected-chunk-buildsystems.cache.pickle'
-supported_versions = [0, 1, 2, 3, 4, 5]
+supported_versions = [3, 4, 5]
class PickleCacheManager(object): # pragma: no cover
'''Cache manager for PyLRU that reads and writes to Pickle files.
@@ -320,7 +320,7 @@ class SourceResolver(object):
definitions_checkout_dir, 'VERSION')
if version_file == None:
- return 0 # Assume version 0 if no version file
+ raise InvalidVersionFileError()
version = self._parse_version_file(version_file)
@@ -421,15 +421,8 @@ class SourceResolver(object):
definitions_absref,
path)
if morphology is None:
- if definitions_version > 1:
- raise MorphologyReferenceNotFoundError(
- path, filename)
- else:
- self.status(
- msg="Warning! `%(path)s' referenced in "
- "`%(stratum)s' does not exist",
- path=path,
- stratum=filename)
+ raise MorphologyReferenceNotFoundError(
+ path, filename)
chunk_queue.add((c['repo'], c['ref'], path))
diff --git a/tests.build/only-build-systems.script b/tests.build/only-build-systems.script
deleted file mode 100755
index ae664f7e..00000000
--- a/tests.build/only-build-systems.script
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2013,2015 Codethink Limited
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-
-
-## Morph should refuse build a chunk out of the context. Only
-## system and stratum morphologies can be built.
-
-set -eu
-
-! "$SRCDIR/scripts/test-morph" build-morphology \
- test:morphs-repo master hello-stratum
-
-! "$SRCDIR/scripts/test-morph" build-morphology \
- test:chunk-repo farrokh hello
-
diff --git a/tests.build/only-build-systems.stderr b/tests.build/only-build-systems.stderr
deleted file mode 100644
index ac24ab25..00000000
--- a/tests.build/only-build-systems.stderr
+++ /dev/null
@@ -1,2 +0,0 @@
-ERROR: In order to build this stratum directly, please give the filename of the system which contains it, and the name of the stratum. See `morph build --help` for more information.
-ERROR: In order to build this chunk directly, please give the filename of the system which contains it, and the name of the chunk. See `morph build --help` for more information.
diff --git a/tests.build/setup b/tests.build/setup
index 4663ff1d..b7dc5074 100755
--- a/tests.build/setup
+++ b/tests.build/setup
@@ -81,6 +81,9 @@ mkdir "$morphsrepo"
cd "$morphsrepo"
git init --quiet
+echo 'version: 5' > VERSION
+git add VERSION
+
cat <<EOF > hello-stratum.morph
name: hello-stratum
kind: stratum
diff --git a/tests/show-dependencies.setup b/tests/show-dependencies.setup
index 38a76722..366da8ad 100755
--- a/tests/show-dependencies.setup
+++ b/tests/show-dependencies.setup
@@ -24,16 +24,9 @@ mkdir "$repo"
cd "$repo"
git init --quiet
-# Add a single source file to simulate compiling
-cat <<EOF > hello.c
-#include <stdio.h>
-int main(void)
-{
- puts("hello, world");
- return 0;
-}
-EOF
-git add hello.c
+echo 'version: 5' > VERSION
+git add VERSION
+git commit --quiet -m "add VERSION file"
# Define a couple of chunk morphologies for the GTK stack
gtkcomponents=(freetype fontconfig cairo pango glib gdk-pixbuf gtk
@@ -52,7 +45,7 @@ install-commands:
EOF
git add $component.morph
done
-git commit --quiet -m "add .c source file and GTK chunk morphologies"
+git commit --quiet -m "add GTK chunk morphologies"
# Define a stratum for the GTK stack
cat <<EOF > gtk-stack.morph
@@ -114,17 +107,6 @@ EOF
git add gtk-stack.morph
git commit --quiet -m "add gtk-stack.morph stratum"
-# Add a single source file to simulate compiling
-cat <<EOF > hello.c
-#include <stdio.h>
-int main(void)
-{
- puts("hello, world");
- return 0;
-}
-EOF
-git add hello.c
-
# Define a couple of chunk morphologies for the GTK stack
xfcecomponents=(xfce4-dev-tools libxfce4util libxfce4ui exo xfconf garcon
thunar tumbler xfce4-panel xfce4-settings xfce4-session
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn
index a57884ab..52fbd0bb 100644
--- a/yarns/implementations.yarn
+++ b/yarns/implementations.yarn
@@ -238,6 +238,8 @@ another to hold a chunk.
mkdir "$DATADIR/gits/morphs"
cd "$DATADIR/gits/morphs"
git init .
+ echo 'version: 5' > VERSION
+
arch=$(run_morph print-architecture)
install -m644 -D /dev/stdin << EOF "systems/test-system.morph"
name: test-system