summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2009-10-30 12:29:05 +0100
committerDaniel Baumann <daniel@debian.org>2011-03-09 19:09:48 +0100
commit5cc363b06ec020f6fd38139932a66e1c6183079a (patch)
tree1e607300840d2845d02cc3c6b01e6f64b7e06d7e /functions
parent2e2de4361d4549021ab6d62226257d68b88d25fe (diff)
downloadvyos-live-build-5cc363b06ec020f6fd38139932a66e1c6183079a.tar.gz
vyos-live-build-5cc363b06ec020f6fd38139932a66e1c6183079a.zip
Adding check for config tree version and fail or give warnings if the version doesn't match.
Diffstat (limited to 'functions')
-rwxr-xr-xfunctions/defaults.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/functions/defaults.sh b/functions/defaults.sh
index 94ae0662b..d8967a08c 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -1019,6 +1019,28 @@ Set_defaults ()
Check_defaults ()
{
+ if [ "${LH_CONFIG_VERSION}" ]
+ then
+ # We're only checking when we're actually running the checks
+ # that's why the check for emptyness of the version;
+ # however, as live-helper always declares LH_CONFIG_VERSION
+ # internally, this is safe assumption (no cases where it's unset,
+ # except when bootstrapping the functions/defaults etc.).
+ CURRENT_CONFIG_VERSION="$(echo ${LH_CONFIG_VERSION} | awk -F. '{ print $1 }')"
+
+ if [ ${CURRENT_CONFIG_VERSION} -ge 2 ]
+ then
+ Echo_error "This config tree is too new for this version of live-helper (${VERSION})."
+ Echo_error "Aborting build, please get a new version of live-helper."
+
+ exit 1
+ elif [ ${CURRENT_CONFIG_VERSION} -lt 1 ]
+ then
+ Echo_warning "This config tree does not specify a format version or has an unknown version number."
+ Echo_warning "Continueing build, but it could lead to errors or different results. Please repopulate the config tree."
+ fi
+ fi
+
if [ "${LH_DISTRIBUTION}" = "etch" ]
then
# etch + live-initramfs