aboutsummaryrefslogtreecommitdiff
path: root/paludis
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-04-15 16:00:31 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-04-15 16:00:31 +0000
commit5d772b93f057ee32959e9ae9344162514899590e (patch)
tree41d481804724aa9c9ef98b7d80647c9a8451f2e4 /paludis
parent945c4efa654b56d005c59b80f7ce29286fad8a32 (diff)
downloadpaludis-5d772b93f057ee32959e9ae9344162514899590e.tar.gz
paludis-5d772b93f057ee32959e9ae9344162514899590e.tar.xz
Support set names in .conf sets.
Diffstat (limited to 'paludis')
-rw-r--r--paludis/set_file.cc35
1 files changed, 23 insertions, 12 deletions
diff --git a/paludis/set_file.cc b/paludis/set_file.cc
index e118595a3..92df58ff9 100644
--- a/paludis/set_file.cc
+++ b/paludis/set_file.cc
@@ -185,23 +185,34 @@ namespace
{
Log::get_instance()->message(ll_warning, lc_context, "Line '" + stringify(line) +
"' should start with '?' or '*', assuming '*'");
-
- tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(params.parser(tokens.at(0))));
- if (params.tag)
- spec->set_tag(params.tag);
- result->add(tr1::shared_ptr<TreeLeaf<SetSpecTree, PackageDepSpec> >(
- new TreeLeaf<SetSpecTree, PackageDepSpec>(spec)));
+ tokens.insert(tokens.begin(), "*");
}
- else if ("*" == tokens.at(0))
+
+ if ("*" == tokens.at(0))
{
- tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(params.parser(tokens.at(1))));
- if (params.tag)
- spec->set_tag(params.tag);
- result->add(tr1::shared_ptr<TreeLeaf<SetSpecTree, PackageDepSpec> >(
- new TreeLeaf<SetSpecTree, PackageDepSpec>(spec)));
+ if (std::string::npos == tokens.at(1).find('/'))
+ {
+ tr1::shared_ptr<NamedSetDepSpec> spec(new NamedSetDepSpec(SetName(tokens.at(1))));
+ result->add(tr1::shared_ptr<TreeLeaf<SetSpecTree, NamedSetDepSpec> >(
+ new TreeLeaf<SetSpecTree, NamedSetDepSpec>(spec)));
+ }
+ else
+ {
+ tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(params.parser(tokens.at(1))));
+ if (params.tag)
+ spec->set_tag(params.tag);
+ result->add(tr1::shared_ptr<TreeLeaf<SetSpecTree, PackageDepSpec> >(
+ new TreeLeaf<SetSpecTree, PackageDepSpec>(spec)));
+ }
}
else if ("?" == tokens.at(0))
{
+ if (std::string::npos == tokens.at(1).find('/'))
+ {
+ Log::get_instance()->message(ll_warning, lc_context, "? operator may not be used with a set name");
+ return;
+ }
+
tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(params.parser(tokens.at(1))));
if (params.tag)
spec->set_tag(params.tag);