Index: main.c =================================================================== RCS file: /cvsroot/src/usr.bin/config/main.c,v retrieving revision 1.102 diff -u -p -r1.102 main.c --- main.c 7 Jan 2025 14:21:11 -0000 1.102 +++ main.c 7 Aug 2026 16:02:55 -0000 @@ -128,6 +128,8 @@ struct hashtab *deaddevitab; /* removed struct hashtab *selecttab; /* selects things that are "optional foo" */ struct hashtab *needcnttab; /* retains names marked "needs-count" */ struct hashtab *opttab; /* table of configured options */ +struct hashtab *no_opttab; /* table of explcitly deselected options */ +struct hashtab *dep_opttab; /* table of depended options */ struct hashtab *fsopttab; /* table of configured file systems */ struct dlhash *defopttab; /* options that have been "defopt"'d */ struct dlhash *defflagtab; /* options that have been "defflag"'d */ @@ -378,6 +380,8 @@ main(int argc, char **argv) selecttab = ht_new(); needcnttab = ht_new(); opttab = ht_new(); + no_opttab = ht_new(); + dep_opttab = ht_new(); mkopttab = ht_new(); fsopttab = ht_new(); deffstab = nvhash_create(); @@ -668,9 +672,15 @@ do_depend(struct nvlist *nv) nv->nv_name, a->a_name); expandattr(a, selectattr); } else { - if (ht_lookup(opttab, nv->nv_name) == NULL) - addoption(nv->nv_name, NULL); - dependopts_one(nv->nv_name); + if (ht_lookup(no_opttab, nv->nv_name)) { + CFGDBG(3, + "depended option `%s' explcitly de-selected", + nv->nv_name); + } else { + if (ht_lookup(opttab, nv->nv_name) == NULL) + addoption(nv->nv_name, NULL); + dependopts_one(nv->nv_name); + } } } } @@ -846,6 +856,13 @@ add_fs_dependencies(struct nvlist *nv, s static void add_opt_dependencies(struct defoptlist *dl, struct nvlist *deps) { + struct nvlist *nv; + + for (nv = deps; nv != NULL; nv = nv->nv_next) { + (void)ht_insert(dep_opttab, nv->nv_name, + (void *)__UNCONST(nv->nv_name)); + } + dl->dl_depends = deps; check_dependencies(dl->dl_name, deps); } @@ -1190,6 +1207,10 @@ addoption(const char *name, const char * void deloption(const char *name, int nowarn) { + (void)ht_insert(no_opttab, name, (void *)__UNCONST(name)); + if (ht_lookup(dep_opttab, name)) { + nowarn = 1; + } CFGDBG(4, "deselecting opt `%s'", name); if (undo_option(opttab, &options, &nextopt, name, "options", nowarn))