discovery: add a discover_package function.