[Yum-devel] [PATCH 4/4] save metadata in pkg order
James Antill
james at fedoraproject.org
Wed Nov 28 14:59:29 UTC 2012
On Wed, 2012-11-28 at 05:06 -0500, Zdenek Pavlas wrote:
> > > + # this is going to be merged..
> > > + keptpkgs.sort(reverse=True)
> > > + def save_keptpkgs(upto=None):
> > > + while keptpkgs and (upto is None or keptpkgs[-1][0] < upto):
> > > + po = keptpkgs.pop()[1]
> >
> > I am kind of confused about the two different pkgs. here, why we
> > compare against one and write the other
>
> Maybe I should have put a comment there.. Have two lists: kept packages
> (cached in old metadata, have po), and pkgfiles (these are new, processed
> by workers).
>
> Both lists are sorted. When processing pkgfiles, I have to insert
> cached packages in right spots, so the result is sorted, too.
Yeh, I worked that bit out ... but a comment for future me would be
fine :).
> > > + pkgfiles.sort()
> >
> > Would it not be possible to merge the pkgfiles and keptpkgs lists at
> > this point?
>
> pkgfiles are RPM filenames only, keptpkgs are filename+po tuples.
> Throwing po's would kill the --update switch.
Ahh, this is the bit I was confused about comparing keptpkgs[0] and
using keptpkgs[1] ... maybe a comment saying the pkgs are actually pkg
filenames and sorted that way?
Does this also mean they have directories likes foo/pkg-1.rpm and
that'll be part of the sort? I thought we already sorted the xml in some
paths ... do we do that using filename order and not pkg nevra order?
Anyway ... ACK.
More information about the Yum-devel
mailing list