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

Vít Ondruch vondruch at redhat.com
Wed Jul 25 10:00:34 UTC 2018



Dne 24.7.2018 v 20:41 Jeff Johnson napsal(a):
>
>> On Jul 24, 2018, at 7:42 AM, Vít Ondruch <vondruch at redhat.com> wrote:
>>
>> I would have use for %optional:
>>
>> https://src.fedoraproject.org/rpms/scl-utils/pull-request/1
>>
>> Let me explain. scl-utils 2.x introduced support for environment
>> modules. They are now enforcing existence of modulefile. However, the
>> modulefile is not available in SCLs prepared for scl-utils 1.x and
>> moreover, it is not needed, because scl-utils 2.x should be able to
>> execute the old collections in backward compatible way just fine. If
>> there was %optional macro used at this line [1], it would allow to
>> include the module file if the collection is prepared for scl-utils 2.x,
>> while it would allow older collections prepared for scl-utils 1.x to be
>> still built.
>>
>> I am about the merge the PR above, but that means that whoever is going
>> to create the modulefile now will have to explicitly list it in files
>> section. I don't see any better option ATM.
>>
> The ability to imagine a usage case for %optional does not establish a sound basis for adding the feature.
>
> There are many existing ways in rpm to create a package that handles your scl-utils packaging problem that do not require editing %files for an optional file.
>
> Perhaps the best way is to use a manifest in %files and add/delete the additional file based on whatever logic you wish (like testing whether a 2.x or a 1.x build of scl-utils is being attempted).
>
> Knowing the conditions for including the file is what is important for determining whether a package has been built correctly and reproducibly.
>
> Having a %optional marker reveals nothing about the circumstances where the file SHOULD exist necessary to determine whether a package has been built correctly.

I don't disagree.

However, this is a bit about being explicit or implicit. Should user who
adds modulefile, which is not supported by scl-utils 1.x and is optional
for scl-utils 2.x list the file somewhere explicitly or should it be
included implicitly?

Frankly, the same question is if I should better add directory including
its whole content into file section or should I add dir explicitly and
the files contained one by one. As long as RPM supports former, then
there is no reason to not support %optional, because RPM generally does
not care whether file should exits.


V.

>
> 73 de Jeff
>
>
>> Vít
>>
>>
>> [1]
>> https://src.fedoraproject.org/rpms/scl-utils/blob/273a583584bffa3c5121043f24cc98f2e2bb99da/f/macros.scl-filesystem#_7
>>
>>
>> Dne 26.3.2018 v 12:43 Florian Festi napsal(a):
>>> 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.
>>>
>>> Florian
>>>
>>>
>>> [1] https://github.com/rpm-software-management/rpm/pull/417
>>
>> _______________________________________________
>> Rpm-ecosystem mailing list
>> Rpm-ecosystem at lists.rpm.org
>> http://lists.rpm.org/mailman/listinfo/rpm-ecosystem
> _______________________________________________
> Rpm-ecosystem mailing list
> Rpm-ecosystem at lists.rpm.org
> http://lists.rpm.org/mailman/listinfo/rpm-ecosystem




More information about the Rpm-ecosystem mailing list