#259 Should rpm macro files be marked with any flags (e.g %config and or noreplace)?
Closed: Fixed None Opened 11 years ago by dmalcolm.

http://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_of_Additional_RPM_Macros talks about macros.$PACKAGE files.

Some packages flag these as %config and/or noreplace, some don't:
{{{
fedora17$ for i in /etc/rpm/*;do printf "%02x %s\n" $(rpm -q --qf "%{fileflags}\n" -f $i) $i;done
11 /etc/rpm/macros.cmake
01 /etc/rpm/macros.color
01 /etc/rpm/macros.dist
11 /etc/rpm/macros.emacs
00 /etc/rpm/macros.fjava
00 /etc/rpm/macros.gconf2
00 /etc/rpm/macros.ghc-srpm
00 /etc/rpm/macros.gnat-srpm
00 /etc/rpm/macros.jpackage
00 /etc/rpm/macros.kde4
00 /etc/rpm/macros.mono-srpm
00 /etc/rpm/macros.ocaml-srpm
00 /etc/rpm/macros.perl
00 /etc/rpm/macros.prelink
11 /etc/rpm/macros.python2
11 /etc/rpm/macros.ruby
51 /etc/rpm/macros.systemd
}}}
...where 0x01 and 0x10 are RPMFILE_CONFIG and _NOREPLACE respectively, see rpm/rpmfi.h.

What flags should such flags have?

[Note to self: https://bugzilla.redhat.com/show_bug.cgi?id=914789 which is about macros.python2 having both flags in internal-to-RH builds of python.el7]


IMO, all these files are system config files and are not supposed to be edited/modified by user or admins.

Therefore, I think, these files all should not be marked %config or %config(noreplace).

Approved: RPM Macro files '''MUST NOT''' be marked as %config (+1: 5, 0: 0, -1: 0)

I'll write it up into the Guidelines

Added. Announcement text:

"The packaging guidelines have been clarified to specify that RPM Macro files stored in /etc/rpm/ are not to be marked %config."

Replying to [comment:3 toshio]:

Added. Announcement text:

"The packaging guidelines have been clarified to specify that RPM Macro files stored in /etc/rpm/ are not to be marked %config."

For reference, the relevant edit was:
https://fedoraproject.org/w/index.php?title=Packaging%3AGuidelines&diff=325012&oldid=323210

David, have you considered to move this macros into /usr/lib/rpm/macros.d ? In that place, there is no question about %config. And as Ralf said: "all these files are system config files and are not supposed to be edited/modified by user or admins.", so why they should be in /etc on the first place?

Since when does a /usr/lib/rpm/macros.d exist? It doesn't on my f18 box.

https://bugzilla.redhat.com/show_bug.cgi?id=846679

"Support added upstream in rpm >= 4.10.90, the directory actually now exists too in >= 4.10.90-0.git11989.3.fc19"

The guidelines could recommend this location for Fedora 19 and newer

Actually, just noticed that it already does. Never mind.

Login to comment on this ticket.

Metadata