URL: https://github.com/freeipa/freeipa/pull/254
Title: #254: Replace LooseVersion with parse_ipa_version()

mbasti-rh commented:
> > I was thinking about this a bit, and was wondering whether the 
> > platform-specific idiosyncracies of the version handling could be safely 
> > confined to the platform-specific code. I.E ipaplatform.base would define 
> > version comparisons via standard pkg_resources parser and fedora/redhat 
> > would override this with their platform-specific quirks.

> Somebody used a time machine and implemented your proposal already. 
> tasks.parse_ipa_version() is a generic version parsing function. On RPM 
> platforms it returns an object that uses librpm.

Yeah, I did.

> IMHO it's ok to use tasks.parse_ipa_version() everywhere.

As Martin said, we have two versions: package released version and API version.

For released package version we need RPM/platform specific parser, but API 
version is just 2 numbers and standard python function can be used. It is the 
same accross platforms. 

API version is less important now, because we have versions of commads that 
scales better, and one day we may drop this overall API version completely. If 
you want to avoid importing platform then is fine to use standard python 
functions to compare API versions. Actually that rpmlib scares me.

See the full comment at 
Manage your subscription for the Freeipa-devel mailing list:
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to