How should eclasses check whether required variables are set? * [[ ! ${VAR} ]] && die "error message" * ${VAR?error message} -- is that valid too? Where should they do it? * in functions (like ego_pn_check) * in global scope before or after "if [[ ! ${_ECLASS} ]]" -- does it also have to be @PRE_INHERIT in this case? Also I had a hard time understanding @PRE_INHERIT: > This is important if any e.g. dependencies are modified in global scope at > the point of sourcing I still don't fully understand what does the location of variable in ebuild (pre/post inherit) change. An example featuring different combinations of those variables with explanation would be helpful. # FOO is pre-inherit and required because it's used by BAR in global scope: BAR=${FOO////_} # FOO_MODE and FOO_OPTIONAL are pre-inherit because they're used in # _foo_set_globals(), called in global scope. Although none of them # are required: : ${FOO_TYPE:=native} _foo_set_globals() { case ${FOO_TYPE} in wrapper) RDEPEND="example-misc/foo-wrapper" ;; native) ;; *) die esac } [[ ! ${FOO_OPTIONAL} ]] && _foo_set_globals # FOO_DIRNAME is required but not pre-inherit because it's used # in foo_src_install only foo_src_install() { insinto /var/foo/${FOO_DIRNAME} doins ${BAR}.conf }