--- eutils.eclass.orig 2006-05-26 23:20:11.000000000 -0700 +++ eutils.eclass.orig 2006-05-30 18:00:58.000000000 -0700 @@ -1669,3 +1669,17 @@ newbin "${tmpwrapper}" "${wrapper}" fi } + +# iuse_expand +# +# Grab all IUSE_* variables from the environment, automatically expand them, +# and add them to IUSE. The IUSE_* variable names should end with the name +# of a USE_EXPAND variable such as VIDEO_CARDS. +iuse_expand() + local exp_var exp_var_prefix exp_var_val + for exp_var in ${!IUSE_*}; do + exp_var_prefix="$(echo ${exp_var/IUSE_/} | tr '[A-Z]' '[a-z]')_" + for exp_var_val in ${!exp_var}; do + IUSE="${IUSE} ${exp_var_prefix}${exp_var_val}" + done + done