Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 111503 - Allow checking whether a USE_EXPAND flag is set
Summary: Allow checking whether a USE_EXPAND flag is set
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-04 13:34 UTC by Donnie Berkholz (RETIRED)
Modified: 2006-01-05 03:30 UTC (History)
1 user (show)

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


Attachments
Adds extra USE flags if a specific USE EXPAND deal is EXPANDED (USE-EXPAND-Spyderous.patch,447 bytes, patch)
2005-11-04 15:10 UTC, Alec Warner (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Donnie Berkholz (RETIRED) gentoo-dev 2005-11-04 13:34:28 UTC
We'd like to be able to have people set VIDEO_CARDS to pull in their specific
video card drivers, and the same for INPUT_DEVICES and their input driver. If
either variable remains unset, we want to install all possible drivers.

This means that USE_EXPAND flags are directly affecting the dependency list,
andif none of the sequence of all drivers is set, then we want to automatically
pull in all drivers.

Example:
    || (
        list of all drivers
        (
            video_cards_foo? ( foo )
            video_cards_bar? ( bar )
        )
    )

But if VIDEO_CARDS is unset, this allows the second part of the || to fulfill
the dependency by being empty, instead of installing all drivers as we want.

There is no way in dependency lists to check whether VIDEO_CARDS is empty
without checking every possible value VIDEO_CARDS could hold.


So instead of "list of all drivers" above, we would require:

    !video_cards_foo? (
        !video_cards_bar? (
            ... !video_cards_N? (
                list of drivers )

This is a huge hack, and it would be much more convenient to have a way to
checkwhether VIDEO_CARDS was set via portage, e.g. the main video_cards flag:

    video_cards? (
        video_cards_foo?
        video_cards_bar?
    )
    !video_cards? (
        list of all drivers
    )

This also raises the possibility of "invalid" VIDEO_CARDS settings, i.e. ones
that have no effect in this ebuild. But as at least a temporary measure, this
could be checked in pkg_setup() against some variable containing all "valid"
settings. Traditionally, I have used IUSE_${USE_EXPAND_NAME} to hold all
"valid"settings.

So the real concern is being able to check in a dependency-friendly way whether
a USE_EXPAND variable is set.
Comment 1 Donnie Berkholz (RETIRED) gentoo-dev 2005-11-04 13:39:05 UTC
To clarify, the suggested USE flag to indicate that VIDEO_CARDS is set would be
video_cards. If that seems too prone to conflict, it could be
expand_video_cards, use_expand_video_cards, or whatever.
Comment 2 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-11-04 15:10:40 UTC
Created attachment 72138 [details, diff]
Adds extra USE flags if a specific USE EXPAND deal is EXPANDED

Basically if something in use expand is expanded, add the USE_EXPAND string to
USE.

For example, if USE_EXPAND="VIDEO_CARDS" and VIDEO_CARDS="nvidia" then
USE will contain both "video_cards" and "video_cards_nvidia"
Comment 3 Brian Harring (RETIRED) gentoo-dev 2005-11-04 16:07:33 UTC
I'd rather not slip another use flag in here.
Use a bash func that scans the contents of use looking for the USE_EXPAND
prefix; why?
A) it works _now_
B) we're not polluting the USE namespace any further
C) we can rebind that function to something sane down the line, rather then the
heavier scanning route.
Comment 4 Brian Harring (RETIRED) gentoo-dev 2005-11-04 16:33:58 UTC
meh, my comments are strictly non metadata related- obviously doesn't fly in DEPEND.
Comment 5 Alec Warner (RETIRED) archtester gentoo-dev Security 2006-01-05 03:30:45 UTC
As discussed on irc use the fixed || () deps.