make -f /usr/ports/Mk/bsd.port.mk -V PORTS_FEATURES.make -C devel/foo -V FLAVORS.make -C devel/foo all FLAVOR=barmake -C devel/foo -V FLAVOR.pkg query -F <package.txz> '%At %Av' | awk '$1 == "flavor" {print $2}'BUILD_DEPENDS+= foo>0:devel/foo@bar LIB_DEPENDS+= libother.so:devel/other
FLAVOR=flavor as a make argument when building that port.The fact that a dependency may have its own flavor means that in a large graph of packages to build, an origin may be needed several times with different flavors. It is also possible that a dependency contains the default flavor for a port. The lookup for that default flavor may then yield the graph containing something like B, B@default, and B@foo, where the default is listed twice. It is likely good to coalesce B and B@default here internally.
This is only really a problem for performance. If in all dependencies found the tool simply goes off and runs make -V for all of the data it needs, then there's nothing more to do. If the tool wants to be efficient then it may benefit from the following.
The way poudriere dealt with this lookup problem is as follows: