aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-07-06 21:27:53 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-07-06 21:27:32 +0100
commit07d0f0df3da11b3e5ad912994c92bcb3bbe5c92f (patch)
tree4a09641eec2b12adc1865c02617a21d714769385
parent986c0c22ac095bab46018e9b2a6e66326bbfcca9 (diff)
downloadpaludis-07d0f0df3da11b3e5ad912994c92bcb3bbe5c92f.tar.gz
paludis-07d0f0df3da11b3e5ad912994c92bcb3bbe5c92f.tar.xz
New EAPI 3 profile iuse ick
-rw-r--r--paludis/repositories/e/e_choices_key.cc78
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc19
-rw-r--r--paludis/repositories/e/e_installed_repository_id.hh1
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc40
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh86
-rw-r--r--paludis/repositories/e/e_repository_id.hh1
-rw-r--r--paludis/repositories/e/e_repository_profile.cc130
-rw-r--r--paludis/repositories/e/e_repository_profile.hh7
-rw-r--r--paludis/repositories/e/eapi.cc8
-rw-r--r--paludis/repositories/e/eapi.hh12
-rw-r--r--paludis/repositories/e/eapis/0.conf6
-rw-r--r--paludis/repositories/e/eapis/3.conf10
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf2
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf2
-rw-r--r--paludis/repositories/e/ebuild.cc12
-rw-r--r--paludis/repositories/e/ebuild/0/list_functions.bash9
-rw-r--r--paludis/repositories/e/ebuild_id.cc59
-rw-r--r--paludis/repositories/e/ebuild_id.hh1
18 files changed, 448 insertions, 35 deletions
diff --git a/paludis/repositories/e/e_choices_key.cc b/paludis/repositories/e/e_choices_key.cc
index 316460a..5ea0815 100644
--- a/paludis/repositories/e/e_choices_key.cc
+++ b/paludis/repositories/e/e_choices_key.cc
@@ -221,24 +221,43 @@ namespace
}
}
+namespace paludis
+{
+ namespace n
+ {
+ struct default_value;
+ struct implicit;
+ }
+}
+
namespace
{
- void add_choice_to_map(std::map<ChoiceNameWithPrefix, Tribool> & values,
- const std::pair<ChoiceNameWithPrefix, Tribool> & flag,
+ struct ChoiceOptions
+ {
+ NamedValue<n::default_value, Tribool> default_value;
+ NamedValue<n::implicit, bool> implicit;
+ };
+
+ void add_choice_to_map(std::map<ChoiceNameWithPrefix, ChoiceOptions> & values,
+ const std::pair<ChoiceNameWithPrefix, ChoiceOptions> & flag,
const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > & key)
{
- std::map<ChoiceNameWithPrefix, Tribool>::iterator i(values.find(flag.first));
+ std::map<ChoiceNameWithPrefix, ChoiceOptions>::iterator i(values.find(flag.first));
if (values.end() == i)
values.insert(flag);
- else if (! flag.second.is_indeterminate()) {
- if (i->second.is_indeterminate())
- i->second = flag.second;
- else if (flag.second.is_true() != i->second.is_true()) {
+ else if (! flag.second.default_value().is_indeterminate())
+ {
+ if (i->second.default_value().is_indeterminate())
+ i->second.default_value() = flag.second.default_value();
+ else if (flag.second.default_value().is_true() != i->second.default_value().is_true())
+ {
Log::get_instance()->message("e.iuse_key.contradiction", ll_warning, lc_context)
<< "Flag '" << flag.first << "' is both enabled and disabled by default in "
<< "'" << key->raw_name() << "', using enabled";
- i->second = true;
+ i->second.default_value() = true;
}
+
+ i->second.implicit() = i->second.implicit() && flag.second.implicit();
}
}
}
@@ -362,47 +381,64 @@ EChoicesKey::populate_iuse() const
/* ugh. iuse and all that mess. */
- std::map<ChoiceNameWithPrefix, Tribool> i_values;
+ std::map<ChoiceNameWithPrefix, ChoiceOptions> i_values;
std::string delim(1, _imp->id->eapi()->supported()->choices_options()->use_expand_separator());
if (_imp->id->raw_iuse_key())
{
std::set<std::string> iuse_sanitised;
- std::map<ChoiceNameWithPrefix, Tribool> values;
+ std::map<ChoiceNameWithPrefix, ChoiceOptions> values;
+
+ std::map<std::string, bool> iuse_with_implicit;
for (Set<std::string>::ConstIterator u(_imp->id->raw_iuse_key()->value()->begin()), u_end(_imp->id->raw_iuse_key()->value()->end()) ;
u != u_end ; ++u)
+ iuse_with_implicit.insert(std::make_pair(*u, false));
+
+ if (_imp->id->raw_iuse_effective_key())
+ for (Set<std::string>::ConstIterator u(_imp->id->raw_iuse_effective_key()->value()->begin()),
+ u_end(_imp->id->raw_iuse_effective_key()->value()->end()) ;
+ u != u_end ; ++u)
+ iuse_with_implicit.insert(std::make_pair(*u, true));
+
+ for (std::map<std::string, bool>::const_iterator u(iuse_with_implicit.begin()), u_end(iuse_with_implicit.end()) ;
+ u != u_end ; ++u)
{
- std::pair<ChoiceNameWithPrefix, Tribool> flag(parse_iuse(_imp->id->eapi(), *u));
+ std::pair<ChoiceNameWithPrefix, Tribool> flag(parse_iuse(_imp->id->eapi(), u->first));
+ std::pair<ChoiceNameWithPrefix, ChoiceOptions> flag_with_options(flag.first, make_named_values<ChoiceOptions>(
+ value_for<n::default_value>(flag.second),
+ value_for<n::implicit>(u->second)
+ ));
+
iuse_sanitised.insert(stringify(flag.first));
if (_imp->id->raw_use_expand_key() &&
_imp->id->raw_use_expand_key()->value()->end() != std::find_if(
_imp->id->raw_use_expand_key()->value()->begin(),
_imp->id->raw_use_expand_key()->value()->end(),
IsExpand(flag.first, delim)))
- add_choice_to_map(i_values, flag, _imp->id->raw_iuse_key());
+ add_choice_to_map(i_values, flag_with_options, _imp->id->raw_iuse_key());
else
{
if (stringify(flag.first) == _imp->id->eapi()->supported()->choices_options()->fancy_test_flag())
/* have to add this right at the end, after build_options is there */
has_fancy_test_flag = true;
else
- add_choice_to_map(values, flag, _imp->id->raw_iuse_key());
+ add_choice_to_map(values, flag_with_options, _imp->id->raw_iuse_key());
}
}
- for (std::map<ChoiceNameWithPrefix, Tribool>::const_iterator it(values.begin()),
- it_end(values.end()); it_end != it; ++it)
+ for (std::map<ChoiceNameWithPrefix, ChoiceOptions>::const_iterator it(values.begin()),
+ it_end(values.end()) ; it != it_end ; ++it)
{
std::tr1::shared_ptr<const ChoiceValue> choice(_imp->id->make_choice_value(
- use, UnprefixedChoiceName(stringify(it->first)), it->second, true,
+ use, UnprefixedChoiceName(stringify(it->first)), it->second.default_value(), ! it->second.implicit(),
get_maybe_description(_imp->maybe_descriptions, it->first), false));
use->add(choice);
}
/* pain in the ass: installed packages with DEPEND="x86? ( blah )" need to work,
* even if x86 isn't listed in IUSE. */
- if (_imp->id->raw_use_key())
+ if (_imp->id->raw_use_key() && ! _imp->id->eapi()->supported()->choices_options()->profile_iuse_injection())
{
for (Set<std::string>::ConstIterator u(_imp->id->raw_use_key()->value()->begin()), u_end(_imp->id->raw_use_key()->value()->end()) ;
u != u_end ; ++u)
@@ -432,7 +468,7 @@ EChoicesKey::populate_iuse() const
}
std::string env_arch(_imp->id->eapi()->supported()->ebuild_environment_variables()->env_arch());
- if ((! env_arch.empty()) && _imp->maybe_e_repository)
+ if ((! env_arch.empty()) && _imp->maybe_e_repository && ! _imp->id->eapi()->supported()->ebuild_options()->require_use_expand_in_iuse())
{
std::tr1::shared_ptr<Choice> arch(new Choice(make_named_values<ChoiceParams>(
value_for<n::consider_added_or_changed>(false),
@@ -495,7 +531,7 @@ EChoicesKey::populate_iuse() const
}
}
- for (std::map<ChoiceNameWithPrefix, Tribool>::const_iterator i(i_values.begin()), i_end(i_values.end()) ;
+ for (std::map<ChoiceNameWithPrefix, ChoiceOptions>::const_iterator i(i_values.begin()), i_end(i_values.end()) ;
i != i_end ; ++i)
if (IsExpand(i->first, delim)(*u))
values.insert(UnprefixedChoiceName(i->first.data().substr(u->length() + delim.length())));
@@ -503,9 +539,9 @@ EChoicesKey::populate_iuse() const
for (std::set<UnprefixedChoiceName>::const_iterator v(values.begin()), v_end(values.end()) ;
v != v_end ; ++v)
{
- std::map<ChoiceNameWithPrefix, Tribool>::const_iterator i(i_values.find(ChoiceNameWithPrefix(lower_u + delim + stringify(*v))));
+ std::map<ChoiceNameWithPrefix, ChoiceOptions>::const_iterator i(i_values.find(ChoiceNameWithPrefix(lower_u + delim + stringify(*v))));
if (i_values.end() != i)
- exp->add(_imp->id->make_choice_value(exp, *v, i->second, true,
+ exp->add(_imp->id->make_choice_value(exp, *v, i->second.default_value(), ! i->second.implicit(),
get_maybe_description(_imp->maybe_descriptions, i->first), false));
else
exp->add(_imp->id->make_choice_value(exp, *v, indeterminate, false, "", false));
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index a653e48..594c317 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -81,6 +81,7 @@ namespace paludis
std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_use;
std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > inherited;
std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string > > > raw_iuse;
+ std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string > > > raw_iuse_effective;
std::tr1::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> > raw_myoptions;
std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string > > > raw_use_expand;
std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string > > > raw_use_expand_hidden;
@@ -243,6 +244,17 @@ EInstalledRepositoryID::need_keys_added() const
add_metadata_key(_imp->raw_iuse);
}
+ if (! vars->iuse_effective()->name().empty())
+ {
+ if ((_imp->dir / vars->iuse_effective()->name()).exists())
+ {
+ _imp->raw_iuse_effective.reset(new EStringSetKey(
+ shared_from_this(), vars->iuse_effective()->name(), vars->iuse_effective()->description(),
+ file_contents(_imp->dir / vars->iuse_effective()->name()), mkt_internal));
+ add_metadata_key(_imp->raw_iuse_effective);
+ }
+ }
+
if (! vars->myoptions()->name().empty())
if ((_imp->dir / vars->myoptions()->name()).exists())
{
@@ -654,6 +666,13 @@ EInstalledRepositoryID::raw_iuse_key() const
return _imp->raw_iuse;
}
+const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > >
+EInstalledRepositoryID::raw_iuse_effective_key() const
+{
+ need_keys_added();
+ return _imp->raw_iuse_effective;
+}
+
const std::tr1::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> >
EInstalledRepositoryID::raw_myoptions_key() const
{
diff --git a/paludis/repositories/e/e_installed_repository_id.hh b/paludis/repositories/e/e_installed_repository_id.hh
index cb5f3b7..0110578 100644
--- a/paludis/repositories/e/e_installed_repository_id.hh
+++ b/paludis/repositories/e/e_installed_repository_id.hh
@@ -81,6 +81,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_use_key() const;
virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_iuse_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_iuse_effective_key() const;
virtual const std::tr1::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> > raw_myoptions_key() const;
virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_use_expand_key() const;
virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_use_expand_hidden_key() const;
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 29b7214..cd471fb 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1707,6 +1707,46 @@ namespace test_cases
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
id->perform_action(action);
}
+
+ {
+ TestMessageSuffix suffix("strict use", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/strict-use-3",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("strict use fail", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/strict-use-fail-3",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
+ TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ }
+
+ {
+ TestMessageSuffix suffix("strict use injection", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/strict-use-injection-3",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("global scope use", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/global-scope-use-3",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
+ id->perform_action(action);
+ }
}
} test_e_repository_install_eapi_3;
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index 15c7c27..92f6e6f 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -467,13 +467,18 @@ virtual/virtual-pretend-installed cat/pretend-installed
virtual/virtual-doesnotexist cat/doesnotexist
END
cat <<END > profiles/profile/make.defaults
-ARCH="test"
+ARCH="cheese"
USERLAND="GNU"
KERNEL="linux"
LIBC="glibc"
CHOST="i286-badger-linux-gnu"
LINGUAS="enabled_en enabled_en_GB enabled_en_GB@UTF-8"
-USE_EXPAND="LINGUAS"
+USE_EXPAND="LINGUAS USERLAND"
+USE_EXPAND_UNPREFIXED="ARCH"
+USE_EXPAND_IMPLICIT="USERLAND ARCH"
+USE_EXPAND_VALUES_USERLAND="GNU"
+USE_EXPAND_VALUES_ARCH="cheese otherarch"
+IUSE_IMPLICIT="build"
END
mkdir -p "cat/in-ebuild-die"
cat <<END > cat/in-ebuild-die/in-ebuild-die-1.ebuild || exit 1
@@ -1207,7 +1212,7 @@ LICENSE="GPL-2"
KEYWORDS="test"
pkg_setup() {
- [[ $USE == "enabled-weasel linguas_enabled_en linguas_enabled_en_GB linguas_enabled_en_GB@UTF-8 test " ]] \
+ [[ $USE == "enabled-weasel linguas_enabled_en linguas_enabled_en_GB linguas_enabled_en_GB@UTF-8 userland_GNU cheese " ]] \
|| die "USE=$USE is wrong"
[[ $USERLAND == "GNU" ]] || die "USERLAND=$USERLAND is wrong"
[[ $LINGUAS == "enabled_en enabled_en_GB enabled_en_GB@UTF-8" ]] || die "LINGUAS=$LINGUAS is wrong"
@@ -1450,6 +1455,80 @@ EOF
chmod +x configure
}
END
+mkdir -p "cat/strict-use" || exit 1
+cat << 'END' > cat/strict-use/strict-use-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork enabled"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+
+pkg_setup() {
+ use enabled || die "enabled not enabled"
+ use spork && die "sporks are bad"
+}
+END
+mkdir -p "cat/strict-use-fail" || exit 1
+cat << 'END' > cat/strict-use-fail/strict-use-fail-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork enabled"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+
+pkg_setup() {
+ use pony
+}
+END
+mkdir -p "cat/strict-use-injection" || exit 1
+cat << 'END' > cat/strict-use-injection/strict-use-injection-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork enabled"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+
+pkg_setup() {
+ use build && die "build set"
+ use userland_GNU || die "userland_GNU not set"
+ use cheese || die "cheese not set"
+ use otherarch && die "otherarch set"
+}
+END
+mkdir -p "cat/global-scope-use" || exit 1
+cat << 'END' > cat/global-scope-use/global-scope-use-3.ebuild || exit 1
+use spork
+
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork enabled"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+END
cd ..
mkdir -p repo14/{profiles/profile,metadata,eclass} || exit 1
@@ -1466,6 +1545,7 @@ SUBOPTIONS="LINGUAS"
LINGUAS="en en_GB en_GB@UTF-8"
USERLAND="GNU"
OPTIONS="weasel spinach"
+USE_EXPAND="USERLAND"
END
mkdir -p "packages/cat/in-ebuild-die"
cat <<'END' > packages/cat/in-ebuild-die/in-ebuild-die-1.ebuild || exit 1
diff --git a/paludis/repositories/e/e_repository_id.hh b/paludis/repositories/e/e_repository_id.hh
index b755fe5..41c6286 100644
--- a/paludis/repositories/e/e_repository_id.hh
+++ b/paludis/repositories/e/e_repository_id.hh
@@ -39,6 +39,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> > properties_key() const = 0;
virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_use_key() const = 0;
virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_iuse_key() const = 0;
+ virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_iuse_effective_key() const = 0;
virtual const std::tr1::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> > raw_myoptions_key() const = 0;
virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_use_expand_key() const = 0;
virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_use_expand_hidden_key() const = 0;
diff --git a/paludis/repositories/e/e_repository_profile.cc b/paludis/repositories/e/e_repository_profile.cc
index 08fbb97..4ca3e78 100644
--- a/paludis/repositories/e/e_repository_profile.cc
+++ b/paludis/repositories/e/e_repository_profile.cc
@@ -166,6 +166,10 @@ namespace paludis
std::set<std::pair<ChoicePrefixName, UnprefixedChoiceName> > use;
std::tr1::shared_ptr<Set<std::string> > use_expand;
std::tr1::shared_ptr<Set<std::string> > use_expand_hidden;
+ std::tr1::shared_ptr<Set<std::string> > use_expand_unprefixed;
+ std::tr1::shared_ptr<Set<std::string> > use_expand_implicit;
+ std::tr1::shared_ptr<Set<std::string> > iuse_implicit;
+ std::tr1::unordered_map<std::string, std::tr1::shared_ptr<Set<std::string> > > use_expand_values;
KnownMap known_choice_value_names;
mutable Mutex known_choice_value_names_for_separator_mutex;
mutable std::tr1::unordered_map<char, KnownMap> known_choice_value_names_for_separator;
@@ -194,7 +198,10 @@ namespace paludis
system_packages(new SetSpecTree(make_shared_ptr(new AllDepSpec))),
system_tag(new GeneralSetDepTag(SetName("system"), stringify(name))),
use_expand(new Set<std::string>),
- use_expand_hidden(new Set<std::string>)
+ use_expand_hidden(new Set<std::string>),
+ use_expand_unprefixed(new Set<std::string>),
+ use_expand_implicit(new Set<std::string>),
+ iuse_implicit(new Set<std::string>)
{
Context context("When loading profiles '" + join(dirs.begin(), dirs.end(), "' '") + "' for repository '" + stringify(name) + "':");
@@ -384,6 +391,90 @@ Implementation<ERepositoryProfile>::load_profile_make_defaults(const FSEntry & d
Log::get_instance()->message("e.profile.make_defaults.use_expand_failure", ll_warning, lc_context)
<< "Loading '" << use_expand_var << "' failed due to exception: " << e.message() << " (" << e.what() << ")";
}
+
+ std::string use_expand_unprefixed_var(eapi->supported()->ebuild_environment_variables()->env_use_expand_unprefixed());
+ try
+ {
+ use_expand_unprefixed->clear();
+ if (! use_expand_unprefixed_var.empty())
+ tokenise_whitespace(environment_variables[use_expand_unprefixed_var], use_expand_unprefixed->inserter());
+ }
+ catch (const InternalError &)
+ {
+ throw;
+ }
+ catch (const Exception & e)
+ {
+ Log::get_instance()->message("e.profile.make_defaults.use_expand_unprefixed_failure", ll_warning, lc_context)
+ << "Loading '" << use_expand_unprefixed_var << "' failed due to exception: " << e.message() << " (" << e.what() << ")";
+ }
+
+ std::string use_expand_implicit_var(eapi->supported()->ebuild_environment_variables()->env_use_expand_implicit());
+ try
+ {
+ use_expand_implicit->clear();
+ if (! use_expand_implicit_var.empty())
+ tokenise_whitespace(environment_variables[use_expand_implicit_var], use_expand_implicit->inserter());
+ }
+ catch (const InternalError &)
+ {
+ throw;
+ }
+ catch (const Exception & e)
+ {
+ Log::get_instance()->message("e.profile.make_defaults.use_expand_implicit_failure", ll_warning, lc_context)
+ << "Loading '" << use_expand_implicit_var << "' failed due to exception: " << e.message() << " (" << e.what() << ")";
+ }
+
+ std::string iuse_implicit_var(eapi->supported()->ebuild_environment_variables()->env_iuse_implicit());
+ try
+ {
+ iuse_implicit->clear();
+ if (! iuse_implicit_var.empty())
+ tokenise_whitespace(environment_variables[iuse_implicit_var], iuse_implicit->inserter());
+ }
+ catch (const InternalError &)
+ {
+ throw;
+ }
+ catch (const Exception & e)
+ {
+ Log::get_instance()->message("e.profile.make_defaults.iuse_implicit_failure", ll_warning, lc_context)
+ << "Loading '" << iuse_implicit_var << "' failed due to exception: " << e.message() << " (" << e.what() << ")";
+ }
+
+ std::string use_expand_values_part_var(eapi->supported()->ebuild_environment_variables()->env_use_expand_values_part());
+ try
+ {
+ use_expand_values.clear();
+ if (! use_expand_values_part_var.empty())
+ {
+ for (Set<std::string>::ConstIterator x(use_expand->begin()), x_end(use_expand->end()) ;
+ x != x_end ; ++x)
+ {
+ std::tr1::shared_ptr<Set<std::string> > v(new Set<std::string>);
+ tokenise_whitespace(environment_variables[use_expand_values_part_var + *x], v->inserter());
+ use_expand_values.insert(std::make_pair(*x, v));
+ }
+
+ for (Set<std::string>::ConstIterator x(use_expand_unprefixed->begin()), x_end(use_expand_unprefixed->end()) ;
+ x != x_end ; ++x)
+ {
+ std::tr1::shared_ptr<Set<std::string> > v(new Set<std::string>);
+ tokenise_whitespace(environment_variables[use_expand_values_part_var + *x], v->inserter());
+ use_expand_values.insert(std::make_pair(*x, v));
+ }
+ }
+ }
+ catch (const InternalError &)
+ {
+ throw;
+ }
+ catch (const Exception & e)
+ {
+ Log::get_instance()->message("e.profile.make_defaults.iuse_implicit_failure", ll_warning, lc_context)
+ << "Loading '" << iuse_implicit_var << "' failed due to exception: " << e.message() << " (" << e.what() << ")";
+ }
}
void
@@ -459,13 +550,20 @@ Implementation<ERepositoryProfile>::is_incremental(const EAPI & e, const std::st
{
Context c("When checking whether '" + s + "' is incremental:");
+ std::string uevp_var(e.supported()->ebuild_environment_variables()->env_use_expand_implicit());
+
return (! s.empty()) && (
(s == e.supported()->ebuild_environment_variables()->env_use())
|| (s == e.supported()->ebuild_environment_variables()->env_use_expand())
|| (s == e.supported()->ebuild_environment_variables()->env_use_expand_hidden())
+ || (s == e.supported()->ebuild_environment_variables()->env_use_expand_unprefixed())
+ || (s == e.supported()->ebuild_environment_variables()->env_use_expand_implicit())
+ || (s == e.supported()->ebuild_environment_variables()->env_iuse_implicit())
|| s == "CONFIG_PROTECT"
|| s == "CONFIG_PROTECT_MASK"
- || use_expand->end() != use_expand->find(s));
+ || use_expand->end() != use_expand->find(s)
+ || ((! uevp_var.empty()) && (s.length() > uevp_var.length()) && (0 == s.compare(0, uevp_var.length(), s)) &&
+ use_expand_implicit->end() != use_expand_implicit->find(s.substr(uevp_var.length() + 1))));
}
void
@@ -977,6 +1075,34 @@ ERepositoryProfile::use_expand_hidden() const
return _imp->use_expand_hidden;
}
+const std::tr1::shared_ptr<const Set<std::string> >
+ERepositoryProfile::use_expand_unprefixed() const
+{
+ return _imp->use_expand_unprefixed;
+}
+
+const std::tr1::shared_ptr<const Set<std::string> >
+ERepositoryProfile::use_expand_implicit() const
+{
+ return _imp->use_expand_implicit;
+}
+
+const std::tr1::shared_ptr<const Set<std::string> >
+ERepositoryProfile::use_expand_values(const std::string & x) const
+{
+ Context context("When finding USE_EXPAND_VALUES_" + x + ":");
+ std::tr1::unordered_map<std::string, std::tr1::shared_ptr<Set<std::string> > >::const_iterator i(_imp->use_expand_values.find(x));
+ if (i == _imp->use_expand_values.end())
+ throw InternalError(PALUDIS_HERE, "Oops. We need USE_EXPAND_VALUES_" + x + ", but it's not in the map");
+ return i->second;
+}
+
+const std::tr1::shared_ptr<const Set<std::string> >
+ERepositoryProfile::iuse_implicit() const
+{
+ return _imp->iuse_implicit;
+}
+
const std::tr1::shared_ptr<ERepositoryProfile>
RepositoryEInterfaceProfilesDescLineProfile::fetch() const
{
diff --git a/paludis/repositories/e/e_repository_profile.hh b/paludis/repositories/e/e_repository_profile.hh
index b8336b8..5880ae2 100644
--- a/paludis/repositories/e/e_repository_profile.hh
+++ b/paludis/repositories/e/e_repository_profile.hh
@@ -136,12 +136,17 @@ namespace paludis
///\}
- ///\name Iterate over USE_EXPAND, USE_EXPAND_HIDDEN
+ ///\name Iterate over USE_EXPAND, USE_EXPAND_HIDDEN etc
///\{
const std::tr1::shared_ptr<const Set<std::string> > use_expand() const PALUDIS_ATTRIBUTE((warn_unused_result));
const std::tr1::shared_ptr<const Set<std::string> > use_expand_hidden() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ const std::tr1::shared_ptr<const Set<std::string> > use_expand_unprefixed() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ const std::tr1::shared_ptr<const Set<std::string> > use_expand_implicit() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ const std::tr1::shared_ptr<const Set<std::string> > iuse_implicit() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ const std::tr1::shared_ptr<const Set<std::string> > use_expand_values(const std::string &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+
///\}
///\name Environment variable queries
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 2d0080c..35978b2 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -81,6 +81,7 @@ namespace
value_for<n::env_distdir>(check_get(k, "env_distdir")),
value_for<n::env_ebuild_phase>(check_get(k, "env_ebuild_phase")),
value_for<n::env_filesdir>(check_get(k, "env_filesdir")),
+ value_for<n::env_iuse_implicit>(check_get(k, "env_iuse_implicit")),
value_for<n::env_kv>(check_get(k, "env_kv")),
value_for<n::env_p>(check_get(k, "env_p")),
value_for<n::env_pf>(check_get(k, "env_pf")),
@@ -92,7 +93,10 @@ namespace
value_for<n::env_t>(check_get(k, "env_t")),
value_for<n::env_use>(check_get(k, "env_use")),
value_for<n::env_use_expand>(check_get(k, "env_use_expand")),
- value_for<n::env_use_expand_hidden>(check_get(k, "env_use_expand_hidden"))
+ value_for<n::env_use_expand_hidden>(check_get(k, "env_use_expand_hidden")),
+ value_for<n::env_use_expand_implicit>(check_get(k, "env_use_expand_implicit")),
+ value_for<n::env_use_expand_unprefixed>(check_get(k, "env_use_expand_unprefixed")),
+ value_for<n::env_use_expand_values_part>(check_get(k, "env_use_expand_values_part"))
)));
}
@@ -116,6 +120,7 @@ namespace
value_for<n::homepage>(make_metadata_variable(k, "homepage")),
value_for<n::inherited>(make_metadata_variable(k, "inherited")),
value_for<n::iuse>(make_metadata_variable(k, "iuse")),
+ value_for<n::iuse_effective>(make_metadata_variable(k, "iuse_effective")),
value_for<n::keywords>(make_metadata_variable(k, "keywords")),
value_for<n::license>(make_metadata_variable(k, "license")),
value_for<n::long_description>(make_metadata_variable(k, "long_description")),
@@ -241,6 +246,7 @@ namespace
value_for<n::has_expensive_tests>(destringify_key<bool>(k, "has_expensive_tests")),
value_for<n::has_optional_tests>(destringify_key<bool>(k, "has_optional_tests")),
value_for<n::has_recommended_tests>(destringify_key<bool>(k, "has_recommended_tests")),
+ value_for<n::profile_iuse_injection>(destringify_key<bool>(k, "profile_iuse_injection")),
value_for<n::use_expand_separator>(destringify_key<char>(k, "use_expand_separator"))
)));
}
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index e9452fc..6eae724 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -86,6 +86,7 @@ namespace paludis
struct env_distdir;
struct env_ebuild_phase;
struct env_filesdir;
+ struct env_iuse_implicit;
struct env_kv;
struct env_p;
struct env_pf;
@@ -98,6 +99,9 @@ namespace paludis
struct env_use;
struct env_use_expand;
struct env_use_expand_hidden;
+ struct env_use_expand_implicit;
+ struct env_use_expand_unprefixed;
+ struct env_use_expand_values_part;
struct exported_name;
struct f_function_prefix;
struct failure_is_fatal;
@@ -111,6 +115,7 @@ namespace paludis
struct ignore_pivot_env_variables;
struct inherited;
struct iuse;
+ struct iuse_effective;
struct iuse_flag_parse_options;
struct keywords;
struct license;
@@ -135,6 +140,7 @@ namespace paludis
struct package_dep_spec_parse_options;
struct pdepend;
struct pipe_commands;
+ struct profile_iuse_injection;
struct properties;
struct provide;
struct rdepend_defaults_to_depend;
@@ -268,6 +274,7 @@ namespace paludis
NamedValue<n::has_expensive_tests, bool> has_expensive_tests;
NamedValue<n::has_optional_tests, bool> has_optional_tests;
NamedValue<n::has_recommended_tests, bool> has_recommended_tests;
+ NamedValue<n::profile_iuse_injection, bool> profile_iuse_injection;
NamedValue<n::use_expand_separator, char> use_expand_separator;
};
@@ -283,6 +290,7 @@ namespace paludis
NamedValue<n::env_distdir, std::string> env_distdir;
NamedValue<n::env_ebuild_phase, std::string> env_ebuild_phase;
NamedValue<n::env_filesdir, std::string> env_filesdir;
+ NamedValue<n::env_iuse_implicit, std::string> env_iuse_implicit;
NamedValue<n::env_kv, std::string> env_kv;
NamedValue<n::env_p, std::string> env_p;
NamedValue<n::env_pf, std::string> env_pf;
@@ -295,6 +303,9 @@ namespace paludis
NamedValue<n::env_use, std::string> env_use;
NamedValue<n::env_use_expand, std::string> env_use_expand;
NamedValue<n::env_use_expand_hidden, std::string> env_use_expand_hidden;
+ NamedValue<n::env_use_expand_implicit, std::string> env_use_expand_implicit;
+ NamedValue<n::env_use_expand_unprefixed, std::string> env_use_expand_unprefixed;
+ NamedValue<n::env_use_expand_values_part, std::string> env_use_expand_values_part;
};
struct EAPIMetadataVariable
@@ -314,6 +325,7 @@ namespace paludis
NamedValue<n::homepage, std::tr1::shared_ptr<const EAPIMetadataVariable> > homepage;
NamedValue<n::inherited, std::tr1::shared_ptr<const EAPIMetadataVariable> > inherited;
NamedValue<n::iuse, std::tr1::shared_ptr<const EAPIMetadataVariable> > iuse;
+ NamedValue<n::iuse_effective, std::tr1::shared_ptr<const EAPIMetadataVariable> > iuse_effective;
NamedValue<n::keywords, std::tr1::shared_ptr<const EAPIMetadataVariable> > keywords;
NamedValue<n::license, std::tr1::shared_ptr<const EAPIMetadataVariable> > license;
NamedValue<n::long_description, std::tr1::shared_ptr<const EAPIMetadataVariable> > long_description;
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index 3f17d5b..a302c3c 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -14,6 +14,7 @@ rdepend_defaults_to_depend = true
use_expand_separator = _
want_portage_emulation_vars = true
require_use_expand_in_iuse = false
+profile_iuse_injection = false
support_eclasses = true
support_exlibs = false
utility_path_suffixes =
@@ -199,6 +200,7 @@ flat_list_dependencies = -1
flat_list_homepage = 5
flat_list_inherited = 9
flat_list_iuse = 10
+flat_list_iuse_effective = -1
flat_list_myoptions = -1
flat_list_keywords = 8
flat_list_license = 6
@@ -222,6 +224,10 @@ flat_list_defined_phases = 16
env_use = USE
env_use_expand = USE_EXPAND
env_use_expand_hidden = USE_EXPAND_HIDDEN
+env_use_expand_implicit = USE_EXPAND_IMPLICIT
+env_use_expand_unprefixed = USE_EXPAND_UNPREFIXED
+env_use_expand_values_part = USE_EXPAND_VALUES_
+env_iuse_implicit = IUSE_IMPLICIT
env_aa = AA
env_arch = ARCH
env_kv = KV
diff --git a/paludis/repositories/e/eapis/3.conf b/paludis/repositories/e/eapis/3.conf
index 21276ff..65a885b 100644
--- a/paludis/repositories/e/eapis/3.conf
+++ b/paludis/repositories/e/eapis/3.conf
@@ -33,6 +33,13 @@ env_kv =
env_replacing_versions = REPLACING_VERSIONS
env_replaced_by_version = REPLACED_BY_VERSION
+metadata_iuse_effective = IUSE_EFFECTIVE
+description_iuse_effective = All relevant USE flags
+flat_list_iuse_effective = -1
+description_iuse = Listed relevant USE flags
+
+vdb_from_env_variables = ${vdb_from_env_variables} IUSE_EFFECTIVE
+
package_dep_spec_parse_options = ${package_dep_spec_parse_options} \
allow_slot_equal_deps allow_slot_star_deps allow_use_dep_defaults
@@ -53,3 +60,6 @@ unpack_suffixes = tar tar.gz,tgz,tar.Z tar.bz2,tbz2,tbz zip,ZIP,jar gz,Z,z bz2 r
econf_extra_options = --disable-dependency-tracking
+require_use_expand_in_iuse = true
+profile_iuse_injection = true
+
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 03a2a94..19914ae 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -17,6 +17,7 @@ merger_options =
breaks_portage = true
want_portage_emulation_vars = false
require_use_expand_in_iuse = true
+profile_iuse_injection = false
rdepend_defaults_to_depend = false
support_eclasses = false
support_exlibs = true
@@ -234,6 +235,7 @@ flat_list_dependencies = -1
flat_list_homepage = -1
flat_list_inherited = -1
flat_list_iuse = -1
+flat_list_iuse_effective = -1
flat_list_myoptions = -1
flat_list_keywords = -1
flat_list_license = -1
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index 8d2bd2d..fdea12c 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -15,6 +15,7 @@ breaks_portage = true
rdepend_defaults_to_depend = false
want_portage_emulation_vars = true
require_use_expand_in_iuse = false
+profile_iuse_injection = false
support_eclasses = true
support_exlibs = false
utility_path_suffixes =
@@ -202,6 +203,7 @@ flat_list_dependencies = -1
flat_list_homepage = -1
flat_list_inherited = -1
flat_list_iuse = -1
+flat_list_iuse_effective = -1
flat_list_myoptions = -1
flat_list_keywords = -1
flat_list_license = -1
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index f52259c..c52c8eb 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -254,6 +254,12 @@ EbuildCommand::operator() ()
cmd.with_setenv(params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_filesdir(),
stringify(params.files_dir()));
+ if (! params.package_id()->eapi()->supported()->ebuild_metadata_variables()->iuse_effective()->name().empty())
+ if (params.package_id()->raw_iuse_effective_key())
+ cmd.with_setenv(params.package_id()->eapi()->supported()->ebuild_metadata_variables()->iuse_effective()->name(),
+ join(params.package_id()->raw_iuse_effective_key()->value()->begin(),
+ params.package_id()->raw_iuse_effective_key()->value()->end(), " "));
+
if (params.package_id()->eapi()->supported()->ebuild_options()->support_eclasses())
cmd
.with_setenv("ECLASSDIR", stringify(*params.eclassdirs()->begin()))
@@ -948,6 +954,12 @@ WriteVDBEntryCommand::operator() ()
params.package_id(), _1, params.maybe_output_manager()))
);
+ if (! params.package_id()->eapi()->supported()->ebuild_metadata_variables()->iuse_effective()->name().empty())
+ if (params.package_id()->raw_iuse_effective_key())
+ cmd.with_setenv(params.package_id()->eapi()->supported()->ebuild_metadata_variables()->iuse_effective()->name(),
+ join(params.package_id()->raw_iuse_effective_key()->value()->begin(),
+ params.package_id()->raw_iuse_effective_key()->value()->end(), " "));
+
if (params.maybe_output_manager())
cmd
.with_captured_stderr_stream(&params.maybe_output_manager()->stderr_stream())
diff --git a/paludis/repositories/e/ebuild/0/list_functions.bash b/paludis/repositories/e/ebuild/0/list_functions.bash
index 27046ae..61c9318 100644
--- a/paludis/repositories/e/ebuild/0/list_functions.bash
+++ b/paludis/repositories/e/ebuild/0/list_functions.bash
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
-# Copyright (c) 2006 Ciaran McCreesh
+# Copyright (c) 2006, 2009 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
@@ -37,6 +37,12 @@ usev()
useq()
{
+ if [[ -n "${IUSE_EFFECTIVE:+x}" ]] ; then
+ if ! hasq ${1#!} "${IUSE_EFFECTIVE}" ; then
+ die "Flag '${1#!}' is not included in IUSE_EFFECTIVE"
+ fi
+ fi
+
if [[ "${1:0:1}" == "!" ]] ; then
! hasq "${1#!}" "${USE}"
else
@@ -68,3 +74,4 @@ hasq()
done
return 1
}
+
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 33177e2..a6a59b8 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -94,6 +94,7 @@ namespace paludis
mutable std::tr1::shared_ptr<const ELicenseKey> license;
mutable std::tr1::shared_ptr<const EKeywordsKey> keywords;
mutable std::tr1::shared_ptr<const EStringSetKey> raw_iuse;
+ mutable std::tr1::shared_ptr<const LiteralMetadataStringSetKey> raw_iuse_effective;
mutable std::tr1::shared_ptr<const EMyOptionsKey> raw_myoptions;
mutable std::tr1::shared_ptr<const EStringSetKey> inherited;
mutable std::tr1::shared_ptr<const EStringSetKey> raw_use;
@@ -298,12 +299,12 @@ EbuildID::need_keys_added() const
_imp->eapi->supported()->ebuild_metadata_variables()->use_expand()->name(),
_imp->eapi->supported()->ebuild_metadata_variables()->use_expand()->description(),
mkt_internal,
- std::tr1::static_pointer_cast<const ERepository>(repository())->profile()->use_expand()));
+ e_repository()->profile()->use_expand()));
_imp->raw_use_expand_hidden = make_shared_ptr(new LiteralMetadataStringSetKey(
_imp->eapi->supported()->ebuild_metadata_variables()->use_expand_hidden()->name(),
_imp->eapi->supported()->ebuild_metadata_variables()->use_expand_hidden()->description(),
mkt_internal,
- std::tr1::static_pointer_cast<const ERepository>(repository())->profile()->use_expand_hidden()));
+ e_repository()->profile()->use_expand_hidden()));
std::tr1::shared_ptr<const MetadataXML> m(MetadataXMLPool::get_instance()->metadata_if_exists(
_imp->fs_location->value().dirname() / "metadata.xml"));
@@ -318,16 +319,55 @@ EbuildID::need_keys_added() const
add_metadata_key(make_shared_ptr(new LiteralMetadataStringSequenceKey("maintainers", "Maintainers", mkt_normal, m->maintainers())));
maybe_use_descriptions = m->uses();
}
- }
- if (_imp->eapi->supported())
+ if (_imp->eapi->supported()->choices_options()->profile_iuse_injection())
+ {
+ std::tr1::shared_ptr<Set<std::string> > iuse_effective(new Set<std::string>);
+ if (! _imp->raw_iuse)
+ throw InternalError(PALUDIS_HERE, "no raw_iuse?");
+
+ std::copy(_imp->raw_iuse->value()->begin(), _imp->raw_iuse->value()->end(), iuse_effective->inserter());
+ std::copy(e_repository()->profile()->iuse_implicit()->begin(), e_repository()->profile()->iuse_implicit()->end(),
+ iuse_effective->inserter());
+
+ const std::tr1::shared_ptr<const Set<std::string> > use_expand_unprefixed(e_repository()->profile()->use_expand_unprefixed());
+ const std::string separator(stringify(_imp->eapi->supported()->choices_options()->use_expand_separator()));
+
+ for (Set<std::string>::ConstIterator x(e_repository()->profile()->use_expand_implicit()->begin()),
+ x_end(e_repository()->profile()->use_expand_implicit()->end()) ;
+ x != x_end ; ++x)
+ {
+ std::string lower_x;
+ std::transform(x->begin(), x->end(), std::back_inserter(lower_x), &::tolower);
+
+ bool prefixed(use_expand_unprefixed->end() == use_expand_unprefixed->find(*x));
+ const std::tr1::shared_ptr<const Set<std::string> > values(e_repository()->profile()->use_expand_values(*x));
+ for (Set<std::string>::ConstIterator v(values->begin()), v_end(values->end()) ;
+ v != v_end ; ++v)
+ {
+ if (prefixed)
+ iuse_effective->insert(lower_x + separator + *v);
+ else
+ iuse_effective->insert(*v);
+ }
+ }
+
+ _imp->raw_iuse_effective.reset(new LiteralMetadataStringSetKey(
+ _imp->eapi->supported()->ebuild_metadata_variables()->iuse_effective()->name(),
+ _imp->eapi->supported()->ebuild_metadata_variables()->iuse_effective()->description(),
+ mkt_internal,
+ iuse_effective));
+ add_metadata_key(_imp->raw_iuse_effective);
+ }
+
_imp->choices.reset(new EChoicesKey(_imp->environment, shared_from_this(), "PALUDIS_CHOICES",
_imp->eapi->supported()->ebuild_environment_variables()->description_choices(),
- mkt_normal, std::tr1::static_pointer_cast<const ERepository>(repository()),
+ mkt_normal, e_repository(),
maybe_use_descriptions));
+ }
else
_imp->choices.reset(new EChoicesKey(_imp->environment, shared_from_this(), "PALUDIS_CHOICES", "Choices", mkt_normal,
- std::tr1::static_pointer_cast<const ERepository>(repository()), maybe_use_descriptions));
+ e_repository(), maybe_use_descriptions));
add_metadata_key(_imp->choices);
}
@@ -597,6 +637,13 @@ EbuildID::raw_iuse_key() const
return _imp->raw_iuse;
}
+const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > >
+EbuildID::raw_iuse_effective_key() const
+{
+ need_keys_added();
+ return _imp->raw_iuse_effective;
+}
+
const std::tr1::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> >
EbuildID::raw_myoptions_key() const
{
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index e7284cb..cf9155c 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -90,6 +90,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_use_key() const;
virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_iuse_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_iuse_effective_key() const;
virtual const std::tr1::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> > raw_myoptions_key() const;
virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_use_expand_key() const;
virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_use_expand_hidden_key() const;