[Rpm-metadata] Finding newst version in a repository

Per Liden perlist1 at malloc.se
Mon Nov 20 17:48:38 UTC 2006


Hi,

I'm parsing a primary.xml and want to find out which version of a 
specific RPM is the newest version in the repository. In my case I'm 
parsing primary.xml from fedora 6 updates 
(ftp://sunsite.mff.cuni.cz/pub/fedora/updates/6/i386/repodata) and at 
the moment it has e.g. autofs of version 5.0.1-0.rc2.22 and 
5.0.1-0.rc2.17. What would be the correct way of telling which of these 
is the newest version? Comparing metadata/package/version/@rel seems a 
bit too error prone as version numbering styles can differ. It seems 
that using metadata/package/time/@file or metadata/package/time/@build 
would work but I guess that's sort of a coincidence as a older version 
could in theory be build at a more recent time.

Any suggestions? I assume yum and other tools has to extract this 
information in some way?

kind regards,
/Per



More information about the Rpm-metadata mailing list