Dne 19. 03. 21 v 13:45 Jun Aruga napsal(a):
> ### 4.
>
> ruby-libs.x86_64: W: dangling-symlink /usr/share/ruby/io
> /usr/share/gems/gems/io-console-0.5.6/lib/io
> The target of the symbolic link does not exist within this package or its file
> based dependencies. Verify spelling of the link target and that the target is
> included in a package in this package's dependency chain.
The issue here is that rpmlint can't deffer that rubygem-io-console
transitively depends on ruby-libs, therefore the symlink is never dangling.
>
> =>
> This warning was a hint to find "another issue" to fix.
> The issue is the directory entry `%{ruby_libdir}/io` is duplicated
> between ruby-libs and rubygem-io-console RPM in ruby.spec.
There is nothing wrong with duplicated directory ownership.
>
> Maybe the directory entry in ruby-libs should be removed like this.
>
> ```
> @@ -942,6 +942,7 @@ MSPECOPTS=""
> # Platform independent libraries.
> %dir %{ruby_libdir}
> %exclude %{ruby_libdir}/bigdecimal*
> +%exclude %{ruby_libdir}/io
> %exclude %{ruby_libdir}/irb*
> %exclude %{ruby_libdir}/json*
> %exclude %{ruby_libdir}/psych*
> @@ -964,7 +965,6 @@ MSPECOPTS=""
> %{ruby_libdir}/find.rb
> %{ruby_libdir}/forwardable*
> %{ruby_libdir}/getoptlong*
> -%{ruby_libdir}/io
This directory is certainly needed for other `io` libraries. There is
more then just io-console.
This directory could be in theory dropped from rubygem-io-console, but
there is not any benefit IMO. I prefer the rubygem-io-console to be self
contained.
Vít
> %{ruby_libdir}/ipaddr.rb
> %{ruby_libdir}/kconv.rb
> %{ruby_libdir}/logger*
> ```
For this issue, I actually found it by the following way.
```
$ rpm2cpio ruby-libs-3.0.0-146.fc35.x86_64.rpm | cpio -idmv
$ rpm2cpio rubygem-io-console-0.5.6-146.fc35.x86_64.rpm | cpio -idmv
...
cpio: ./usr/share/ruby/io not created: newer or same age version exists
...
```
The duplicated entry is only this entry. I checked it by the following script.
```
$ cat unpack.sh
#!/bin/bash
set -ex
for RPM_FILE in *.rpm; do
rpm2cpio "${RPM_FILE}" | cpio -idmv
done
```
I opened the ticket for rpmlint to ask them to implement to detect the
duplicated entries here.
https://github.com/rpm-software-management/rpmlint/issues/613
What do you think about these errors/warnings I reported on the email?
I am happy to send PR to fix it.