aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Stephen P. Bennett <spb@exherbo.org> 2006-05-19 01:03:54 +0000
committerAvatar Stephen P. Bennett <spb@exherbo.org> 2006-05-19 01:03:54 +0000
commitdd978c41e23ecf7954f7b4f3d353f8e1404a6f78 (patch)
treeefae4324223cce6c321bf0fb0dc2e4634fe1f282
parent0990e532a88e0d32c6bea527172672b6ea2af0e2 (diff)
downloadpaludis-dd978c41e23ecf7954f7b4f3d353f8e1404a6f78.tar.gz
paludis-dd978c41e23ecf7954f7b4f3d353f8e1404a6f78.tar.xz
Support -*<package> lines in packages file
-rw-r--r--paludis/portage_repository.cc28
1 files changed, 23 insertions, 5 deletions
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index 802bd7d..d6d6bd6 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -236,6 +236,9 @@ namespace paludis
private:
void add_profile_r(const FSEntry & f) const;
+
+ /// Raw system lines.
+ mutable std::set<std::string> system_lines;
};
}
@@ -289,6 +292,15 @@ Implementation<PortageRepository>::add_profile(const FSEntry & f) const
}
}
+ for (std::set<std::string>::iterator it(system_lines.begin()), it_end(system_lines.end());
+ it != it_end; ++it)
+ {
+ Context context_atom("When parsing package '" + *it + "':");
+ PackageDepAtom::Pointer atom(new PackageDepAtom(*it));
+ atom->set_tag(system_tag);
+ system_packages->add_child(atom);
+ }
+
std::string arch(profile_env["ARCH"]);
if (arch.empty())
throw InternalError(PALUDIS_HERE, "todo: ARCH unset"); /// \todo
@@ -463,13 +475,19 @@ Implementation<PortageRepository>::add_profile_r(const FSEntry & f) const
for (LineConfigFile::Iterator line(virtuals_f.begin()), line_end(virtuals_f.end()) ;
line != line_end ; ++line)
{
- if (line->empty() || '*' != line->at(0))
+ if (line->empty())
continue;
- Context context_line("When parsing line '" + *line + "':");
- PackageDepAtom::Pointer atom(new PackageDepAtom(line->substr(1)));
- atom->set_tag(system_tag);
- system_packages->add_child(atom);
+ Context context_line("When reading line '" + *line + "':");
+
+ if ('*' == line->at(0))
+ system_lines.insert(line->substr(1));
+ else if('-' == line->at(0) && '*' == line->at(1))
+ if (0==system_lines.erase(line->substr(2)))
+ {
+ Log::get_instance()->message(ll_qa, "Trying to remove packages line '" + line->substr(2) +
+ "' that doesn't exist.");
+ }
}
}
}