For example, we can have a USE flag "foo" that is required by other five different USE flags. Currently, we need to add a different REQUIRED_USE statement for each of them, with the new suggestion we should be able to simply do the following: REQUIRED_USE="|| ( use1 use2 use3 use4 use5 ) ? ( plugins )" Thanks a lot Reproducible: Always
(In reply to comment #0) > For example, we can have a USE flag "foo" that is required by other five > different USE flags. Currently, we need to add a different REQUIRED_USE > statement for each of them, with the new suggestion we should be able to > simply do the following: > REQUIRED_USE="|| ( use1 use2 use3 use4 use5 ) ? ( plugins )" A? ( B ) is equivalent to || ( !A B ). Using this and de Morgan's law, above condition can be rewritten as: REQUIRED_USE="|| ( ( !use1 !use2 !use3 !use4 !use5 ) plugins )" or shorter: REQUIRED_USE="!plugins? ( !use1 !use2 !use3 !use4 !use5 )"
Didn't think about that way, thanks a lot :O
Maybe we could add a section of REQUIRED_USE examples to the devmanual variables page: http://devmanual.gentoo.org/ebuild-writing/variables/index.html
I'd rather add such examples to <http://devmanual.gentoo.org/general-concepts/use-flags/#conflicting-use-flags>. The variables page could shortly describe the variable and otherwise point the USE flags section.
If this alternative way is finally not accepted in PMS, devmanual should probably be updated with the example
(In reply to comment #5) > If this alternative way is finally not accepted in PMS, devmanual should > probably be updated with the example Patch? :)
Nothing to do here for PMS. Closing. (Feel free to reopen and reassign.)
(In reply to Zac Medico from comment #3) > Maybe we could add a section of REQUIRED_USE examples to the devmanual > variables page: > > http://devmanual.gentoo.org/ebuild-writing/variables/index.html We have https://devmanual.gentoo.org/ebuild-writing/variables/index.html#required_use now. So, can this bug be closed?
(In reply to Ulrich Müller from comment #8) > We have > https://devmanual.gentoo.org/ebuild-writing/variables/index.html#required_use > now. So, can this bug be closed? No reply. Closing.