On Mon, Jul 16, 2007 at 05:13:25PM +0200, ngaba@petra.hos.u-szeged.hu wrote:
Oh yes, please, clean that update_depends function, trying to read it almost killed me. (so go with case 1 I guess). OK, but one more question: tranc.c:461: if(trans->packages && trans->type == PM_TRANS_TYPE_REMOVE) { if(_alpm_pkg_find(dep->name, handle->trans->packages)) { continue; } } Should I keep this or remove? I prefer remove, but I'm not sure. Pro (for keeping): this reduces the slow disk write in many cases (usually there is dependency between the removed packages) Contra: this breaks libalpm hierarchy, it assumes that the remove_commit will be successful; if not, or user break or... then the database can become corrupted (however, extra requiredby is not a big trouble, as you said), so this is a bit unsafe.
Yes indeed, it might be safer to remove. Besides, there was a comment that was removed at some point (not sure when), but it was there at the point where that update_depends function was created. This function was actually refactored from several places, so that's a good thing, but in the same time, a part of it was duplicated, I fail to see why. http://projects.archlinux.org/git/?p=pacman.git;a=commitdiff;h=92ad5565128d4... the comment I'm referring to : + /* XXX: this is a hack...if this dependency is in the transaction targets + * of a remove transaction no need to update its requiredby info: + * it is in the process of being removed (if not already done!) */ + /* TODO I wonder if we can just skip this, the few extra operations won't be + * a huge deal either way */ + if(handle->trans && handle->trans->packages + && handle->trans->type == PM_TRANS_TYPE_REMOVE) { + if(_alpm_pkg_isin(dep.name, handle->trans->packages)) { + continue; + } + } and duplicated part is everything after this : /* Ensure package has the right newpkg */ which became this in the current code: /* this is cheating... we call this function to populate the package */