Re: rpmbuild %config: "file listed twice"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/19/2015 06:23 AM, Borislav Trifonov wrote:
Consider the following in a SPEC file:

%files %defattr(-,bubba,users,-)
...
%attr(-,root,users) %{_localstatedir}/foo/
%config %attr(-,root,root) %{_localstatedir}/foo/blah.bar

I want to include all files under foo but also specifically mark blah.bar
as a config file (and its permissions may not match foo's). Doing this
causes rpmbuild to complain that the file is listed twice.
I tried to add the following between the last two lines above:

%exclude %{_localstatedir}/foo/blah.bar

  However, this seems to permanently override any other inclusion, because,
despite the fact that the next %config line ought to include the file (now
as a config file), blah.bar does not get installed when I install the RPM.

Telling rpm to first exclude and then include something in the same package does not make sense. %exclude is good for splitting files across sub-packages, not much else.


  So what's the right way to do this? "Just make a list of all files in foo
instead of adding the whole directory" is not a real answer.

Yet that is the answer with all existing rpm versions (and I'm not aware of any plans to change it).

And if I simply ignore the warning, how do I know (for sure and that
it's reliably reproducible behavior now and forever) whether the file
gets marked as config or its inclusion as part of the directory takes
precedence, or the behavior is order-dependent, or what?

The warning is there for a reason, behavior in case of duplicates is undefined.

	- Panu -

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list



[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux