summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-10-27 12:50:35 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-10-27 15:45:55 +0000
commit946d6b530ebda661c4db0e28d8aba2570044941c (patch)
treee147767c1bf6c9c66f65a77f5398d764a540b083
parenta762f3db05b0e5561c0b7ada843154173197d1f5 (diff)
downloaddefinitions-946d6b530ebda661c4db0e28d8aba2570044941c.tar.gz
Allow mason.configure to be enabled without requiring configuration
If none of the MASON_ options are set then mason.configure will now do nothing, instead of raising an error. This is needed because mason.configure is enabled by default in the build-system.
-rw-r--r--mason.configure48
1 files changed, 29 insertions, 19 deletions
diff --git a/mason.configure b/mason.configure
index d0abbf11..621d6a31 100644
--- a/mason.configure
+++ b/mason.configure
@@ -32,13 +32,41 @@
set -e
-ROOT="$1"
+##########################################################################
+# Check variables
+##########################################################################
+
+if [ -n "$MASON_GENERIC" ]; then
+ echo Not configuring Mason, it will be generic
+ exit 0
+fi
+
+if [ -z "$MASON_CLUSTER_MORPHOLOGY" -a \
+ -z "$MASON_DEFINITIONS_REF" -a \
+ -z "$MASON_DISTBUILD_ARCH" -a \
+ -z "$MASON_TEST_HOST" ]; then
+ # No Mason options defined, do nothing.
+ exit 0
+fi
+
+if [ -z "$ARTIFACT_CACHE_SERVER" -o \
+ -z "$CONTROLLERHOST" -o \
+ -z "$MASON_CLUSTER_MORPHOLOGY" -o \
+ -z "$MASON_DEFINITIONS_REF" -o \
+ -z "$MASON_DISTBUILD_ARCH" -o \
+ -z "$MASON_TEST_HOST" -o \
+ -z "$TROVE_HOST" -o \
+ -z "$TROVE_ID" ]; then
+ echo Some options required for Mason were defined, but not all.
+ exit 1
+fi
##########################################################################
# Copy Mason files into root filesystem
##########################################################################
+ROOT="$1"
mkdir -p "$ROOT"/usr/lib/mason
cp mason/mason.sh "$ROOT"/usr/lib/mason/mason.sh
@@ -78,24 +106,6 @@ ln -s ../mason-setup.service "$ROOT"/etc/systemd/system/multi-user.target.wants/
##########################################################################
-# Check variables
-##########################################################################
-
-if [ -n "$MASON_GENERIC" ]; then
- echo Not configuring Mason, it will be generic
- exit 0
-fi
-
-if [ "$ARTIFACT_CACHE_SERVER" = "" \
- -o "$MASON_CLUSTER_MORPHOLOGY" = "" \
- -o "$MASON_DEFINITIONS_REF" = "" \
- -o "$MASON_DISTBUILD_ARCH" = "" \
- -o "$MASON_TEST_HOST" = "" ]; then
- echo Not configuring as Mason, some options not defined
- exit 1
-fi
-
-##########################################################################
# Generate config variable shell snippet
##########################################################################