On Tue, Jul 17, 2007 at 09:34:28PM +0200, ngaba@petra.hos.u-szeged.hu wrote:
I failed to see why we would require to put the same package more than once in requiredby. I think it works that way, but it isn't necessary, is it? At least I couldn't find a pactest for a case where this would be needed. Is there one? Well, this is so rare as you said (AFAIK no real example yet) that you can simply ignore it (I just put that comment there to remember us). I've chosen this solution because this is not broken imho (the same function does the requiredby add/remove) and this wouldn't worth the O(number of requiredby entries) check for all inserting.
That check isn't a big deal on the performance side, it's totally negligible compared to the rest. It's also a sanity check to avoid getting duplicated requiredby entries. But I find your solution elegant, and it extends cleanly to rare cases where you can have valid duplicated requiredby entries (which means that check doesn't really fit there anymore). I don't think that sanity check is very important anyway (there are probably much more important ones in other places that are missing). Besides, for the current broken databases that have invalid duplicated requiredby entries, it's probably very easy to find these, and it is very easy to fix them, by just reinstalling the package.