[Rpm-maint] [Suse patch] Checking for identical packages on install/upgrade
Michael Schroeder
mls at suse.de
Fri Jun 1 10:20:32 UTC 2007
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.
> 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.
Cheers,
Michael.
--
Michael Schroeder mls at suse.de
SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}
More information about the Rpm-maint
mailing list