[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#202562: various debconf usage problems



Package: yaboot-installer
Version: 0.0.4
Severity: grave
Tags: patch

All the debconf questions in yaboot-installer are missing priorities in
the calls to debconf->command(debconf, "input", ...).

debconf->value after a "go" is "ok" instead of the selected item. You
have to issue debconf->command(debconf, "get", ...) first.

The patch below fixes these two problems.
some comments:
1. I tried to assign reasonable debconf priorities. 
- Critical for all fatal errors 
- low for the partition selection (one normaly only has 1 bootstrap
partition)
- high for non fatal errors
- medium for the success message, probably this could also be low
because you may assume that it was successful if nothing is shown.

2. I added exit(1); calls to the cases where yabootconfig fails and when
no bootstrap partition is found. I think these failures are fatal and
there is no sense in continuing.

3. debconf substitutions are case sensitive. It has to be called
"devices" instead of "DEVICES" if it's lowercase in the themplate.

4. If the return value of the bootpart selection is used directly as
path to the boot partition, we cannot add descriptions like the disk
model. So I removed this.

gaudenz
Index: choose-yaboot-disk.c
===================================================================
RCS file: /cvs/debian-boot/debian-installer/tools/yaboot-installer/choose-yaboot-disk.c,v
retrieving revision 1.4
diff -u -r1.4 choose-yaboot-disk.c
--- choose-yaboot-disk.c	17 Jun 2003 21:36:57 -0000	1.4
+++ choose-yaboot-disk.c	23 Jul 2003 09:04:56 -0000
@@ -181,10 +181,7 @@
 char *build_choice(PedPartition *part) {
 	char *string = NULL;
 
-	asprintf(&string, "%s (Typ: %s)",
-		ped_partition_get_path(part),
-		part->disk->dev->model);
-
+        asprintf(&string, "%s", ped_partition_get_path(part));
 	return(strdup(string));
 }
 
@@ -219,7 +216,7 @@
 		debconf->command(debconf, "fset", "yaboot-installer/wrongmac",
 			"seen", "false", NULL);
 		debconf->command(debconf, "set", "yaboot-installer/wrongmac", "false", NULL);
-		debconf->command(debconf, "input", "yaboot-installer/wrongmac", NULL);
+		debconf->command(debconf, "input", "critical", "yaboot-installer/wrongmac", NULL);
 		debconf->command(debconf, "go", NULL);
 		exit(1);
 	}
@@ -233,7 +230,7 @@
 		debconf->command(debconf, "fset", "yaboot-installer/nopart",
 			"seen", "false", NULL);
 		debconf->command(debconf, "set", "yaboot-installer/nopart", "false", NULL);
-		debconf->command(debconf, "input", "yaboot-installer/nopart", NULL);
+		debconf->command(debconf, "input", "critical", "yaboot-installer/nopart", NULL);
 		debconf->command(debconf, "go", NULL);
 		exit(1);
 	}
@@ -243,7 +240,7 @@
 		debconf->command(debconf, "fset", "yaboot-installer/noroot",
 			"seen", "false", NULL);
 		debconf->command(debconf, "set", "yaboot-installer/noroot", "false", NULL);
-		debconf->command(debconf, "input", "yaboot-installer/noroot", NULL);
+		debconf->command(debconf, "input", "critical", "yaboot-installer/noroot", NULL);
 		debconf->command(debconf, "go", NULL);
 		exit(1);
 	}
@@ -266,18 +263,20 @@
 
 	/* ask for boot partition */
 	debconf->command(debconf, "subst", "yaboot-installer/bootdev",
-		"DEVICES", choices, NULL);
+		"devices", choices, NULL);
 	debconf->command(debconf, "fset", "yaboot-installer/bootdev",
 		"seen", "false", NULL);
 	debconf->command(debconf, "set", "yaboot-installer/bootdev", "false", NULL);
-	debconf->command(debconf, "input", "yaboot-installer/bootdev", NULL);
+	debconf->command(debconf, "input", "low", "yaboot-installer/bootdev", NULL);
 	debconf->command(debconf, "go", NULL);
+	debconf->command(debconf, "get", "yaboot-installer/bootdev", NULL);
 	if(strcmp(debconf->value, "") == 0) {
 		debconf->command(debconf, "fset", "yaboot-installer/nopart",
 			"seen", "false", NULL);
 		debconf->command(debconf, "set", "yaboot-installer/nopart", "false", NULL);
-		debconf->command(debconf, "input", "yaboot-installer/nopart", NULL);
+		debconf->command(debconf, "input", "critical", "yaboot-installer/nopart", NULL);
 		debconf->command(debconf, "go", NULL);
+                exit(1);
 	}
 
 	/* update the kernel config file */
@@ -286,7 +285,7 @@
 		debconf->command(debconf, "fset", "yaboot-installer/kconferr",
 			"seen", "false", NULL);
 		debconf->command(debconf, "set", "yaboot-installer/kconferr", "false", NULL);
-		debconf->command(debconf, "input", "yaboot-installer/kconferr", NULL);
+		debconf->command(debconf, "input", "high", "yaboot-installer/kconferr", NULL);
 		debconf->command(debconf, "go", NULL);
 	}
 
@@ -296,8 +295,9 @@
 		debconf->command(debconf, "fset", "yaboot-installer/conferr",
 			"seen", "false", NULL);
 		debconf->command(debconf, "set", "yaboot-installer/conferr", "false", NULL);
-		debconf->command(debconf, "input", "yaboot-installer/conferr", NULL);
+		debconf->command(debconf, "input", "critical", "yaboot-installer/conferr", NULL);
 		debconf->command(debconf, "go", NULL);
+                exit(1);
 	}
 	
 	/* running "ybin" */
@@ -306,14 +306,14 @@
 		debconf->command(debconf, "fset", "yaboot-installer/ybinerr",
 			"seen", "false", NULL);
 		debconf->command(debconf, "set", "yaboot-installer/ybinerr", "false", NULL);
-		debconf->command(debconf, "input", "yaboot-installer/ybinerr", NULL);
+		debconf->command(debconf, "input", "critical", "yaboot-installer/ybinerr", NULL);
 		debconf->command(debconf, "go", NULL);
 		return(1);
 	}
 	
 	debconf->command(debconf, "fset", "yaboot-installer/success", "seen", "false", NULL);
 	debconf->command(debconf, "set", "yaboot-installer/success", "false", NULL);
-	debconf->command(debconf, "input", "yaboot-installer/success", NULL);
+	debconf->command(debconf, "input", "medium", "yaboot-installer/success", NULL);
 	debconf->command(debconf, "go", NULL);
 	return(0);
 }

Reply to: