DevHeads.net

Inconsistent dnf provides result

Hello,

I noticed a case where the `dnf provides` output is inconsistent. That
means the actual rpm package doesn't provide the requested file:

# cat /etc/fedora-release
Fedora release 29 (Twenty Nine)
# dnf provides /usr/share/man/man8/dpmcopyd.8.gz
dpm-copy-server-mysql-1.12.0-2.fc29.x86_64 : DPM copy server with MySQL database
: back-end
Repo : updates
Matched from:
Filename : /usr/share/man/man8/dpmcopyd.8.gz

But:

$ dnf download dpm-copy-server-mysql
Last metadata expiration check: 1:46:49 ago on Sat 01 Jun 2019 05:31:01 PM CEST.
dpm-copy-server-mysql-1.12.0-2.fc29.x86_64.rpm
$ mkdir -p o ; rpm2cpio dpm-copy-server-mysql-1.12.0-2.fc29.x86_64.rpm | cpio -di -D o -v
./etc/dpm-mysql/dpmcopyd.logrotate
./usr/lib/.build-id
./usr/lib/.build-id/70/bf043a9b1a0954bb464faa59261f8edb0564d3
./usr/lib64/dpm-mysql/dpmcopyd
./usr/lib64/dpm-mysql/dpmcopyd.8
./usr/share/dpm-mysql
./usr/share/dpm-mysql/dpmcopyd.service
1589 blocks
$ ls -l o/usr/share/man/man8/dpmcopyd.8.gz
ls: cannot access 'o/usr/share/man/man8/dpmcopyd.8.gz': No such file or directory

That means there is no /usr/share/man/man8/dpmcopyd.8.gz - just:

./usr/lib64/dpm-mysql/dpmcopyd.8

Ok, I guess I could open a bug against dpm-copy-server-mysql - regarding
fixing the location of the manpage.

But what about the `dnf provides` output?

It looks like something is going wrong in the process that generates the
file-index. Should I open a bug for this, as well? And where?

Best regards
Georg

Comments

Re: Inconsistent dnf provides result

By Emmanuel Seyman at 06/02/2019 - 04:50

* Georg Sauthoff [01/06/2019 19:40] :
Wow, that git history is messy...

Please file a bug against the package arguing that the %ghost directive
seems to be abused in this case (it really should be used for log (and maybe
configuration files) not shipped with the package but linked to it.

I'll argue that having an rpm provide ghosted files is correct behaviour.

Emmanuel

Re: Inconsistent dnf provides result

By Jonathan Billings at 06/02/2019 - 08:02

Use of %ghost is described here for packaging software that uses the “alternatives” system:

<a href="https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives/" title="https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives/">https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives/</a>

It looks like using %ghost is fine for this application, but the file should be in %{mandir} with a unique extension instead of a sub directory of /usr/lib64.


Jonathan Billings < ... at negate dot org>

Re: Inconsistent dnf provides result

By Samuel Sieb at 06/01/2019 - 14:28

On 6/1/19 10:40 AM, Georg Sauthoff wrote:
Why are you going through cpio, instead of just using rpm itself?
$ rpm -qlp dpm-copy-server-mysql-1.12.0-2.fc29.x86_64.rpm
/etc/dpm-mysql/dpmcopyd.logrotate
/etc/logrotate.d/dpmcopyd
/usr/lib/.build-id
/usr/lib/.build-id/70/bf043a9b1a0954bb464faa59261f8edb0564d3
/usr/lib/systemd/system/dpmcopyd.service
/usr/lib64/dpm-mysql/dpmcopyd
/usr/lib64/dpm-mysql/dpmcopyd.8
/usr/sbin/dpmcopyd
/usr/share/dpm-mysql
/usr/share/dpm-mysql/dpmcopyd.service
/usr/share/man/man8/dpmcopyd.8.gz

I don't know why cpio isn't seeing the files. Did you try installing
the package? I don't want to do that because it pulls in a whole bunch
of other dependencies I don't want.

Re: Inconsistent dnf provides result

By Georg Sauthoff at 06/01/2019 - 15:29

Hello,

On Sat, Jun 01, 2019 at 11:28:37AM -0700, Samuel Sieb wrote:
because I want to read the man-page without installing the package.

This still looks wrong.

Strange.

No.

Exactly.

Best regards
Georg

Re: Inconsistent dnf provides result

By Samuel Sieb at 06/02/2019 - 02:14

On 6/1/19 12:29 PM, Georg Sauthoff wrote:
It looks like you do have the man page anyway, just in a different
directory. But you could file a bug on the "lcgdm" package in bugzilla.

Re: Inconsistent dnf provides result

By Georg Sauthoff at 06/02/2019 - 04:05

On Sat, Jun 01, 2019 at 11:14:40PM -0700, Samuel Sieb wrote:
yes, this is basically what I wrote in my original email in this thread.

Best regards
Georg

Re: Inconsistent dnf provides result

By =?utf-8?q?Jos=C... at 06/01/2019 - 16:05

On Saturday, 1 June 2019 20.29.33 WEST Georg Sauthoff wrote:
Probably I am missing something obvious but what is wrong with

rpm -qpl dpm-copy-server-mysql-1.12.0-2.fc29.x86_64.rpm
?

-q query
-p package
-l list files

Re: Inconsistent dnf provides result

By Nico Kadel-Garcia at 06/01/2019 - 19:37

On Sat, Jun 1, 2019 at 4:06 PM José Abílio Matos < ... at fc dot up.pt> wrote:
He wants to *read* the man page, not merely know that it exists. No
idea why it might be a ghost file? But in the meantime, install it in
a "mock" setup or a VM to read it or install it and then unstall it,
if you're in a rush.

Re: Inconsistent dnf provides result

By =?utf-8?q?Jos=C... at 06/02/2019 - 12:13

On Sunday, 2 June 2019 00.37.19 WEST Nico Kadel-Garcia wrote:
Oh, fair enough, it is my fault then. :-)

FWIW when I need to do this I use ark (kde application). And added advantage
is that it also opens other archives inserted inside, an obvious example is a
tarball inside a srpm.

Re: Inconsistent dnf provides result

By Georg Sauthoff at 06/01/2019 - 15:47

On Sat, Jun 01, 2019 at 09:29:33PM +0200, Georg Sauthoff wrote:
This is caused by use of the %ghost directive in the %files
section of the .spec file:

%files -n dpm-copy-server-mysql
%{_libdir}/dpm-mysql/dpmcopyd
%ghost %{_sbindir}/dpmcopyd
%doc %{_libdir}/dpm-mysql/dpmcopyd.8*
%ghost %{_mandir}/man8/dpmcopyd.8*

Apparently %ghost marks those files as belonging to the package but
doesn't include them in the package. Thus, they aren't part of the cpio
archive. Common use-case for this seems to be log-files - such that they
are removed on package removal.

Anyhow, those lines look like a bug to me:

%doc %{_libdir}/dpm-mysql/dpmcopyd.8*
%ghost %{_mandir}/man8/dpmcopyd.8*

And the other question now is: Should `dnf provides` include ghost files
in its output?

I mean, the package really doesn't provide those ghost files ...

Best regards
Georg

Re: Inconsistent dnf provides result

By =?ISO-8859-1?Q?... at 06/02/2019 - 03:04

On Sat, 2019-06-01 at 21:47 +0200, Georg Sauthoff wrote:
Sort of, after lines 1023 [1] we understand the reason this package use
alternatives , the really location on file is /usr/lib64/dpm-
mysql/dpmcopyd.8 so [2] should work

[2]
dnf provides /usr/lib64/dpm-mysql/dpmcopyd.8

[1]
<a href="https://src.fedoraproject.org/rpms/lcgdm/blob/master/f/lcgdm.spec#_1023" title="https://src.fedoraproject.org/rpms/lcgdm/blob/master/f/lcgdm.spec#_1023">https://src.fedoraproject.org/rpms/lcgdm/blob/master/f/lcgdm.spec#_1023</a>

Re: Inconsistent dnf provides result

By Georg Sauthoff at 06/02/2019 - 04:19

On Sun, Jun 02, 2019 at 08:04:25AM +0100, Sérgio Basto wrote:
Good find.

I never questioned that `dnf provides /usr/lib64/dpm-mysql/dpmcopyd.8`
would work. It does. It's just a non-standard location and thus nothing
I would try when searching for the man page of dpmcopyd with `dnf
provides`.

Note that all the man-pages under Fedora a gzip-compressed, while this
file isn't.

But does this even work?

%{_sbindir}/update-alternatives --install %{_sbindir}/dpmcopyd dpmcopyd \
%{_libdir}/dpm-mysql/dpmcopyd 20 \
--slave %{_mandir}/man8/dpmcopyd.8.gz dpmcopyd.8.gz \
%{_libdir}/dpm-mysql/dpmcopyd.8.gz

I mean the archive just contains:

usr/lib64/dpm-mysql/dpmcopyd.8

where:

$ file o/usr/lib64/dpm-mysql/dpmcopyd.8
o/usr/lib64/dpm-mysql/dpmcopyd.8: ASCII text, with escape sequences

While the update-alternatives commands references:

%{_libdir}/dpm-mysql/dpmcopyd.8.gz

Best regards
Georg