Index: choose.cc =================================================================== RCS file: /cvs/src/src/winsup/cinstall/choose.cc,v retrieving revision 2.36 diff -u -p -r2.36 choose.cc --- choose.cc 2001/06/30 01:37:55 2.36 +++ choose.cc 2001/06/30 02:40:11 @@ -100,9 +100,11 @@ isinstalled (Package *pkg, int trust) static void set_action (Package *pkg, bool preinc) { - pkg->srcpicked = 0; if (!pkg->action || preinc) - ((int) pkg->action)++; + { + ((int) pkg->action)++; + pkg->srcpicked = 0; + } /* Exercise the action state machine. */ for (;; ((int) pkg->action)++) @@ -145,21 +147,28 @@ set_action (Package *pkg, bool preinc) case ACTION_UNINSTALL: if (pkg->installed) return; + break; case ACTION_REDO: - if (pkg->installed) + if (pkg->installed && pkg->info[pkg->installed_ix].install_exists) { pkg->trust = pkg->installed_ix; return; } + break; case ACTION_SRC_ONLY: - if (pkg->installed && pkg->installed->source_exists) - return; + if (pkg->info[pkg->trust].source_exists) + { + pkg->srcpicked = 1; + return; + } break; case ACTION_SAME_LAST: pkg->action = ACTION_SKIP; /* Fall through intentionally */ case ACTION_SKIP: - return; + if (!pkg->installed || !pkg->info[pkg->installed_ix].install_exists) + return; + break; default: log (0, "should never get here %d\n", pkg->action); } @@ -1461,24 +1470,25 @@ do_choose (HINSTANCE h) : "unknown"); const char *excluded = (pkg->exclude ? "yes" : "no"); - log (LOG_BABBLE, "[%s] action=%s trust=%s installed=%s excluded=%s src?=%s" + log (LOG_BABBLE, + "[%s] action=%s trust=%s installed=%s excluded=%s src?=%s" "category=%s", pkg->name, action, trust, installed, - excluded, pkg->srcpicked ? "yes" : "no", pkg->category); + excluded, pkg->srcpicked ? "yes" : "no", pkg->category->name); for (int t = 1; t < NTRUST; t++) { if (pkg->info[t].install) - log (LOG_BABBLE, " [%s] ver=%s\r\n" - " inst=%s %d exists=%s\r\n" - " src=%s %d exists=%s", + log (LOG_BABBLE, " [%s] ver=%s\n" + " inst=%s %d exists=%s\n" + " src=%s %d exists=%s", infos[t], pkg->info[t].version ?: "(none)", pkg->info[t].install ?: "(none)", pkg->info[t].install_size, - (pkg->info[t].install_exists) ? "yes":"no", + (pkg->info[t].install_exists) ? "yes" : "no", pkg->info[t].source ?: "(none)", pkg->info[t].source_size, - (pkg->info[t].source_exists == 1) ? "yes":"no"); + (pkg->info[t].source_exists) ? "yes" : "no"); } } }