aboutsummaryrefslogtreecommitdiff
path: root/paludis/environments
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-04-22 05:19:26 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-04-22 05:19:26 +0000
commitf6739689f4a4971ee069cd7d9d0eb226e80eb10c (patch)
tree4ed204a50d851de501895d340bd54de5788411e3 /paludis/environments
parentf4e46e016ae53de0699aff46f961e254c9fbafc5 (diff)
downloadpaludis-f6739689f4a4971ee069cd7d9d0eb226e80eb10c.tar.gz
paludis-f6739689f4a4971ee069cd7d9d0eb226e80eb10c.tar.xz
Implement foo* sets. Fixes: ticket:561
Diffstat (limited to 'paludis/environments')
-rw-r--r--paludis/environments/paludis/paludis_environment.cc26
-rw-r--r--paludis/environments/paludis/world.cc3
-rw-r--r--paludis/environments/portage/portage_environment.cc3
3 files changed, 21 insertions, 11 deletions
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index 6000c02f1..cd26154df 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -341,48 +341,52 @@ PaludisEnvironment::syncers_dirs() const
}
tr1::shared_ptr<SetSpecTree::ConstItem>
-PaludisEnvironment::local_set(const SetName & s) const
+PaludisEnvironment::local_set(const SetName & ss) const
{
using namespace tr1::placeholders;
- Context context("When looking for package set '" + stringify(s) + "' in paludis environment:");
+ Context context("When looking for package set '" + stringify(ss) + "' in paludis environment:");
Lock l(_imp->sets_mutex);
- std::map<SetName, tr1::shared_ptr<SetSpecTree::ConstItem> >::const_iterator i(_imp->sets.find(s));
+ std::map<SetName, tr1::shared_ptr<SetSpecTree::ConstItem> >::const_iterator i(_imp->sets.find(ss));
if (i != _imp->sets.end())
return i->second;
+ std::pair<SetName, SetFileSetOperatorMode> s(find_base_set_name_and_suffix_mode(ss));
+
FSEntry dir(FSEntry(_imp->config->config_dir()) / "sets");
- tr1::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(s, stringify(s) + ".conf"));
+ tr1::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(ss, stringify(s.first) + ".conf"));
- if ((dir / (stringify(s) + ".bash")).exists())
+ if ((dir / (stringify(s.first) + ".bash")).exists())
{
SetFile f(SetFileParams::create()
- .file_name(dir / (stringify(s) + ".bash"))
+ .file_name(dir / (stringify(s.first) + ".bash"))
.type(sft_paludis_bash)
.parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions() + updso_allow_wildcards))
.tag(tag)
+ .set_operator_mode(s.second)
.environment(this));
- _imp->sets.insert(std::make_pair(s, f.contents()));
+ _imp->sets.insert(std::make_pair(ss, f.contents()));
return f.contents();
}
- else if ((dir / (stringify(s) + ".conf")).exists())
+ else if ((dir / (stringify(s.first) + ".conf")).exists())
{
SetFile f(SetFileParams::create()
- .file_name(dir / (stringify(s) + ".conf"))
+ .file_name(dir / (stringify(s.first) + ".conf"))
.type(sft_paludis_conf)
.parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions() + updso_allow_wildcards))
.tag(tag)
+ .set_operator_mode(s.second)
.environment(this));
- _imp->sets.insert(std::make_pair(s, f.contents()));
+ _imp->sets.insert(std::make_pair(ss, f.contents()));
return f.contents();
}
else
{
- _imp->sets.insert(std::make_pair(s, tr1::shared_ptr<SetSpecTree::ConstItem>()));
+ _imp->sets.insert(std::make_pair(ss, tr1::shared_ptr<SetSpecTree::ConstItem>()));
return tr1::shared_ptr<SetSpecTree::ConstItem>();
}
}
diff --git a/paludis/environments/paludis/world.cc b/paludis/environments/paludis/world.cc
index 4d71c6897..ed4ecb9a8 100644
--- a/paludis/environments/paludis/world.cc
+++ b/paludis/environments/paludis/world.cc
@@ -116,6 +116,7 @@ World::_add_string_to_world(const std::string & n) const
.type(sft_simple)
.parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
.tag(tr1::shared_ptr<DepTag>())
+ .set_operator_mode(sfsmo_natural)
.environment(_imp->env));
world.add(n);
world.rewrite();
@@ -144,6 +145,7 @@ World::_remove_string_from_world(const std::string & n) const
.type(sft_simple)
.parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
.tag(tr1::shared_ptr<DepTag>())
+ .set_operator_mode(sfsmo_natural)
.environment(_imp->env));
world.remove(n);
@@ -167,6 +169,7 @@ World::world_set() const
.type(sft_simple)
.parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
.tag(tag)
+ .set_operator_mode(sfsmo_natural)
.environment(_imp->env));
return world.contents();
}
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index c6f2ecc71..7fa3bf645 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -795,6 +795,7 @@ PortageEnvironment::_add_string_to_world(const std::string & s) const
.type(sft_simple)
.parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
.tag(tr1::shared_ptr<DepTag>())
+ .set_operator_mode(sfsmo_natural)
.environment(this));
world.add(s);
world.rewrite();
@@ -816,6 +817,7 @@ PortageEnvironment::_remove_string_from_world(const std::string & s) const
.type(sft_simple)
.parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
.tag(tr1::shared_ptr<DepTag>())
+ .set_operator_mode(sfsmo_natural)
.environment(this));
world.remove(s);
@@ -841,6 +843,7 @@ PortageEnvironment::world_set() const
.type(sft_simple)
.parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
.tag(tag)
+ .set_operator_mode(sfsmo_natural)
.environment(this));
return world.contents();
}