-
Notifications
You must be signed in to change notification settings - Fork 2
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
Comments
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) ```
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
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 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. |
As @amr66 noted: Comparing version strings fails by simple comparison with logical less than (<),
1.11.1 < 1.9.1
gives trueResources
The text was updated successfully, but these errors were encountered: