Check for package match based on first segment.
Prefer more specific paths.
Apply packages before paths.