At my employer we do the same thing for pretty much all software shipped to customers. (X thousand packages, across 5 arches, across 5 releases)
There is an ongoing effort and it becomes more complex with vendored packages, embedded jars and 'containers'.
I'm assuming that the indexing is done at compile time, how far back into your dep tree do you go ?