Two bugs here:
1. printf to stdout is bad, it mucks with debconf and we die, changed to stderr.
2. If a postinst failed udpkg marks the package as half-configured.  Without
this patch main-menu will then refuse to run the postinst again, because it only
cares about installed and unpacked packages.  That's no fun b/c the module
failed, and I'd like to try again. Maybe it is udpkg's fault, but I think it's 
main-menu's.

-David


Index: main-menu.c
===================================================================
RCS file: /cvs/debian-boot/debian-installer/main-menu/main-menu.c,v
retrieving revision 1.22
diff -u -r1.22 main-menu.c
--- main-menu.c 2000/12/12 04:15:16     1.22
+++ main-menu.c 2000/12/31 13:53:26
@@ -176,12 +176,12 @@
        struct package_t *head = NULL, *tail = NULL;
        
        if (p->status == installed) {
-               printf("already installed\n");
+               fprintf(stderr, "already installed\n");
                /* The menu item is already configured, so reconfigure it. */
                sprintf(configcommand, "dpkg-reconfigure %s", p->package);
                return ! SYSTEM(configcommand);
        }
-       else if (p->status == unpacked) {
+       else if (p->status == unpacked || p->status == half_configured) {
                /*
                 * The menu item is not yet configured. Make sure everything
                 * it depends on is configured, then configure it.
@@ -189,7 +189,7 @@
                order(p, &head, &tail);
                order_done(head);
                for (p = head; p; p = p->next) {
-                       if (p->status == unpacked) {
+                       if (p->status == unpacked || p->status == half_configured) {
                                sprintf(configcommand, DPKG_CONFIGURE_COMMAND " %s", 
p->package);
                                if (SYSTEM(configcommand) != 0)
                                        return 0; /* give up on failure */
Index: main-menu.h
===================================================================
RCS file: /cvs/debian-boot/debian-installer/main-menu/main-menu.h,v
retrieving revision 1.17
diff -u -r1.17 main-menu.h
--- main-menu.h 2000/12/21 22:58:27     1.17
+++ main-menu.h 2000/12/31 13:53:26
@@ -18,7 +18,7 @@
 #define MAIN_MENU      "debian-installer/main-menu"
 #define DPKG_CONFIGURE_COMMAND "/usr/bin/udpkg --configure"
 
-typedef enum { unpacked, installed, other } package_status;
+typedef enum { unpacked, installed, half_configured, other } package_status;
 
 struct package_t {
        char *package;
Index: status.c
===================================================================
RCS file: /cvs/debian-boot/debian-installer/main-menu/status.c,v
retrieving revision 1.14
diff -u -r1.14 status.c
--- status.c    2000/11/29 02:30:30     1.14
+++ status.c    2000/12/31 13:53:26
@@ -47,6 +47,9 @@
                        if (strstr(buf, " unpacked")) {
                                p->status = unpacked;
                        }
+                       else if (strstr(buf, " half-configured")) {
+                               p->status = half_configured;
+                       }
                        else if (strstr(buf, " installed")) {
                                p->status = installed;
                        }


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to