Hi guys, I was looking into bug #1114586 and it reveals a significant number (400+) of RPM packages which leave empty directories under /usr/share/doc when installed with --excludedocs.
I've looked at a few of them and they had either
%dir %{_docdir}/%{name}-%{version} %doc %{_docdir}/%{name}-%{version}/some_file
or
%doc %{_docdir}/%{name}-%{version}
in their spec files.
The ones which don't leave behind empty directories specify only the documentation files, not the name-version directories as part of the file list.
In my test all 400+ directories under /usr/share/doc are empty, no files in them. Obviously we don't need these directories either. It is very likely people who use --excludedocs will complain about these empty directories as well.
The Packaging Guide doesn't say anything about these name-version directories, whether they should be specified in the spec file or only the indivisual files specified. I'd like to hear your opinion on this packaging situation before I go ahead and file hundreds of bugs into Bugzilla.
Thanks, Alex
On 20 November 2014 09:54, Alexander Todorov atodorov@redhat.com wrote:
Hi guys, I was looking into bug #1114586 and it reveals a significant number
(400+) of RPM packages which leave empty directories under /usr/share/doc when installed with --excludedocs.
I've looked at a few of them and they had either
%dir %{_docdir}/%{name}-%{version} %doc %{_docdir}/%{name}-%{version}/some_file
or
%doc %{_docdir}/%{name}-%{version}
in their spec files.
The ones which don't leave behind empty directories specify only the
documentation files, not the name-version directories as part of the file list.
In my test all 400+ directories under /usr/share/doc are empty, no files
in them. Obviously we don't need these directories either. It is very likely people who use --excludedocs will complain about these empty directories as well.
The Packaging Guide doesn't say anything about these name-version
directories, whether they should be specified in the spec file or only the indivisual files specified. I'd like to hear your opinion on this packaging situation before I go ahead and file hundreds of bugs into Bugzilla.
Any remaining versioned doc dirs are bugs, as far as I am concerned.
See this change from Fedora 20: http://fedoraproject.org/wiki/Changes/UnversionedDocdirs
On Thu, 20 Nov 2014 11:54:07 +0200, Alexander Todorov wrote:
Hi guys, I was looking into bug #1114586 and it reveals a significant number (400+) of RPM packages which leave empty directories under /usr/share/doc when installed with --excludedocs.
I've looked at a few of them and they had either
%dir %{_docdir}/%{name}-%{version} %doc %{_docdir}/%{name}-%{version}/some_file
or
%doc %{_docdir}/%{name}-%{version}
in their spec files.
They do that so the directory gets _removed_ when *uninstalling* the package. Did you test that case, too?
The Packaging Guide doesn't say anything about these name-version directories, whether they should be specified in the spec file or only the indivisual files specified.
It is ordinary ownership of directories as covered by the guidelines.
На 20.11.2014 в 12:55, Michael Schwendt написа:
%dir %{_docdir}/%{name}-%{version} %doc %{_docdir}/%{name}-%{version}/some_file
or
%doc %{_docdir}/%{name}-%{version}
in their spec files.
They do that so the directory gets _removed_ when *uninstalling* the package. Did you test that case, too?
Are you completely sure?
alsa-lib does specify:
%doc COPYING TODO
without the name-version directory and that directory IS removed when `yum remove alsa-libs'.
-- Alex
On Thu, 20 Nov 2014 13:03:24 +0200, Alexander Todorov wrote:
На 20.11.2014 в 12:55, Michael Schwendt написа:
%dir %{_docdir}/%{name}-%{version} %doc %{_docdir}/%{name}-%{version}/some_file
or
%doc %{_docdir}/%{name}-%{version}
in their spec files.
They do that so the directory gets _removed_ when *uninstalling* the package. Did you test that case, too?
Are you completely sure?
alsa-lib does specify:
%doc COPYING TODO
without the name-version directory and that directory IS removed when `yum remove alsa-libs'.
Are you not just confused by the UnversionedDocDirs feature of F20 and the requirements it added for packagers?
As of F20, what %doc macro magic does when specifying *local* files is:
1) create and include the directory %{_docdir}/%{name}/ 2) copy the specified local files into that dir and include them
On the contrary, the packages you refer to explicitly include a _versioned_ docdir, which %doc macro magic no longer handles.
There is an entire family of problems related to using %doc, %_docdir and/or %_pkgdocdir these days. See also: https://fedorahosted.org/fpc/ticket/338 ( %doc and %_pkgdocdir duplicate files and cause conflicts )
На 20.11.2014 в 13:25, Michael Schwendt написа:
Are you not just confused by the UnversionedDocDirs feature of F20 and the requirements it added for packagers?
Maybe so.
As of F20, what %doc macro magic does when specifying *local* files is:
- create and include the directory %{_docdir}/%{name}/
- copy the specified local files into that dir and include them
On the contrary, the packages you refer to explicitly include a _versioned_ docdir, which %doc macro magic no longer handles.
There is an entire family of problems related to using %doc, %_docdir and/or %_pkgdocdir these days. See also: https://fedorahosted.org/fpc/ticket/338 ( %doc and %_pkgdocdir duplicate files and cause conflicts )
Regardless of these, leaving behind empty directories seems like a bug. Do we want to fix these packages which don't fully comply with --excludedocs or don't really care about them ?
-- Alex
On Thu, 20 Nov 2014 13:45:55 +0200, Alexander Todorov wrote:
Do we want to fix these packages which don't fully comply with --excludedocs or don't really care about them ?
Well, it cannot be fixed easily with _removal_ of directory ownership in the packages. It would likely need to be handled in RPM itself (which btw does not mark directories as %doc but just files).
[...]
If you want a fix in the spec files, they would need to abandon including doc files with means other than plain %doc for local files from builddir. In some packages that is done, and even the old-school hack to move installed doc files into $(pwd)/_tmp_docs for later including it via %doc _tmp_docs is used actively. But in other cases, the %_docdir/%name-%version path is mentioned not only in doc files but also somewhere in the application. Some packagers don't like patching it to make it non-versioned.
And theoretically, there could be corner-cases, where a %doc file is stored somewhere outside %_docdir, and you would want the dir ownership even for the --excludedocs scenario, if the user or another package also may store files in that dir.
packaging@lists.fedoraproject.org