| git.druid.rocks | index | druid520 | mp | docs/ | reference/ | commands/ | prune.btft |
docs/reference/commands/prune.btft
[table class="topnav"]
[tr]
[td class="logotab"]mp[e]
[td][see name="index"]index[e][e]
[td][see name="guide/index"]guide[e][e]
[td][see name="reference/index"]reference[e][e]
[e]
[e]
[h1]mp prune[e]
[h2]synopsis[e]
[code]
mp prune [--dry-run]
[e]
[h2]description[e]
removes every installed package that isn't reachable, by RUNTIME dependency only, from the set of explicitly-requested packages (everything installed via [see name="reference/commands/install"]mp install[e]/[see name="reference/commands/update"]update[e] by name, not pulled in only as a dependency). build-only deps ([code]pkg_bdepend[e], USE:b: deps) are deliberately excluded from the closure -- something only needed to build a package legitimately becomes prunable once that package itself is already built.
the closure walk (finding everything actually still needed) is the same expensive per-package [code]find_portdir[e]/[code]try_pkgconf[e]/[code]effective_deps[e] pass [see name="reference/commands/update"]update[e]'s own dependency-graph build does -- a rotating "resolving dependencies..." spinner shows on a real terminal while it runs.
re-requesting an already-installed dependency (installing it by name directly, even though it's already on disk as someone else's dependency) promotes it to requested, so prune leaves it alone from then on -- this is the mechanism, not a separate command.
[code]--dry-run[e] prints "would remove: X" for each candidate instead of actually removing anything.
[h2]examples[e]
[code]
mp prune --dry-run
would remove: oldlib
would remove: buildonlytool
mp prune
[e]
[h2]see also[e]
[see name="reference/commands/remove"]remove[e], [see name="reference/commands/list"]list[e] [code]--installed[e] (shows the requested marker), [see name="reference/commands/why"]why[e].