aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-05-07 18:20:28 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-05-07 18:20:28 +0000
commita6b46b02224c850bf7e2fddb11c19bc574794ad9 (patch)
tree590dee915f3acb53de588e65f837977758b2f904
parentb4e6ea2c7ce22d99fb4d292d520978ea0971f163 (diff)
downloadpaludis-a6b46b02224c850bf7e2fddb11c19bc574794ad9.tar.gz
paludis-a6b46b02224c850bf7e2fddb11c19bc574794ad9.tar.xz
Catch query_use being called recursively. Warn for use restrictions in use.conf. Fixes: ticket:218
-rw-r--r--paludis/environments/paludis/paludis_environment.cc12
-rw-r--r--paludis/environments/paludis/use_conf.cc8
-rw-r--r--paludis/environments/portage/portage_environment.cc12
3 files changed, 32 insertions, 0 deletions
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index ced42a9..d75ebb1 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -145,6 +145,18 @@ PaludisEnvironment::~PaludisEnvironment()
bool
PaludisEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry & e) const
{
+ Context context("When querying use flag '" + stringify(f) + "' for '" + stringify(e) +
+ "' in Paludis environment:");
+
+ static bool recursive(false);
+ if (recursive)
+ {
+ Log::get_instance()->message(ll_warning, lc_context) <<
+ "use flag state is defined recursively, forcing it to disabled instead";
+ return false;
+ }
+ Save<bool> save_recursive(&recursive, true);
+
/* first check package database use masks... */
std::tr1::shared_ptr<const Repository> repo(package_database()->fetch_repository(e.repository));
diff --git a/paludis/environments/paludis/use_conf.cc b/paludis/environments/paludis/use_conf.cc
index 42138ee..995be1f 100644
--- a/paludis/environments/paludis/use_conf.cc
+++ b/paludis/environments/paludis/use_conf.cc
@@ -123,6 +123,14 @@ UseConf::add(const FSEntry & filename)
else
{
std::tr1::shared_ptr<PackageDepSpec> d(new PackageDepSpec(tokens.at(0), pds_pm_unspecific));
+
+ if (d->use_requirements_ptr())
+ {
+ Log::get_instance()->message(ll_warning, lc_context) << "Dependency specification '" << stringify(*d)
+ << "' includes use requirements, which cannot be used in use.conf";
+ continue;
+ }
+
if (d->package_ptr())
{
Qualified::iterator ii(_imp->qualified.insert(std::make_pair(*d->package_ptr(), PDSWithUseInfoList())).first);
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index ce88c3d..be0441a 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -417,6 +417,18 @@ PortageEnvironment::~PortageEnvironment()
bool
PortageEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry & e) const
{
+ Context context("When querying use flag '" + stringify(f) + "' for '" + stringify(e) +
+ "' in Portage environment:");
+
+ static bool recursive(false);
+ if (recursive)
+ {
+ Log::get_instance()->message(ll_warning, lc_context) <<
+ "use flag state is defined recursively, forcing it to disabled instead";
+ return false;
+ }
+ Save<bool> save_recursive(&recursive, true);
+
/* first check package database use masks... */
std::tr1::shared_ptr<const Repository> repo(package_database()->fetch_repository(e.repository));