aboutsummaryrefslogtreecommitdiff
path: root/paludis/environments/paludis
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-28 23:44:02 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-04 08:32:58 +0100
commitb7f5d7dbfeff2e406ef24ca471657e1735a4db4f (patch)
treec1af04c563afeff3b8410022f1cd9079299dd6ce /paludis/environments/paludis
parent968efa61fa4abe5349ffc453ac46087867eaa29b (diff)
downloadpaludis-b7f5d7dbfeff2e406ef24ca471657e1735a4db4f.tar.gz
paludis-b7f5d7dbfeff2e406ef24ca471657e1735a4db4f.tar.xz
Start using constraints for PackageDepSpecs
Diffstat (limited to 'paludis/environments/paludis')
-rw-r--r--paludis/environments/paludis/keywords_conf.cc16
-rw-r--r--paludis/environments/paludis/licenses_conf.cc14
-rw-r--r--paludis/environments/paludis/suggestions_conf.cc20
3 files changed, 31 insertions, 19 deletions
diff --git a/paludis/environments/paludis/keywords_conf.cc b/paludis/environments/paludis/keywords_conf.cc
index 4837cfb12..dd90b2375 100644
--- a/paludis/environments/paludis/keywords_conf.cc
+++ b/paludis/environments/paludis/keywords_conf.cc
@@ -17,18 +17,21 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "keywords_conf.hh"
+#include <paludis/environments/paludis/keywords_conf.hh>
+#include <paludis/environments/paludis/paludis_environment.hh>
+#include <paludis/environments/paludis/bashable_conf.hh>
+
#include <paludis/environment.hh>
#include <paludis/name.hh>
#include <paludis/dep_spec.hh>
#include <paludis/spec_tree.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/match_package.hh>
+#include <paludis/package_id.hh>
+#include <paludis/package_dep_spec_constraint.hh>
+
#include <paludis/util/config_file.hh>
#include <paludis/util/options.hh>
-#include <paludis/package_id.hh>
-#include <paludis/environments/paludis/paludis_environment.hh>
-#include <paludis/environments/paludis/bashable_conf.hh>
#include <paludis/util/log.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/tokeniser.hh>
@@ -38,6 +41,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+
#include <unordered_map>
#include <list>
#include <vector>
@@ -104,9 +108,9 @@ KeywordsConf::add(const FSPath & filename)
{
std::shared_ptr<PackageDepSpec> d(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(
tokens.at(0), _imp->env, { updso_allow_wildcards, updso_no_disambiguation, updso_throw_if_set })));
- if (d->package_ptr())
+ if (d->package_name_constraint())
{
- KeywordsList & k(_imp->qualified[*d->package_ptr()][d]);
+ KeywordsList & k(_imp->qualified[d->package_name_constraint()->name()][d]);
for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
t != t_end ; ++t)
k.push_back(KeywordName(*t));
diff --git a/paludis/environments/paludis/licenses_conf.cc b/paludis/environments/paludis/licenses_conf.cc
index 7e5829278..70b274801 100644
--- a/paludis/environments/paludis/licenses_conf.cc
+++ b/paludis/environments/paludis/licenses_conf.cc
@@ -17,7 +17,10 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "licenses_conf.hh"
+#include <paludis/environments/paludis/licenses_conf.hh>
+#include <paludis/environments/paludis/paludis_environment.hh>
+#include <paludis/environments/paludis/bashable_conf.hh>
+
#include <paludis/environment.hh>
#include <paludis/name.hh>
#include <paludis/dep_spec.hh>
@@ -26,9 +29,9 @@
#include <paludis/match_package.hh>
#include <paludis/util/config_file.hh>
#include <paludis/package_id.hh>
+#include <paludis/package_dep_spec_constraint.hh>
+
#include <paludis/util/options.hh>
-#include <paludis/environments/paludis/paludis_environment.hh>
-#include <paludis/environments/paludis/bashable_conf.hh>
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/pimp-impl.hh>
@@ -37,6 +40,7 @@
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+
#include <unordered_map>
#include <list>
#include <vector>
@@ -104,9 +108,9 @@ LicensesConf::add(const FSPath & filename)
std::shared_ptr<PackageDepSpec> d(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(
tokens.at(0), _imp->env,
{ updso_allow_wildcards, updso_no_disambiguation, updso_throw_if_set })));
- if (d->package_ptr())
+ if (d->package_name_constraint())
{
- LicensesList & k(_imp->qualified[*d->package_ptr()][d]);
+ LicensesList & k(_imp->qualified[d->package_name_constraint()->name()][d]);
for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
t != t_end ; ++t)
k.push_back(*t);
diff --git a/paludis/environments/paludis/suggestions_conf.cc b/paludis/environments/paludis/suggestions_conf.cc
index fa9c313d0..1eafbf180 100644
--- a/paludis/environments/paludis/suggestions_conf.cc
+++ b/paludis/environments/paludis/suggestions_conf.cc
@@ -21,6 +21,7 @@
#include <paludis/environments/paludis/paludis_environment.hh>
#include <paludis/environments/paludis/paludis_config.hh>
#include <paludis/environments/paludis/bashable_conf.hh>
+
#include <paludis/util/config_file.hh>
#include <paludis/util/options.hh>
#include <paludis/util/log.hh>
@@ -31,6 +32,7 @@
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+
#include <paludis/environment.hh>
#include <paludis/name.hh>
#include <paludis/dep_spec.hh>
@@ -39,6 +41,8 @@
#include <paludis/match_package.hh>
#include <paludis/package_id.hh>
#include <paludis/dep_spec_annotations.hh>
+#include <paludis/package_dep_spec_constraint.hh>
+
#include <unordered_map>
#include <list>
#include <vector>
@@ -146,9 +150,9 @@ SuggestionsConf::add(const FSPath & filename)
std::shared_ptr<PackageDepSpec> d(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(
tokens.at(0), _imp->env,
{ updso_allow_wildcards, updso_no_disambiguation, updso_throw_if_set })));
- if (d->package_ptr())
+ if (d->package_name_constraint())
{
- ValuesList & k(_imp->qualified[*d->package_ptr()][d]);
+ ValuesList & k(_imp->qualified[d->package_name_constraint()->name()][d]);
for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
t != t_end ; ++t)
k.push_back(ValueFlag(*t));
@@ -208,10 +212,10 @@ SuggestionsConf::interest_in_suggestion(
else
{
if (! l->pkg_requirement.empty())
- if (stringify(spec.package_ptr()->package()) != l->pkg_requirement)
+ if (stringify(spec.package_name_constraint()->name().package()) != l->pkg_requirement)
continue;
if (! l->cat_requirement.empty())
- if (stringify(spec.package_ptr()->category()) != l->cat_requirement)
+ if (stringify(spec.package_name_constraint()->name().category()) != l->cat_requirement)
continue;
return l->negated ? false : true;
@@ -252,10 +256,10 @@ SuggestionsConf::interest_in_suggestion(
else
{
if (! l->pkg_requirement.empty())
- if (stringify(spec.package_ptr()->package()) != l->pkg_requirement)
+ if (stringify(spec.package_name_constraint()->name().package()) != l->pkg_requirement)
continue;
if (! l->cat_requirement.empty())
- if (stringify(spec.package_ptr()->category()) != l->cat_requirement)
+ if (stringify(spec.package_name_constraint()->name().category()) != l->cat_requirement)
continue;
return l->negated ? false : true;
@@ -283,10 +287,10 @@ SuggestionsConf::interest_in_suggestion(
else
{
if (! l->pkg_requirement.empty())
- if (stringify(spec.package_ptr()->package()) != l->pkg_requirement)
+ if (stringify(spec.package_name_constraint()->name().package()) != l->pkg_requirement)
continue;
if (! l->cat_requirement.empty())
- if (stringify(spec.package_ptr()->category()) != l->cat_requirement)
+ if (stringify(spec.package_name_constraint()->name().category()) != l->cat_requirement)
continue;
return l->negated ? false : true;