Bug#211069: Fixed patch
The previous patch didn't quite work as intended -- try this one instead (it
has actually been tested in a live d-i environment :-) ).
/* Steinar */
--
Homepage: http://www.sesse.net/
Index: tools/autopartkit/autopartkit.c
===================================================================
RCS file: /cvs/debian-boot/debian-installer/tools/autopartkit/autopartkit.c,v
retrieving revision 1.63
diff -u -r1.63 autopartkit.c
--- tools/autopartkit/autopartkit.c 16 Aug 2003 22:57:46 -0000 1.63
+++ tools/autopartkit/autopartkit.c 18 Sep 2003 19:13:36 -0000
@@ -205,19 +205,6 @@
client->command(client, "TITLE", new_title, NULL);
}
-static int mydebconf_bool(char *priority, char *template)
-{
- const char *value;
-
- value = mydebconf_input(priority, template);
- if (strstr(value, "true"))
- return 1;
- if (strstr(value, "false"))
- return 0;
- mydebconf_debug("unknown bool value", value);
- return 0;
-}
-
void autopartkit_log(const int level, const char * format, ...)
{
int LOGLIMIT = 1;
@@ -228,18 +215,26 @@
vsyslog(LOG_DEBUG, format, ap);
va_end(ap);
}
+
+/* note: only fsets seen=true if the user answered yes */
static void autopartkit_confirm(void)
{
- static int confirm = 0;
- if (confirm)
- return;
- if (mydebconf_bool("critical", "autopartkit/confirm"))
- {
- confirm = 1;
- return;
- } else {
- exit(EXIT_FAILURE);
+ client->command (client, "FGET", "autopartkit/confirm", "seen", NULL);
+ if (!strstr(client->value, "true")) {
+ client->command (client, "INPUT", "critical", "autopartkit/confirm", NULL);
+ client->command (client, "GO", NULL);
}
+
+ client->command (client, "GET", "autopartkit/confirm", NULL);
+ if (strstr(client->value, "true"))
+ return;
+
+ client->command (client, "FSET", "autopartkit/confirm", "seen", "false", NULL);
+
+ if (strstr(client->value, "false"))
+ exit(EXIT_FAILURE);
+ mydebconf_debug("unknown bool value", client->value);
+ exit(EXIT_FAILURE);
}
static void disable_kmsg(int disable)
@@ -1354,7 +1349,7 @@
autopartkit_error(1, "usage: %s <debconf-template>\n", argv[0]);
disk_reqs = load_partitions(tablefile);
-
+
/* Step 1 & 2 : discover & choose device */
dev = choose_device();
if (! dev)
Reply to: