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

strange compare-versions result in version 0.12.11 #288

Closed
peutch opened this issue Nov 16, 2020 · 5 comments
Closed

strange compare-versions result in version 0.12.11 #288

peutch opened this issue Nov 16, 2020 · 5 comments

Comments

@peutch
Copy link

peutch commented Nov 16, 2020

Hi,

Using gnome-software (Ubuntu and Debian), some packages (currently openjdk-11-*) were sorting strangely in 'Downgrade' what seems for me an 'Upgrade'. Then I checked using the command line:

$ appstreamcli compare-versions 11.0.9.1+1-0ubuntu1 11.0.9+11-0ubuntu2
11.0.9.1+1-0ubuntu1 << 11.0.9+11-0ubuntu2
$ appstreamcli compare-versions 11.0.9.1 11.0.9
11.0.9.1 >> 11.0.9

I suspect that this is also related to:
https://gitlab.gnome.org/GNOME/gnome-software/-/issues/935
https://gitlab.gnome.org/GNOME/gnome-software/-/issues/876

Thanks

@ximion
Copy link
Owner

ximion commented Nov 16, 2020

That's likely unrelated, as GNOME Software doesn't use libappstream - it does look strange regardless though...

@peutch
Copy link
Author

peutch commented Nov 16, 2020

Thanks!
Sure and it is not clear to me what is used in the case of GNOME Software between appstream-util/libappstream-glib and appstream/libappstream.

Do you mean also that this (runtime?) dependency is not necessary:
$ LANG=C apt depends gnome-software
gnome-software
Depends: appstream
...?

(cf. https://packages.debian.org/unstable/gnome-software)

@peutch
Copy link
Author

peutch commented Nov 16, 2020

Right same trouble with appstream-util:
$ appstream-util vercmp 11.0.9.1+1-0ubuntu1 11.0.9+11-0ubuntu2
11.0.9.1+1-0ubuntu1 < 11.0.9+11-0ubuntu2
$ appstream-util vercmp 11.0.9.1 11.0.9
11.0.9.1 > 11.0.9

@ximion
Copy link
Owner

ximion commented Nov 17, 2020

On Debian, GNOME Software actually needs both: appstream-glib (with libappsteam-glib) by GNOME Software directly, and AppStream's appstreamcli for some Debian-specific plumbing shared across all software centers.
But this confusion may be over at some point in the future, with GNOME Software switching to libappstream: https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1097

For the matter at hand, AppStream is using RPMs version comparison algorithm (unlike appstream-glib), and I am surprised that it doesn't handle the plus sign well.
I will have a look :-)

@ximion ximion closed this as completed in 3601f56 Jan 10, 2021
@ximion
Copy link
Owner

ximion commented Jan 10, 2021

With the version comparison rewrite, appstreamcli returns correct results now:

$ appstreamcli vercmp 11.0.9.1+1-0ubuntu1 11.0.9+11-0ubuntu2
11.0.9.1+1-0ubuntu1 >> 11.0.9+11-0ubuntu2

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

No branches or pull requests

2 participants