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

Small change to main-menu



There are several packages that we do want to list during package selection 
in anna, but that should not be listed in the main menu.
The current list I'm aware of is:
- openssh-client-udeb
- fdisk-udeb
- cfdisk-udeb
- parted-udeb

One of the main deciding factors to list a component in anna is the 
menu-item-number.

Already a few years ago Colin forced the display of openssh by adding a 
dummy menu item number (999, now 99900) in its control file, while at the 
same time adding an isinstallable script to block display in the main menu.

Recently I submitted patches for fdisk, cfdisk and parted to do the same, 
but (my bad) overlooked the need for the isinstallable file. Consequence is 
that currently fdisk is listed in the main menu (before lilo-installer) :-(

Instead of asking isinstallable files to be added to util-linux, I intend to 
commit the patch below to main-menu as an implementation of formal support 
for this use case. It checks the menu item and, if it is 99999 or 99900 it 
is marked uninstallable and will thus not be displayed.
This is not the most beautiful solution, but IMO it is much better than 
having both dummy menu item numbers _and_ dummy isinstallable files.

After the upload, I will submit patches to the relevant packages to have 
99900 changed to 99999 and to drop openssh's isinstallable file [1]. After 
that the check for 99900 can be removed from main-menu.
Of course installer/doc/devel/menu-item-numbers.txt will document the new 
special value.

Cheers,
FJP

[1] The last should probably only be done after Beta2 to avoid openssh 
showing up in the main menu for Beta1 after it migrates to testing.

diff --git a/packages/main-menu/main-menu.c b/packages/main-menu/main-menu.c
index 58b2b81..284f023 100644
--- a/packages/main-menu/main-menu.c
+++ b/packages/main-menu/main-menu.c
@@ -81,9 +81,19 @@ int isdefault(di_system_package *p) {
 	return false;
 }
 
+/*
+ * Menu items with a number equal to 99999 or 99900 (deprecated) are
+ * intended only to be shown during package selection in anna, but not
+ * in the main menu, so mark them uninstallable.
+ * For other packages, run the isinstallble maintainer script and check
+ * its return code.
+ */
 bool isinstallable(di_system_package *p) {
 	int check;
 
+	if ((p->installer_menu_item == 99999) || (p->installer_menu_item == 99900))
+		return false;
+
 	check = di_system_dpkg_package_control_file_exec(&p->p, "isinstallable", 0, NULL);
 	if (check <= 0)
 		return true;

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: