Corinna Vinschen wrote: > IIUC, the ConnectedLoopFinder::visit() function is the core function > which creates the dependency order. What I don't get is this: The
That code is concerned with creating a topological ordering for the specific purpose of running postinstall scripts. This isn't called until after the "remove old and unpack new" install phase is finished and so the 'installed' member has already been set (e.g. the end of Installer::installOne.) Packages that are not selected or were earlier uninstalled are irrelevant here; this is only about figuring out what order to do postinstalls. If you want to see a general example of dependency handling when a package is selected, see ChooserPage::changeTrust (what is called when you change everything at once, e.g. Curr to Exp) or PickPackageLine::click (what is called when you click on a package.) In both cases the main workhorse is packagemeta::set_requirements and in turn packageversion::set_requirements. The logic for Replaces would probably have to be wedged in there. But it's a lot harder than just adding some code to deselect the packages -- consider if setup followed the "Replaces:" advice and unselected some packages because the user selected a new package, but then they changed their mind and deselected that same package. If we don't go back and re-enable those packages then we potentially leave them with a broken system. We could delay this processing until later in the process when the user no longer can change their mind, but then the package selection pane becomes a lie. We will potentially be removing stuff that isn't marked as remove, and the "Selected" view no longer accurately serves as a "here's a list of everything I'm about to do" summary which I think is a valuable feature. Brian