Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version comparison doesn't really work #36

Closed
maphew opened this issue Apr 2, 2015 · 1 comment
Closed

Version comparison doesn't really work #36

maphew opened this issue Apr 2, 2015 · 1 comment

Comments

@maphew
Copy link
Owner

maphew commented Apr 2, 2015

As @amr66 noted: Comparing version strings fails by simple comparison with logical less than (<), 1.11.1 < 1.9.1 gives true

Resources

@maphew maphew added the bug label Apr 2, 2015
@maphew maphew added this to the Osgeo.org release (0.3-2?) milestone Apr 3, 2015
maphew added a commit that referenced this issue Apr 4, 2015
It turns out get_new() is comparing tuples not strings. And while this
method isn't as robust as setuptools' parse_version(), it doesn't seem
to be what is breaking apt upgrade and similar right now.

`apt --debug new` output snippet with the code in this commit:

```
Version source, retrieved by:                   (version)      ini > installed"?
-------------------------------------------------------------------------------
--- shell
setup.ini ver, from get_version():              (1, 0, 0, 13)   False
installed ver, from get_installed_version():    (1, 0, 0, 13)
--- gsl-libs
setup.ini ver, from get_version():              (1, 12, 1)      False
installed ver, from get_installed_version():    (1, 12, 1)
--- python-numpy
setup.ini ver, from get_version():              (2, 7, 1, 7, 0, 1)  True
installed ver, from get_installed_version():    (2, 7, 1, 5, 1, 1)
--- pyqt4
setup.ini ver, from get_version():              (4, 11, 3, 1)   False
installed ver, from get_installed_version():    (4, 11, 3, 1)
```
maphew added a commit that referenced this issue Apr 4, 2015
In pursuit of #36, though this doesn't change the outcome of that just
yet. However I did uncover one interesting item: get_version() and
version_to_string() don't return maintain the original version number
exactly. Note the dashes.

INI:
    @ python-numpy
    ...
    version: 2.7-1.7.0-1

version_to_string(get_version(p)): 2.7.1.7.0-1
@maphew maphew closed this as completed in bc20b72 Apr 4, 2015
@maphew
Copy link
Owner Author

maphew commented Apr 4, 2015

Following up on note in 9fd37e4 about exact version # not being maintained. This is because in Osgeo4W (and cygwin?) an archive filename actually contains 2 version numbers: the program version and the package version. Docstring in split_ball() has details (also on osgeo4w wiki, packaging instructions).

Currently we parse that compound number into a single one, and lose record of the change. I don't know that we'll ever need to treat them individually, e.g. create pkg-ver and program-ver entries in the package dict. In any case I don't plan to do anything about it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant