[Yum-devel] [PATCH 4/4] save metadata in pkg order

Zdenek Pavlas zpavlas at redhat.com
Wed Nov 28 10:06:31 UTC 2012


> > +        # 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.

> > +            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.


More information about the Yum-devel mailing list