Browse Source

Post-Etch development merged in from Colin's people directory:

- Avoid suppressing menu items that have never been seen before just
  because they have a lower menu item number than the last successful item

r45895
tags/1.19
Frans Pop 14 years ago
parent
commit
ec712683e5
2 changed files with 34 additions and 2 deletions
  1. +8
    -0
      debian/changelog
  2. +26
    -2
      main-menu.c

+ 8
- 0
debian/changelog View File

@@ -1,3 +1,11 @@
main-menu (1.19) UNRELEASED; urgency=low

* Avoid suppressing menu items that have never been seen before just
because they have a lower menu item number than the last successful item
(closes: #288053).

-- Colin Watson <cjwatson@debian.org> Sat, 16 Dec 2006 09:42:13 +0000

main-menu (1.18) unstable; urgency=low

[ Updated translations ]


+ 26
- 2
main-menu.c View File

@@ -31,6 +31,7 @@
const int RAISE = 1;
const int LOWER = 0;

di_hash_table *seen_items;
int last_successful_item = -1;

/* Save default priority, to be able to return to it when we have to lower it */
@@ -61,6 +62,13 @@ int package_array_compare (const void *v1, const void *v2) {
return strcmp(p1->p.package, p2->p.package);
}

static void seen_items_key_destroy (void *key)
{
di_rstring *s = key;
di_free(s->string);
di_free(s);
}

int isdefault(di_system_package *p) {
int check;

@@ -128,7 +136,8 @@ get_default_menu_item(di_slist *list)
//di_log(DI_LOG_LEVEL_DEBUG, "not menu item; or not installed");
continue;
}
if (p->installer_menu_item < last_successful_item &&
if ((p->installer_menu_item < last_successful_item &&
!di_hash_table_lookup(seen_items, &p->p.key)) &&
p->installer_menu_item < NEVERDEFAULT) {
//di_log(DI_LOG_LEVEL_DEBUG, "not in range to be default");
continue;
@@ -583,9 +592,14 @@ int main (int argc __attribute__ ((unused)), char **argv) {

menu_startup();

seen_items = di_hash_table_new_full(di_rstring_hash, di_rstring_equal,
seen_items_key_destroy, NULL);

allocator = di_system_packages_allocator_alloc ();
packages = di_system_packages_status_read_file(DI_SYSTEM_DPKG_STATUSFILE, allocator);
while ((p=show_main_menu(packages, allocator))) {
di_slist_node *node;

ret = do_menu_item(p);
adjust_default_priority();
switch (ret) {
@@ -609,7 +623,17 @@ int main (int argc __attribute__ ((unused)), char **argv) {
notify_user_of_failure(p);
modify_debconf_priority(LOWER);
}

/* Remember all the packages we've seen so far */
for (node = packages->list.head; node; node = node->next) {
di_system_package *seen = node->data;
di_rstring *seen_name = di_new0(di_rstring, 1);
seen_name->string = di_stradup(seen->p.key.string,
seen->p.key.size);
seen_name->size = seen->p.key.size;
di_hash_table_insert(seen_items, seen_name, seen_name);
}

di_packages_free (packages);
di_packages_allocator_free (allocator);
allocator = di_system_packages_allocator_alloc ();


Loading…
Cancel
Save