Fix issue where dependent docs cannot find the right versions of installed doc indexes
There's currently a problem with the way link_documentation()
tries to get the right versions of dependencies and link the manual of a given package to those. This patch fixes it.