| mp | index | guide | reference |
mp resolves ports out of one or more independently configured, git-backed repos, searched in priority order, plus CUSTOM_PORTS_DIR as an always-wins local override checked before any of them.
declaring a repo:
REPO_main=git://git.druid.rocks/druid520/ports.git
REPO_main_PRIORITY=10
REPO_extra=git://example.com/my-extra-ports.git
REPO_extra_BRANCH=stable
REPO_extra_PRIORITY=50
<name> is yours to pick (letters, digits, underscore). REPO_<name>_BRANCH= is optional, defaulting to the remote's own default branch. REPO_<name>_PRIORITY= is optional too, defaulting to 50 -- lower wins, the same "lower is more preferred" convention pkg_pref already uses among %tag providers, ties broken by name. a category/name that exists in more than one repo resolves to whichever has the lower priority number; REPO_main above always wins a collision with REPO_extra.
zero REPO_* keys at all falls back to exactly one repo, named "main", at the historical default url -- an unconfigured system still bootstraps with no config file present.
where each repo actually lives on disk: PORTS_DIR (default WD/repos) is the root. a single configured repo, the common case whether zero-config or one explicit REPO_main=, clones directly to PORTS_DIR itself -- exactly where a single PORTS_REPO always cloned to, before this mechanism existed, so an existing checkout or a running PORTS_DIR env var keeps working unchanged. only once a second repo is configured does every repo (this one included) move to its own PORTS_DIR/repos/<name>, so no two repos' files ever land in the same directory. adding your first REPO_extra= is therefore a one-time re-clone, not something a single-repo setup ever pays for.
mp clones whatever configured repo's directory doesn't exist yet the first time any command needs it -- no separate init step. "mp sync" pulls every configured repo's own directory; "mp update" syncs first, then rebuilds.
every lookup that used to mean "the ports tree" now means "CUSTOM_PORTS_DIR, then every configured repo, in priority order": a bare port name (all_ports()'s own scan, deduped first-seen-wins in that same order), an explicit category/name (find_portdir's own loop, same order), a profiles/<name>/mp.conf or sysroots/<name>.conf lookup, and inherit="classname" resolving classes/<classname>.mp. all four consult the identical, single priority-ordered repo list -- there is no separate mechanism per lookup kind to keep in sync.