#819 Allow use of tilde for Ruby generators
Closed: duplicate 11 months ago Opened a year ago by vondruch.

There is ticket #398, discussing if tilde should be used or not. I'd like to have approved exception to use tilde in Ruby dependency generators:

https://src.fedoraproject.org/rpms/ruby/c/0d5d7e9999b737c46f5ec14daa8a2378d4295326?branch=private-ruby-2.1


I don't think it is prohibited in the provides, it is purely about version.

Arguably, the ticket #398 is about the patch above at least since my first comment: https://pagure.io/packaging-committee/issue/398#comment-145460

What's wrong with - in there as done in the linked commit?

The current version of the generator is adding artificial -1 suffix to every generated virtual provide in a package, e.g.:

$ rpm -qP rubygem-rails | grep \(
rubygem(rails) = 5.2.1-1

just in case there might be some pre-release version of the package, which is then going with 0.1.#{prerelease} suffix, e.g.:

$ sudo dnf repoquery --provides rubygem-asciidoctor-pdf | grep \(
Last metadata expiration check: 0:15:48 ago on Thu Oct 25 07:39:27 2018.
rubygem(asciidoctor-pdf) = 1.5.0-0.1.alpha.13

And now to the probability of having the pre-release in Fedora:

$ LC_ALL=C.UTF-8 sudo dnf repoquery --whatprovides 'rubygem(*)' | wc -l
Last metadata expiration check: 0:18:24 ago on Thu Oct 25 07:39:27 2018.
684

$ LC_ALL=C.UTF-8 sudo dnf repoquery --whatprovides 'rubygem(*)' | grep -- -0\\. | wc -l
Last metadata expiration check: 0:18:15 ago on Thu Oct 25 07:39:27 2018.
1

So there is in total 1 (!!!) prelease rubygem- package in Fedora (assuming every package properly follows the pre-release guidelines).

While there are arguments that tilde might be misunderstood by some, I am pretty sure nobody knows why every rubygem(foo) virtual provide has the -1. I would rather spend time explaning what tilde is good for in the exceptional cases of pre-release -rubygem package in Fedora then mangling versions in every generated provide.

Also note this:

$ sudo dnf repoquery --provides rubygem-asciidoctor-pdf 
Last metadata expiration check: 0:25:10 ago on Thu Oct 25 07:39:27 2018.
asciidoctor-pdf = 1.5.0-0.2.alpha.13.fc26
rubygem(asciidoctor-pdf) = 1.5.0-0.1.alpha.13
rubygem-asciidoctor-pdf = 1.5.0-0.2.alpha.13.fc26

The release of the package is -0.2.alpha.13.fc26, while the generated provide hase version 1.5.0-0.1.alpha.13. Another confusing thing. With tilde, it would be just 1.5.0~alpha.13

On top of that, the algorithm, which is trying to separate the #{prerelease} from the version is rather naive. The tilde gives me the additional security, that no matter how messed up the version with tilde ended up, it will be sorted lower by RPM, so there are higher chances the next official version of rubygem- package has higher version then the pre-release.

Does the approval of #832 mean that I can use the tilde in Ruby generator now? If the answer is yes (it should be IMO), then we can close this ticket.

Yes, though announcement hasn't been sent yet IIUC.

Metadata Update from @ignatenkobrain:
- Issue close_status updated to: duplicate
- Issue status updated to: Closed (was: Open)

11 months ago

Login to comment on this ticket.

Metadata