Question about profile.d scripts definition in Spec file

Michael Schwendt mschwendt at gmail.com
Tue Aug 4 17:38:43 UTC 2015


On Mon, 3 Aug 2015 22:16:39 +0200, Marcin Haba wrote:

> > If not marking the files below /etc as %config, any update would overwrite
> > them.
> > 
> > Marking them as %config signals RPM to handle the update more gracefully.
> 
> Yes, true. It will handle the update more gracefully, however it does
> not protect from overwrite a file.

That's why the '(noreplace)' bit exists for the %config attribute.

> So, maybe better for profile.d to use %config(noreplace)?

Either %config or %config(noreplace) can cause problems during update.
Neither one is completely safe with regard to breaking a program at
runtime. It can be necessary to switch from %config(noreplace) to %config,
or vice versa, in updates.

For example, if a config file changed from INI-style to XML, it would
be a major problem if not replacing it during an update.

Same for profile.d scripts. If those scripts in an update do much more
than the older and modified installed files, the update may not work
anymore when not replacing the old scripts.

Let's not go in circles. Marking files below /etc as configuration files
can be a good thing, but is not without risk in all cases.

> > Btw, rpmlint does not override Fedora's packaging guidelines:
> > https://fedoraproject.org/wiki/Packaging:Guidelines#Configuration_files
> 
> Not override, but good when rpmlint follows on packaging guidelines as
> much as possible and reasonable.

You could open a RFE in rpmlint upstream tracker.
Or try to get Fedora's rpmlint to point at the packaging guidelines
section instead of mentioning %config directly.


More information about the devel mailing list