Closed peti closed 8 years ago
Okay, let me test how this affects Fedora - it might be better to do this only for SUSE I am not sure.
Again some example would be helpful, if you have any?
I am not sure what you mean. When a file is installed as a data-file already, then it seems redundant to install it again into the %doc directory, no? The use case seems obvious to me and I'm not sure how to motivate this change any further beyond "don't install the same file twice".
I just meant if you have any examples of packages where this patch has an effect, to understand the problem better and to test the change. Also behind my question is the concern whether some of those files are really data files or doc files. Cabal packaging has had a tendency just to put misc/doc files into datadir which I don't particularly like. I do agree duplicating files is not good, but just want to make sure they end up in the right place.
Ah, I misunderstood your question. I am sorry. An example package where this patch makes a difference is siphash
. Without this patch, the files section looks like this:
%files -f %{name}.files
%defattr(-,root,root,-)
%doc LICENSE
%dir %{_datadir}/%{pkg_name}-%{version}
%{_datadir}/%{pkg_name}-%{version}/README.md
%files devel -f %{name}-devel.files
%defattr(-,root,root,-)
%doc README.md
So README.md
installed both as a data file and as part of the documentation. With the patch applied, that becomes:
%files -f %{name}.files
%defattr(-,root,root,-)
%doc LICENSE
%dir %{_datadir}/%{pkg_name}-%{version}
%{_datadir}/%{pkg_name}-%{version}/README.md
%files devel -f %{name}-devel.files
%defattr(-,root,root,-)
Okay, but then i would argue it is the wrong solution since the README file should be docdir IMHO. Maybe SUSE is more relaxed about this perhaps. Then I would prefer to filter docdir files from datadir instead if possible.
+1 for filter docdir from datadir ... all doku should be in %docdir
I would prefer to filter docdir files from datadir instead if possible.
Yeah, that's fine. My concern is that these files shouldn't be installed twice. I don't feel strongly about where to install them to.
Untested but I hope the above commit does the right thing.
Don't consider declared data-files when guessing the set of %doc files to avoid installing them twice.
Cc: @mimi1vx