[Rpm-ecosystem] RFC #417 %optional file attribute

Dmitry V. Levin ldv at altlinux.org
Mon Mar 26 17:29:53 UTC 2018

On Mon, Mar 26, 2018 at 01:08:15PM -0400, Neal Gompa wrote:
> On Mon, Mar 26, 2018 at 6:43 AM, Florian Festi <ffesti at redhat.com> wrote:
> > Hi!
> >
> > We are currently pondering about #417 [1]. For adding a %optional file
> > attribute that would allow adding file to to %files sections that may
> > not be built under some circumstances (e.g. some architectures).
> >
> > It is already perfectly legal to have files not listed explicitly if
> > they are within a directory that is included in the %file section. But
> > some packages (examples wanted) may have trouble using this due to the
> > way the package files are laid out.
> >
> > Otoh %optional would be another spec language key word that packagers
> > have to deal with and we as RPM upstream developers have a hard time
> > judging whether the benefit of the attribute really out weights the cost
> > of bloating the spec language.
> >
> > Any input - especially with real world packages that would benefit such
> > an addition - is welcome.
> >
> I personally wouldn't use %optional in most cases, just like I avoid
> %missingok (the install-time counterpart to this).

%missingok is *not* an install-time counterpart to %optional.

Imagine you have the following use of %missignok:

%ghost %attr(644,root,root) %config(noreplace,missingok) %verify(not md5 mtime size) /etc/postfix/*.db
- this means that some of /etc/postfix/*.db files listed in %files
*might* be created by the package during its lifetime.

In contrast, %optional means that it's explicitly OK for some of files
listed in %files to disappear from the package at build time for any reason.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.rpm.org/pipermail/rpm-ecosystem/attachments/20180326/4f36be87/attachment.asc>

More information about the Rpm-ecosystem mailing list