Fix unecessary rebuild caused by equal versions in different repos

Fixes bug 497238.