The code didn't match the following comment :
"A depends on B through n depends <=> A listed in B's requiredby n times"
Because of the usage of break instead of continue, it stopped at n=1.
I was surprised to see this case happens in real, that's how I noticed the bug:
wine depends on both freeglut and glut, while freeglut provides glut.
So when installing wine, the update_depends function listed wine twice in freeglut's requiredby.
But the compute_requiredby function (used when installing freeglut, and used by testdb)
listed wine only once in freeglut's requiredby.
That made testdb unhappy.
Signed-off-by: Chantry Xavier