[Rpm-ecosystem] RFC #417 %optional file attribute
ngompa13 at gmail.com
Mon Mar 26 17:08:15 UTC 2018
On Mon, Mar 26, 2018 at 6:43 AM, Florian Festi <ffesti at redhat.com> wrote:
> We are currently pondering about #417 . 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).
That said, I think it's a perfectly valid strategy for dealing with
some types of content if you're trying to reduce/eliminate large
clusters of ugly conditionals in the %files section (or writing
scripts to generate files list manifests to pass to the files
section). While you can absolutely go without this feature, I think
that's more of a matter for distributions to consider. For example,
SUSE allows for empty file manifests in their packages, while Fedora
does not. And until a few months ago, rich dependencies were banned in
Fedora, while they've been allowed in SUSE for a while.
There are specs that do detection and analysis to fill in these
entries via the manifest, which I consider to be no worse than the
%optional tag for files section. This just reduces the need for
writing potentially error-prone extra scripts for this.
However, I'd like to see a warning thrown whenever a file listed as
%optional is not included because it's not there, just so that
information is captured and obvious when someone looks back through
build logs or something.
真実はいつも一つ！/ Always, there's only one truth!
More information about the Rpm-ecosystem