[Rpm-maint] [Suse patch] Checking for identical packages on install/upgrade

Panu Matilainen pmatilai at redhat.com
Mon Jun 4 08:00:16 UTC 2007


On Fri, 1 Jun 2007, Michael Schroeder wrote:

> On Fri, Jun 01, 2007 at 01:08:28PM +0300, Panu Matilainen wrote:
>> Um, sorry but I'm not following... where does freshen come to play in the
>> bug https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=104066 mentioned
>> in the patch? Freshen won't even touch the other package there because the
>> name differs...
>
> That's the other side of the coin. The rpmVersionCompare() was
> used to detect a "freshen" operation. It doesn't compare the
> name, so it has some very bad side effects. That's what #104066
> is about.
>
> The underlying issue is that rpm has to detect "freshen" operations,
> and it has to do this in two parts of the code, in depends.c and
> psm.c.
>
>>> should be some rpmSameHeader() function as an abstraction. The
>>> code in psm.c should be changed to:
>>>
>>>   psm->mi = rpmtsInitIterator(ts, RPMTAG_NAME, rpmteN(psm->te), 0);
>>>   while ((psm->oh = rpmdbNextIterator(psm->mi)) != NULL) {
>>>       if (!rpmSameHeader(fi->h, psm->oh))
>
> Make this "rpmHeadersIdentical()" to be consistent with jbj.
>
>>> 	    continue;
>>> 	fi->record = rpmdbGetIteratorOffset(psm->mi);
>>> 	psm->oh = NULL;
>>> 	/*@loopbreak@*/ break;
>>>   }
>>>
>>> This doesn't slow down the installation, as all the rpmdbSetIteratorRE()
>>> are currently also done after fetching the header.
>>
>> That's pretty much what jbj's version of the patch does, but not in psm.c
>> but rpmtsAddInstallElement() much like your original patch. A thinko wrt
>> location / mixup with some other patch perhaps?
>
> No, see above. rpmHeadersIdentical() must get used in two parts
> of the code.

Right, then jbj's version is incorrect as well AFAICT, the psm.c part is 
unchanged in his tree.

>> BTW and here's the fix from jbj's tree, and brief testing shows it also
>> fixes the foo-1.1 vs bar-1.1 case from #104066.
>
> Yeah, but if psm.c does something different I can easily construct
> an example where this doesn't work.

Please do. I'm not claiming you're not right, seeing the problem would 
help *me* understand it properly :)

 	- Panu -



More information about the Rpm-maint mailing list