diff options
author | 2010-12-16 22:57:02 +0000 | |
---|---|---|
committer | 2010-12-16 23:19:51 +0000 | |
commit | 4f87fd12f82fb6f7b92651cc88e673b50d5ec836 (patch) | |
tree | 6cdba96828abbf982e8dbc9fe0cb26145f75f1ec | |
parent | 48b71ce3fdfa8ecfe304c942f690ca2036720028 (diff) | |
download | paludis-4f87fd12f82fb6f7b92651cc88e673b50d5ec836.tar.gz paludis-4f87fd12f82fb6f7b92651cc88e673b50d5ec836.tar.xz |
Environment::interest_in_suggestion
-rw-r--r-- | paludis/environment.hh | 18 | ||||
-rw-r--r-- | paludis/environments/no_config/no_config_environment.cc | 8 | ||||
-rw-r--r-- | paludis/environments/no_config/no_config_environment.hh | 5 | ||||
-rw-r--r-- | paludis/environments/paludis/paludis_environment.cc | 8 | ||||
-rw-r--r-- | paludis/environments/paludis/paludis_environment.hh | 4 | ||||
-rw-r--r-- | paludis/environments/portage/portage_environment.cc | 8 | ||||
-rw-r--r-- | paludis/environments/portage/portage_environment.hh | 4 | ||||
-rw-r--r-- | paludis/environments/test/test_environment.cc | 8 | ||||
-rw-r--r-- | paludis/environments/test/test_environment.hh | 4 | ||||
-rw-r--r-- | python/environment.cc | 7 |
10 files changed, 74 insertions, 0 deletions
diff --git a/paludis/environment.hh b/paludis/environment.hh index 141bd1fd8..74f908643 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 e2d8ff8ca..73f37d2b3 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 54193754f..1ccb45ac6 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 4f57adeea..2e76cc873 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 84c8e2503..acda2d224 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 597640d56..ee1ed8989 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 ef507e30c..82de7959a 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 fecb6467a..7e374e51b 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 79055afe9..c80448a44 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 f776ea6fb..5e8f2563a 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> &, |