| git.druid.rocks | index | druid520 | mp | docs/ | reference/ | commands/ | reinstall.btft |
docs/reference/commands/reinstall.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 reinstall[e]
[h2]synopsis[e]
[code]
mp reinstall [--inplace] [--force] [--no-deps] [--unmask] [--sysroot=<name>] <pkg> ...
[e]
[h2]description[e]
rebuilds and reinstalls one or more already-declared packages. like [see name="reference/commands/install"]install[e], the whole batch is validated up front by mp's dependency planner first (same spinner, same backtracking, same fall-through-to-per-package-resolution for a request the planner declines to judge), unless [code]--no-deps[e] is given.
by default, reinstall follows the normal remove-then-install cycle: [code]del.sh[e] (or the [code]remove:[e] phase) runs against the currently-installed copy, then a fresh build installs over it. that has one real hazard -- if the fresh build fails partway through, the package is left in whatever state its now-half-finished install left it, with nothing to fall back to, since the old copy is already gone. for something self-hosting-critical (a compiler, a shell, mp itself), that's not an abstract risk.
[code]--inplace[e] avoids it: the new copy is built entirely into a private, throwaway prefix first, and only folded onto the live root (per file, atomically, via mpx's own [code]merge[e] command) once the build is fully known-good. the OLD copy is never removed until the new one already exists. a package whose own build bakes absolute paths into itself (gcc's specs file, autoconf/automake/libtool/gettext, perl5, curl, git, ...) sets [code]pkg_no_inplace="yes"[e] in its own pkg.conf to opt out of this entirely -- see that port's own del.sh/pkg.conf comments for why building into an ephemeral scratch prefix would bake in a path that gets deleted right after.
[h2]options[e]
[code]--inplace[e] (see above), plus the common [code]--force[e], [code]--no-deps[e], [code]--unmask[e], [code]--config=<file>[e], [code]--sysroot=<name>[e] -- see [see name="reference/config"]reference/config[e].
[h2]examples[e]
[code]
mp reinstall figlet # normal remove-then-install cycle
mp reinstall --inplace gcc # build fully before touching the live compiler at all
[e]
[h2]see also[e]
[see name="reference/commands/install"]install[e], [see name="reference/commands/update"]update[e], [see name="reference/commands/clean"]clean[e], [see name="reference/commands/sysroot"]sysroot[e] (the same build-elsewhere-then-fold primitive, for a whole sysroot at once).