portage-ng / handbook
PDF GitHub

Policy: Target resolution

Concern: How does a user / set atom become a concrete ebuild action?

PMS / Portage: CLI atoms (cat/pkg, versioned atoms, @sets) resolve to one or more package versions; emerge then plans install/run for that selection. Sets expand before resolution.

Literals:

  • target(Q, Arg):run|fetchonly|uninstall?{Ctx}
  • Expands to Repo://Ebuild:Action?{Ctx} (and optional world/1 side effects)

Owns: Rules/Resolving/target.pl, resolving.pl TARGET section, Preference/sets.pl (set expansion before prove).

Invariants:

  • Unconstrained CN targets prefer visible candidates before unmasking.
  • Explicit versions try candidates in standard order (user pin wins).
  • :fetchonly does not register @world; :uninstall may unregister unless --oneshot.
  • Set atoms (@world, @security, @preserved-rebuild, @changed-deps, …) expand to ordinary package atoms before target rules run (sets:expand/2 for computed sets).

Examples: test01, test71, test78.
See also: Visibility, Install.