I think you want rpm --rebuilddb
That's for repairing a damaged database, not for rebuilding source packages.