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
_______________________________________________ Yum mailing list Yum@xxxxxxxxxxxxxxxxx http://lists.baseurl.org/mailman/listinfo/yum