Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 399069 - REQUIRED_USE should handle multiple USE flags requiring the same USE to be set
Summary: REQUIRED_USE should handle multiple USE flags requiring the same USE to be set
Status: RESOLVED FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Devmanual (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Devmanual Team
URL:
Whiteboard:
Keywords: NeedPatch
Depends on:
Blocks:
 
Reported: 2012-01-16 12:29 UTC by Pacho Ramos
Modified: 2020-02-28 11:14 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pacho Ramos gentoo-dev 2012-01-16 12:29:04 UTC
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
Comment 1 Ulrich Müller gentoo-dev 2012-01-16 13:35:16 UTC
(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 )"
Comment 2 Pacho Ramos gentoo-dev 2012-01-16 15:28:06 UTC
Didn't think about that way, thanks a lot :O
Comment 3 Zac Medico gentoo-dev 2012-01-16 18:08:48 UTC
Maybe we could add a section of REQUIRED_USE examples to the devmanual variables page:

  http://devmanual.gentoo.org/ebuild-writing/variables/index.html
Comment 4 Ulrich Müller gentoo-dev 2012-01-16 18:51:48 UTC
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.
Comment 5 Pacho Ramos gentoo-dev 2013-03-29 10:28:49 UTC
If this alternative way is finally not accepted in PMS, devmanual should probably be updated with the example
Comment 6 Markos Chandras (RETIRED) gentoo-dev 2013-03-29 11:22:53 UTC
(In reply to comment #5)
> If this alternative way is finally not accepted in PMS, devmanual should
> probably be updated with the example

Patch? :)
Comment 7 Ulrich Müller gentoo-dev 2013-03-29 11:23:39 UTC
Nothing to do here for PMS. Closing.
(Feel free to reopen and reassign.)
Comment 8 Ulrich Müller gentoo-dev 2020-01-23 12:16:02 UTC
(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?
Comment 9 Ulrich Müller gentoo-dev 2020-02-28 11:14:58 UTC
(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.