[Fedora-packaging] "file listed twice" warning

Tom "spot" Callaway tcallawa at redhat.com
Tue May 26 13:37:34 UTC 2009


On 05/26/2009 09:13 AM, Daniel Novotny wrote:
> hello,
> 
> I am now fixing stuff in a package for a merge review and this include getting rid of "file listed twice" warnings
> 
> the situation is this:
> 
> %files
> %{mmdir}/Mailman
> # ...
> %attr(0644, root, %{mmgroup}) %config(noreplace) %verify(not md5 size mtime) %{mmdir}/Mailman/mm_cfg.py
> 
> so there's a directory, with lots of sub-directories and files, I want all of them included,
> but one file of those needs special permissions, directives and such:
> 
> after that, rpmbuild tells me it's listed twice: once in the directory and once in the "%config", "%attr" definition
> 
> is there a way around this? probably a directive "I know the file is already listed, just want to change the flags"

There is no simple directive here like you're suggesting. The correct
fix is to do something like this:

%files
%defattr(-,root,root,-)
%dir %{mmdir}/Mailman/
%{mmdir}/Mailman/subdirectory1/
%{mmdir}/Mailman/subdirectory2/
%{mmdir}/Mailman/subdirectory3/
# Use wildcards where appropriate, but be sure not to catch the special
case.
%{mmdir}/Mailman/file1.py*
%{mmdir}/Mailman/file2.py*
# Special case... shortened to fit on one line, for the purpose of
illustration
%attr(0644, root, %{mmgroup}) %{mmdir}/Mailman/mm_cfg.py

~spot




More information about the Fedora-packaging mailing list