From bd83a9f24150ba00f9a11219b301850fdb166012 Mon Sep 17 00:00:00 2001 From: "Achim D. Brucker" Date: Sat, 9 Jan 2021 19:11:06 +0000 Subject: [PATCH] Factored configuration in separate file. --- build.sh | 5 +---- config | 34 ++++++++++++++++++++++++++++++++++ isabelle/hooks/build | 9 ++++++++- 3 files changed, 43 insertions(+), 5 deletions(-) create mode 100755 config diff --git a/build.sh b/build.sh index c1fe2c2..0ec4cb1 100755 --- a/build.sh +++ b/build.sh @@ -27,10 +27,7 @@ set -e -VERSION=${1:-2020} -SESSIONS=${2:-"HOL"} -CONTAINER=${3:-docker} -DOCKERUID=${4:-`id -u`} +source config LATEST="2020" diff --git a/config b/config new file mode 100755 index 0000000..74eae18 --- /dev/null +++ b/config @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright (c) 2019-2021 Achim D. Brucker +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# SPDX-License-Identifier: BSD-2-Clause + +set -e + +VERSION=${1:-2020} +SESSIONS=${2:-"HOL"} +CONTAINER=${3:-docker} +DOCKERUID=${4:-`id -u`} +LATEST="2020" diff --git a/isabelle/hooks/build b/isabelle/hooks/build index 2e715af..04ec78b 100755 --- a/isabelle/hooks/build +++ b/isabelle/hooks/build @@ -27,7 +27,14 @@ set -e -CONTAINER=${CONTAINER:-docker} +if [ -f ../../config ]; then + source ../../config +else + CONFIG=`git rev-parse --show-toplevel`/config + if [ -f $CONFIG ]; + source $CONFIG + fi +fi # Generate Isabelle image ISA_URL="https://isabelle.in.tum.de/website-Isabelle"$VERSION"/dist/Isabelle"$VERSION"_linux.tar.gz"