aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-13 18:07:22 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-13 18:07:22 +0000
commitf2f75671015cbdc48dd0b286c531b638692e1462 (patch)
tree7a523549a65157ac91ab195e4a844f662440c9ac
parentde2c83c84e5557717d03e68b9d28624d330913ce (diff)
downloadpaludis-f2f75671015cbdc48dd0b286c531b638692e1462.tar.gz
paludis-f2f75671015cbdc48dd0b286c531b638692e1462.tar.xz
Don't barf out globally if we have a duff vdb entry. Just warn and carry on.
-rw-r--r--paludis/vdb_repository.cc55
1 files changed, 34 insertions, 21 deletions
diff --git a/paludis/vdb_repository.cc b/paludis/vdb_repository.cc
index b5bf736..3ea8edb 100644
--- a/paludis/vdb_repository.cc
+++ b/paludis/vdb_repository.cc
@@ -612,28 +612,41 @@ VDBRepository::begin_provide_map() const
Context loop_context("When loading VDB PROVIDEs entry for '"
+ stringify(e->name) + "-" + stringify(e->version) + "':");
- if (! e->metadata)
- _imp->load_entry(e);
- const std::string provide_str(e->metadata->get(vmk_provide));
- if (provide_str.empty())
- continue;
-
- DepAtom::ConstPointer provide(DepParser::parse(provide_str,
- DepParserPolicy<PackageDepAtom, false>::get_instance()));
- PackageDatabaseEntry dbe(e->name, e->version, name());
- DepAtomFlattener f(_imp->env, &dbe, provide);
-
- for (DepAtomFlattener::Iterator p(f.begin()), p_end(f.end()) ; p != p_end ; ++p)
+ try
{
- QualifiedPackageName pp((*p)->text());
-
- if (pp.get<qpn_category>() != CategoryNamePart("virtual"))
- Log::get_instance()->message(ll_warning, "PROVIDE of non-virtual '"
- + stringify(pp) + "' from '" + stringify(e->name) + "-"
- + stringify(e->version) + "' in '" + stringify(name())
- + "' will not work as expected");
-
- _imp->provide_map.insert(std::make_pair(pp, e->name));
+ if (! e->metadata)
+ _imp->load_entry(e);
+ const std::string provide_str(e->metadata->get(vmk_provide));
+ if (provide_str.empty())
+ continue;
+
+ DepAtom::ConstPointer provide(DepParser::parse(provide_str,
+ DepParserPolicy<PackageDepAtom, false>::get_instance()));
+ PackageDatabaseEntry dbe(e->name, e->version, name());
+ DepAtomFlattener f(_imp->env, &dbe, provide);
+
+ for (DepAtomFlattener::Iterator p(f.begin()), p_end(f.end()) ; p != p_end ; ++p)
+ {
+ QualifiedPackageName pp((*p)->text());
+
+ if (pp.get<qpn_category>() != CategoryNamePart("virtual"))
+ Log::get_instance()->message(ll_warning, "PROVIDE of non-virtual '"
+ + stringify(pp) + "' from '" + stringify(e->name) + "-"
+ + stringify(e->version) + "' in '" + stringify(name())
+ + "' will not work as expected");
+
+ _imp->provide_map.insert(std::make_pair(pp, e->name));
+ }
+ }
+ catch (const InternalError &)
+ {
+ throw;
+ }
+ catch (const Exception & ee)
+ {
+ Log::get_instance()->message(ll_warning, "Skipping VDB PROVIDE entry for '"
+ + stringify(e->name) + "-" + stringify(e->version) + "' due to exception '"
+ + stringify(ee.message()) + "' (" + stringify(ee.what()) + ")");
}
}