-
Notifications
You must be signed in to change notification settings - Fork 11
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
downgradable_packages() is sometimes not selecting the latest available version #8
Comments
It looks like I see that we're relying on https://github.com/FauxFaux/deb-version to compare version numbers. I tried writing a minimal example using that crate:
It recognizes that Edit: I also tried making a minimal recreation of the relevant functions in |
Alright, I've finally narrowed down the issue farther, and it does seem to be a problem with the compare function after all. This is the
If I test this with So either we need to not stick the pins on the end of the version numbers when using this function, or the function needs to handle space-separated pins and not just think they're part of the version number string. The way it's done now doesn't even really respect how pins work, anyway, since e.g. |
The quickest fix for this would be to simply stop adding the pin values to the version number (wherever that's happening) and compare version numbers only. However, the more correct fix would be to separately compare pin values, and then only compare version numbers if there's more than one version with the same (highest) pin value. |
The Debian policy manual indicates that version numbers cannot contain spaces, so splitting the version number from the pin on that space should be safe to do. |
While testing pop-os/upgrade#341, I discovered that in the following scenario:
ansible-core
installed from its PPA as version2.17.6-1ppa~jammy
jammy/universe
as version2.12.0-1
and from Ubuntu'sjammy-updates/universe
as version2.12.0-1ubuntu0.1
When pop-upgrade calls
downgradable_packages()
, it then attempts to install version2.12.0-1
, which has a packaging issue that prevents installation when the mainansible
package isn't present.apt policy
recognizes that2.12.0-1ubuntu0.1
is the correct candidate version (and that version has the packaging issue fixed).Expected behavior:
downgradable_packages()
should return2.12.0-1ubuntu0.1
as the version in this case, since that is the correct candidate version once the PPA's been removed and the installed version is orphaned.The text was updated successfully, but these errors were encountered: