On Tue, 11 Sep 2007 09:40:42 -0300
Ben Armstrong <[EMAIL PROTECTED]> wrote:
> But ... I don't know how to fix this.  lh_config calls Set_defaults
> before rewriting all configs.  If we make Set_defaults responsible
> for determining "auto" values, the "autoness" is lost.  It seems
> there should be a separate step that determines at build time all
> appropriate values for any variable set to "auto" (or any other
> "derived" value that needs to be determined at build time).  I have
> not yet done a thorough review of the code to find the appropriate
> place.

I have attached a patch that fixes this by adding a 'noexpand' mode
to Set_defaults (the default being 'expand') to be called that way
only from the lh_config helper.  Any LH_ variable value that is
derived from other LH_ variables and should not be expanded until
it is used may be set in the same fashion.  There may be others in
lh_config that need similar treatment.

Ben
--
 ,-.  nSLUG    http://www.nslug.ns.ca   [EMAIL PROTECTED]
 \`'  Debian   http://www.debian.org    [EMAIL PROTECTED]
  `          [ gpg 395C F3A4 35D3 D247 1387 2D9E 5A94 F3CA 0B27 13C8 ]
             [ pgp 7F DA 09 4B BA 2C 0D E0 1B B1 31 ED C6 A9 39 4F ]
diff --git a/functions/defaults.sh b/functions/defaults.sh
index 05b1e0d..752abf6 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -11,6 +11,15 @@ set -e
 
 Set_defaults ()
 {
+	case "${1}" in
+		noexpand)
+			EXPAND="noexpand"
+			;;
+		*)
+			EXPAND="expand"
+			;;
+	esac
+		
 	## config/common
 
 	# Setting mode
@@ -168,7 +177,9 @@ Set_defaults ()
 	if [ -z "${LH_INITRAMFS}" ]
 	then
 		LH_INITRAMFS="auto"
-	else
+	fi
+	if [ "${EXPAND}" = "expand" ]
+	then
 		if [ "${LH_INITRAMFS}" = "auto" ]
 		then
 			case "${LH_MODE}" in
diff --git a/helpers/lh_config b/helpers/lh_config
index 5144c1f..52fc237 100755
--- a/helpers/lh_config
+++ b/helpers/lh_config
@@ -571,7 +571,7 @@ Read_conffile config/source
 Read_conffile "${LH_CONFIG}"
 
 # Setting defaults
-Set_defaults
+Set_defaults noexpand
 
 Local_arguments "[EMAIL PROTECTED]"
 
_______________________________________________
debian-live-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/debian-live-devel

Reply via email to