Wrong version match

Antenore Gatta antenore at gmail.com
Tue Aug 17 02:55:43 PDT 2010


Thank you very much!

It's really much appreciated.

On Tue, Aug 17, 2010 at 10:52 AM, Anders F Björklund <afb at algonet.se> wrote:

> Antenore Gatta wrote:
>
>  As I'm not sure this is a bug, I'd like to have your opinion.
>>
>> With the repositories I'm using (rpm), I have 3 different amarok versions:
>>
>> smart> ls -v amarok
>> amarok-2.1.1-7.6 at i586
>>  amarok-2.3.1.60svn20100810-85.1 at i586
>> amarok-2.3.1-77.4 at i586
>>
>
> In general, if you want to compare two versions there's "vercmp".
> This varies between different backends, in how versions compare.
>
> $ python
> >>> from smart.backends.rpm.rpmver import vercmp
> >>> vercmp("2.3.1-77.4", "2.3.1.60svn20100810-85.1")
> -1
>
> There's also two helpers called "splitarch" and "splitrelease",
> which splits out an arch or a release from a version string.
>
> $ python
> >>> from smart.backends.rpm.rpmver import splitarch, splitrelease
> >>> splitarch('2.3.1.60svn20100810-85.1 at i586')
> ('2.3.1.60svn20100810-85.1', 'i586')
> >>> splitrelease('2.3.1.60svn20100810-85.1')
> ('2.3.1.60svn20100810', '85.1')
>
> Again, just how package architectures and release revisions are
> represented as strings varies (greatly) between the backends...
>
> name1-version1-release1.noarch.rpm
> name1_version1-release1_all.deb
> name1-version1-noarch-release1.tgz
> name1-version1-release1-i686.pkg.tar.gz
>
> --anders
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.labix.org/pipermail/smart-labix.org/attachments/20100817/d3139b44/attachment-0003.htm>


More information about the Smart mailing list