aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-12-16 22:57:02 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-12-16 23:19:51 +0000
commit4f87fd12f82fb6f7b92651cc88e673b50d5ec836 (patch)
tree6cdba96828abbf982e8dbc9fe0cb26145f75f1ec
parent48b71ce3fdfa8ecfe304c942f690ca2036720028 (diff)
downloadpaludis-4f87fd12f82fb6f7b92651cc88e673b50d5ec836.tar.gz
paludis-4f87fd12f82fb6f7b92651cc88e673b50d5ec836.tar.xz
Environment::interest_in_suggestion
-rw-r--r--paludis/environment.hh18
-rw-r--r--paludis/environments/no_config/no_config_environment.cc8
-rw-r--r--paludis/environments/no_config/no_config_environment.hh5
-rw-r--r--paludis/environments/paludis/paludis_environment.cc8
-rw-r--r--paludis/environments/paludis/paludis_environment.hh4
-rw-r--r--paludis/environments/portage/portage_environment.cc8
-rw-r--r--paludis/environments/portage/portage_environment.hh4
-rw-r--r--paludis/environments/test/test_environment.cc8
-rw-r--r--paludis/environments/test/test_environment.hh4
-rw-r--r--python/environment.cc7
10 files changed, 74 insertions, 0 deletions
diff --git a/paludis/environment.hh b/paludis/environment.hh
index 141bd1f..74f9086 100644
--- a/paludis/environment.hh
+++ b/paludis/environment.hh
@@ -147,6 +147,24 @@ namespace paludis
///\}
+ ///\name Suggestion-related queries
+ ///\{
+
+ /**
+ * Do we want to ignore or take a particular suggestion from a
+ * particular package?
+ *
+ * Command line things override this.
+ *
+ * \since 0.58
+ */
+ virtual Tribool interest_in_suggestion(
+ const std::shared_ptr<const PackageID> & from_id,
+ const PackageDepSpec & spec) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ ///\}
+
///\name Mask-related queries
///\{
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index e2d8ff8..73f37d2 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -639,3 +639,11 @@ NoConfigEnvironment::update_config_files_for_package_move(const PackageDepSpec &
{
}
+Tribool
+NoConfigEnvironment::interest_in_suggestion(
+ const std::shared_ptr<const PackageID> &,
+ const PackageDepSpec &) const
+{
+ return indeterminate;
+}
+
diff --git a/paludis/environments/no_config/no_config_environment.hh b/paludis/environments/no_config/no_config_environment.hh
index 5419375..1ccb45a 100644
--- a/paludis/environments/no_config/no_config_environment.hh
+++ b/paludis/environments/no_config/no_config_environment.hh
@@ -163,6 +163,11 @@ namespace paludis
) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual Tribool interest_in_suggestion(
+ const std::shared_ptr<const PackageID> & from_id,
+ const PackageDepSpec & spec) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
virtual std::shared_ptr<PackageDatabase> package_database()
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index 4f57ade..2e76cc8 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -496,6 +496,14 @@ PaludisEnvironment::known_choice_value_names(
return _imp->config->use_conf()->known_choice_value_names(id, choice);
}
+Tribool
+PaludisEnvironment::interest_in_suggestion(
+ const std::shared_ptr<const PackageID> &,
+ const PackageDepSpec &) const
+{
+ return indeterminate;
+}
+
const std::shared_ptr<OutputManager>
PaludisEnvironment::create_output_manager(const CreateOutputManagerInfo & i) const
{
diff --git a/paludis/environments/paludis/paludis_environment.hh b/paludis/environments/paludis/paludis_environment.hh
index 84c8e25..acda2d2 100644
--- a/paludis/environments/paludis/paludis_environment.hh
+++ b/paludis/environments/paludis/paludis_environment.hh
@@ -164,6 +164,10 @@ namespace paludis
) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual Tribool interest_in_suggestion(
+ const std::shared_ptr<const PackageID> & from_id,
+ const PackageDepSpec & spec) const;
+
virtual const std::shared_ptr<OutputManager> create_output_manager(
const CreateOutputManagerInfo &) const;
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index 597640d..ee1ed89 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -1054,3 +1054,11 @@ PortageEnvironment::repository_from_new_config_file(const FSPath &)
throw InternalError(PALUDIS_HERE, "can't create repositories on the fly for PortageEnvironment");
}
+Tribool
+PortageEnvironment::interest_in_suggestion(
+ const std::shared_ptr<const PackageID> &,
+ const PackageDepSpec &) const
+{
+ return indeterminate;
+}
+
diff --git a/paludis/environments/portage/portage_environment.hh b/paludis/environments/portage/portage_environment.hh
index ef507e3..82de795 100644
--- a/paludis/environments/portage/portage_environment.hh
+++ b/paludis/environments/portage/portage_environment.hh
@@ -92,6 +92,10 @@ namespace paludis
///\}
+ virtual Tribool interest_in_suggestion(
+ const std::shared_ptr<const PackageID> & from_id,
+ const PackageDepSpec & spec) const;
+
virtual const Tribool want_choice_enabled(
const std::shared_ptr<const PackageID> &,
const std::shared_ptr<const Choice> &,
diff --git a/paludis/environments/test/test_environment.cc b/paludis/environments/test/test_environment.cc
index fecb646..7e374e5 100644
--- a/paludis/environments/test/test_environment.cc
+++ b/paludis/environments/test/test_environment.cc
@@ -309,6 +309,14 @@ TestEnvironment::set_want_choice_enabled(const ChoicePrefixName & p, const Unpre
_imp->override_want_choice_enabled[stringify(p) + ":" + stringify(n)] = v;
}
+Tribool
+TestEnvironment::interest_in_suggestion(
+ const std::shared_ptr<const PackageID> &,
+ const PackageDepSpec &) const
+{
+ return indeterminate;
+}
+
void
TestEnvironment::populate_sets() const
{
diff --git a/paludis/environments/test/test_environment.hh b/paludis/environments/test/test_environment.hh
index 79055af..c80448a 100644
--- a/paludis/environments/test/test_environment.hh
+++ b/paludis/environments/test/test_environment.hh
@@ -121,6 +121,10 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > preferred_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > system_root_key() const;
+ virtual Tribool interest_in_suggestion(
+ const std::shared_ptr<const PackageID> & from_id,
+ const PackageDepSpec & spec) const;
+
virtual const Tribool want_choice_enabled(
const std::shared_ptr<const PackageID> &,
const std::shared_ptr<const Choice> &,
diff --git a/python/environment.cc b/python/environment.cc
index f776ea6..5e8f256 100644
--- a/python/environment.cc
+++ b/python/environment.cc
@@ -416,6 +416,13 @@ class EnvironmentImplementationWrapper :
throw PythonMethodNotImplemented("EnvironmentImplementation", "system_root_key");
}
+ virtual Tribool interest_in_suggestion(
+ const std::shared_ptr<const PackageID> &,
+ const PackageDepSpec &) const
+ {
+ throw PythonMethodNotImplemented("EnvironmentImplementation", "interest_in_suggestion");
+ }
+
virtual const Tribool want_choice_enabled(
const std::shared_ptr<const PackageID> &,
const std::shared_ptr<const Choice> &,