diff options
author | 2010-12-27 23:54:51 +0000 | |
---|---|---|
committer | 2011-01-01 03:57:52 +0000 | |
commit | 97c38fc7c02260a2d213d9a16d878a0410b9d57a (patch) | |
tree | fef7c8137e22b2582acb3b66496ced9aa4135897 /paludis/environments/paludis | |
parent | a1b11d059009182f19bf9cf23e060dee752d4632 (diff) | |
download | paludis-97c38fc7c02260a2d213d9a16d878a0410b9d57a.tar.gz paludis-97c38fc7c02260a2d213d9a16d878a0410b9d57a.tar.xz |
Pass PackageIDs by shared_ptr
Diffstat (limited to 'paludis/environments/paludis')
-rw-r--r-- | paludis/environments/paludis/keywords_conf.cc | 4 | ||||
-rw-r--r-- | paludis/environments/paludis/keywords_conf.hh | 2 | ||||
-rw-r--r-- | paludis/environments/paludis/licenses_conf.cc | 4 | ||||
-rw-r--r-- | paludis/environments/paludis/licenses_conf.hh | 2 | ||||
-rw-r--r-- | paludis/environments/paludis/output_conf.cc | 2 | ||||
-rw-r--r-- | paludis/environments/paludis/package_mask_conf.cc | 2 | ||||
-rw-r--r-- | paludis/environments/paludis/package_mask_conf.hh | 2 | ||||
-rw-r--r-- | paludis/environments/paludis/paludis_environment.cc | 14 | ||||
-rw-r--r-- | paludis/environments/paludis/paludis_environment.hh | 10 | ||||
-rw-r--r-- | paludis/environments/paludis/suggestions_conf.cc | 6 |
10 files changed, 24 insertions, 24 deletions
diff --git a/paludis/environments/paludis/keywords_conf.cc b/paludis/environments/paludis/keywords_conf.cc index d40bc4e44..ab8dc04de 100644 --- a/paludis/environments/paludis/keywords_conf.cc +++ b/paludis/environments/paludis/keywords_conf.cc @@ -132,7 +132,7 @@ KeywordsConf::add(const FSPath & filename) } bool -KeywordsConf::query(const std::shared_ptr<const KeywordNameSet> & k, const PackageID & e) const +KeywordsConf::query(const std::shared_ptr<const KeywordNameSet> & k, const std::shared_ptr<const PackageID> & e) const { static const KeywordName star_keyword("*"); static const KeywordName minus_star_keyword("-*"); @@ -143,7 +143,7 @@ KeywordsConf::query(const std::shared_ptr<const KeywordNameSet> & k, const Packa /* highest priority: specific */ bool break_when_done(false); { - SpecificMap::const_iterator i(_imp->qualified.find(e.name())); + SpecificMap::const_iterator i(_imp->qualified.find(e->name())); if (i != _imp->qualified.end()) { for (PDSToKeywordsList::const_iterator j(i->second.begin()), j_end(i->second.end()) ; diff --git a/paludis/environments/paludis/keywords_conf.hh b/paludis/environments/paludis/keywords_conf.hh index 4e6328686..08cdb2a07 100644 --- a/paludis/environments/paludis/keywords_conf.hh +++ b/paludis/environments/paludis/keywords_conf.hh @@ -60,7 +60,7 @@ namespace paludis /** * Query a collection of keywords. */ - bool query(const std::shared_ptr<const KeywordNameSet> &, const PackageID &) const; + bool query(const std::shared_ptr<const KeywordNameSet> &, const std::shared_ptr<const PackageID> &) const; }; } } diff --git a/paludis/environments/paludis/licenses_conf.cc b/paludis/environments/paludis/licenses_conf.cc index 2ebaeac5e..52e2e8f68 100644 --- a/paludis/environments/paludis/licenses_conf.cc +++ b/paludis/environments/paludis/licenses_conf.cc @@ -132,12 +132,12 @@ LicensesConf::add(const FSPath & filename) } bool -LicensesConf::query(const std::string & t, const PackageID & e) const +LicensesConf::query(const std::string & t, const std::shared_ptr<const PackageID> & e) const { /* highest priority: specific */ bool break_when_done(false); { - SpecificMap::const_iterator i(_imp->qualified.find(e.name())); + SpecificMap::const_iterator i(_imp->qualified.find(e->name())); if (i != _imp->qualified.end()) { for (PDSToLicensesList::const_iterator j(i->second.begin()), j_end(i->second.end()) ; diff --git a/paludis/environments/paludis/licenses_conf.hh b/paludis/environments/paludis/licenses_conf.hh index 2071ad19f..863fc3a75 100644 --- a/paludis/environments/paludis/licenses_conf.hh +++ b/paludis/environments/paludis/licenses_conf.hh @@ -60,7 +60,7 @@ namespace paludis /** * Query a particular license. */ - bool query(const std::string &, const PackageID &) const; + bool query(const std::string &, const std::shared_ptr<const PackageID> &) const; }; } } diff --git a/paludis/environments/paludis/output_conf.cc b/paludis/environments/paludis/output_conf.cc index e8b15be11..b5977fff5 100644 --- a/paludis/environments/paludis/output_conf.cc +++ b/paludis/environments/paludis/output_conf.cc @@ -196,7 +196,7 @@ namespace return false; if (rule.matches_requirement() && ! match_package(*env, *rule.matches_requirement(), - *i.package_id(), { })) + i.package_id(), { })) return false; if (! rule.ignore_unfetched_requirement().is_indeterminate()) diff --git a/paludis/environments/paludis/package_mask_conf.cc b/paludis/environments/paludis/package_mask_conf.cc index 220640546..75ff80fc6 100644 --- a/paludis/environments/paludis/package_mask_conf.cc +++ b/paludis/environments/paludis/package_mask_conf.cc @@ -98,7 +98,7 @@ PackageMaskConf::add(const FSPath & filename) } bool -PackageMaskConf::query(const PackageID & e) const +PackageMaskConf::query(const std::shared_ptr<const PackageID> & e) const { using namespace std::placeholders; if (indirect_iterator(_imp->masks.end()) != std::find_if( diff --git a/paludis/environments/paludis/package_mask_conf.hh b/paludis/environments/paludis/package_mask_conf.hh index feaa51edf..f8e9ce0c4 100644 --- a/paludis/environments/paludis/package_mask_conf.hh +++ b/paludis/environments/paludis/package_mask_conf.hh @@ -61,7 +61,7 @@ namespace paludis /** * Query a mask. */ - bool query(const PackageID &) const; + bool query(const std::shared_ptr<const PackageID> &) const; }; } } diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc index ea98e6d2c..00919d83a 100644 --- a/paludis/environments/paludis/paludis_environment.cc +++ b/paludis/environments/paludis/paludis_environment.cc @@ -175,26 +175,26 @@ PaludisEnvironment::~PaludisEnvironment() bool PaludisEnvironment::accept_keywords(const std::shared_ptr<const KeywordNameSet> & k, - const PackageID & e) const + const std::shared_ptr<const PackageID> & e) const { return _imp->config->keywords_conf()->query(k, e); } bool -PaludisEnvironment::accept_license(const std::string & license, const PackageID & d) const +PaludisEnvironment::accept_license(const std::string & license, const std::shared_ptr<const PackageID> & d) const { if (license == "*") return true; if (license == "-*") return false; - Context context("When checking license of '" + license + "' for '" + stringify(d) + "':"); + Context context("When checking license of '" + license + "' for '" + stringify(*d) + "':"); return _imp->config->licenses_conf()->query(license, d); } bool -PaludisEnvironment::unmasked_by_user(const PackageID & d) const +PaludisEnvironment::unmasked_by_user(const std::shared_ptr<const PackageID> & d) const { return _imp->config->package_unmask_conf()->query(d); } @@ -411,11 +411,11 @@ namespace } const std::shared_ptr<const Mask> -PaludisEnvironment::mask_for_breakage(const PackageID & id) const +PaludisEnvironment::mask_for_breakage(const std::shared_ptr<const PackageID> & id) const { if (! _imp->config->accept_all_breaks_portage()) { - std::shared_ptr<const Set<std::string> > breakages(id.breaks_portage()); + std::shared_ptr<const Set<std::string> > breakages(id->breaks_portage()); if (breakages) { std::list<std::string> bad_breakages; @@ -431,7 +431,7 @@ PaludisEnvironment::mask_for_breakage(const PackageID & id) const } const std::shared_ptr<const Mask> -PaludisEnvironment::mask_for_user(const PackageID & d, const bool o) const +PaludisEnvironment::mask_for_user(const std::shared_ptr<const PackageID> & d, const bool o) const { if (_imp->config->package_mask_conf()->query(d)) return std::make_shared<UserConfigMask>(o); diff --git a/paludis/environments/paludis/paludis_environment.hh b/paludis/environments/paludis/paludis_environment.hh index acda2d224..7e45f01fb 100644 --- a/paludis/environments/paludis/paludis_environment.hh +++ b/paludis/environments/paludis/paludis_environment.hh @@ -116,19 +116,19 @@ namespace paludis virtual std::string distribution() const PALUDIS_ATTRIBUTE((warn_unused_result)); - virtual bool accept_keywords(const std::shared_ptr<const KeywordNameSet> &, const PackageID &) const + virtual bool accept_keywords(const std::shared_ptr<const KeywordNameSet> &, const std::shared_ptr<const PackageID> &) const PALUDIS_ATTRIBUTE((warn_unused_result)); - virtual bool accept_license(const std::string &, const PackageID &) const + virtual bool accept_license(const std::string &, const std::shared_ptr<const PackageID> &) const PALUDIS_ATTRIBUTE((warn_unused_result)); - virtual const std::shared_ptr<const Mask> mask_for_breakage(const PackageID &) const + virtual const std::shared_ptr<const Mask> mask_for_breakage(const std::shared_ptr<const PackageID> &) const PALUDIS_ATTRIBUTE((warn_unused_result)); - virtual const std::shared_ptr<const Mask> mask_for_user(const PackageID &, const bool) const + virtual const std::shared_ptr<const Mask> mask_for_user(const std::shared_ptr<const PackageID> &, const bool) const PALUDIS_ATTRIBUTE((warn_unused_result)); - virtual bool unmasked_by_user(const PackageID &) const + virtual bool unmasked_by_user(const std::shared_ptr<const PackageID> &) const PALUDIS_ATTRIBUTE((warn_unused_result)); virtual bool add_to_world(const QualifiedPackageName &) const; diff --git a/paludis/environments/paludis/suggestions_conf.cc b/paludis/environments/paludis/suggestions_conf.cc index 91b6dde97..dbd5e5dce 100644 --- a/paludis/environments/paludis/suggestions_conf.cc +++ b/paludis/environments/paludis/suggestions_conf.cc @@ -194,7 +194,7 @@ SuggestionsConf::interest_in_suggestion( for (PDSToValuesList::const_iterator j(i->second.begin()), j_end(i->second.end()) ; j != j_end ; ++j) { - if (! match_package(*_imp->env, *j->first, *from_id, { })) + if (! match_package(*_imp->env, *j->first, from_id, { })) continue; for (ValuesList::const_iterator l(j->second.begin()), l_end(j->second.end()) ; @@ -238,7 +238,7 @@ SuggestionsConf::interest_in_suggestion( } } - if (! match_package_in_set(*_imp->env, *i->second.first, *from_id, { })) + if (! match_package_in_set(*_imp->env, *i->second.first, from_id, { })) continue; for (ValuesList::const_iterator l(i->second.second.begin()), l_end(i->second.second.end()) ; @@ -269,7 +269,7 @@ SuggestionsConf::interest_in_suggestion( for (PDSToValuesList::const_iterator j(_imp->unqualified.begin()), j_end(_imp->unqualified.end()) ; j != j_end ; ++j) { - if (! match_package(*_imp->env, *j->first, *from_id, { })) + if (! match_package(*_imp->env, *j->first, from_id, { })) continue; for (ValuesList::const_iterator l(j->second.begin()), l_end(j->second.end()) ; |