[SCM] live-helper branch, master, updated. 1.0.5-2-46-g40c7fb6

Daniel Baumann daniel at debian.org
Fri Oct 30 12:46:42 UTC 2009


The following commit has been merged in the master branch:
commit 40c7fb64af20b5f64e48b961ebdc6faf3f70af4e
Author: Daniel Baumann <daniel at debian.org>
Date:   Fri Oct 30 12:29:05 2009 +0100

    Adding check for config tree version and fail or give warnings if the version doesn't match.

diff --git a/functions/defaults.sh b/functions/defaults.sh
index 94ae066..d8967a0 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

-- 
live-helper



More information about the debian-live-changes mailing list