On 2017-7-27 14:57 , Joshua Root wrote:
The order to follow when uninstalling is the reverse of the order used
when installing, i.e. dependents-first rather than dependencies-first.
Order does matter because we check whether a port has dependents when
uninstalling and raise an error if so. You can set a flag to ignore this
check, but warnings will still be printed, so it's better just to do it
in the right order.
Technically the structure of the dependency relationships of a set of
ports is a directed acyclic graph, not a tree. A DAG can be
topologically sorted, which is a bit like flattening a tree. When you're
dealing with a set of ports that don't all necessarily have dependencies
in common, only a partial ordering can be established, and that's what
you see in the sorting done by portlist_sortdependents in port.tcl (each
port comes earlier in the list than all its dependencies) and sort_ports
in restore_ports.tcl (each port is later in the list than all its
dependencies).
Oh and if you want a visualisation of the structure, have a look at
port-depgraph.
<https://github.com/macports/macports-contrib/blob/master/port-depgraph/port-depgraph>
- Josh