Re: [Yum] RPM python subroutine for (epoch, version, release) comparation?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Thu, 25 Jun 2009, Robinson Tiemuqinke wrote:


Hi, all,

 

 On Centos 5 I am programming RPM with python recently.  When I read the online RPM python programming guide at
http://docs.fedoraproject.org/drafts/rpm-guide-en/ch16s05.html, I got confused at the EVR() function as the function
returns the (epoch, version, release) as a string “%epoch-%version-%release”, and so the RPM  comparing process is
simplified as string comparing – which doesn’t look correct, am I wrong? See the code from the page:



1. EVR() is not going to give you something which is usefully comparable for sorting by e-v-r of the pkg. It's just going to give you something useful for doing string comparisons on.

2. You can use rpm.versionCompare() or rpm.labelCompare() - labelCompare takes the e,v,r as strings.

3. you could look at how rpmUtils (comes in yum) or yum itself handles a bunch of these items.

-sv
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux