Bug#210920: main-menu: "Parallel package" detection is broken
Package: main-menu
Version: 0.037 (not installed)
Severity: normal
Tags: patch
main-menu is supposed to skip a package if a "parallel package" already
is installed (for instance, grub-installer if lilo-installer is already
installed), but fails to do so. The reason is that the isdefault()
heuristics seem to override the "parallel package" check altogether --
the included patch makes only menutest scripts override the check, while
the usual heuristics (package can be default if it is not configured)
are subject to "parallel package" checking.
-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux dessverre 2.4.20-k7 #1 Tue Jan 14 00:29:06 EST 2003 i686
Locale: LANG=C, LC_CTYPE=en_US.ISO8859-1
? main-menu-parallel-fix.diff
Index: main-menu.c
===================================================================
RCS file: /cvs/debian-boot/debian-installer/main-menu/main-menu.c,v
retrieving revision 1.82
diff -u -r1.82 main-menu.c
--- main-menu.c 28 Jul 2003 13:16:09 -0000 1.82
+++ main-menu.c 14 Sep 2003 18:07:39 -0000
@@ -51,14 +51,17 @@
(*(struct package_t **)a)->package);
}
-/* Returns true if the given package could be the default menu item. */
+/*
+ * Returns 1 if the given package _should_ be the default menu item (the
+ * menutest script said so), 2 if the given package _could_ be the default
+ * menu item (it is unpacked or half-configured). */
int isdefault(struct package_t *p) {
int check;
check = check_script(p, "menutest");
if (check == -1) {
if (p->status == unpacked || p->status == half_configured) {
- return 1;
+ return 2;
}
else {
return 0;
@@ -104,7 +107,7 @@
{
struct package_t *p, *q;
struct list_node *node;
- int i, cont;
+ int i, cont, def;
/* Traverse the list, return the first menu item that isn't installed */
for (node = list->head; node != NULL; node = node->next) {
@@ -112,7 +115,10 @@
if (!p->installer_menu_item || p->status == installed || !check_script(p, "isinstallable"))
continue;
/* If menutest says this item should be default, make it so */
- if (isdefault(p))
+ def = isdefault(p);
+ if (def == 0)
+ continue;
+ if (def == 1)
return p;
cont = 0;
/* Check if a "parallel" package is installed
Reply to: