aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-04-20 00:25:05 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-04-20 00:25:05 +0000
commit191ab9b8b55206804f967b22ed4159c2b24e26a4 (patch)
tree79ee02d931e32708483a3025c726909bf3bb57d9
parent549705408bc3cf99b8c4f210a07e3862e7dccbfb (diff)
downloadpaludis-191ab9b8b55206804f967b22ed4159c2b24e26a4.tar.gz
paludis-191ab9b8b55206804f967b22ed4159c2b24e26a4.tar.xz
Make malformed USE in VDB a warning rather than an error (again).
-rw-r--r--paludis/repositories/e/e_key.cc21
1 files changed, 17 insertions, 4 deletions
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index f408ce5..aa58123 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -872,10 +872,23 @@ EUseKey::value() const
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':");
std::list<std::string> tokens;
tokenise_whitespace(_imp->string_value, std::back_inserter(tokens));
- for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
- t != t_end ; ++t)
- if ('-' != t->at(0))
- _imp->value->insert(UseFlagName(*t));
+ try
+ {
+ for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
+ t != t_end ; ++t)
+ if ('-' != t->at(0))
+ _imp->value->insert(UseFlagName(*t));
+ }
+ catch (const InternalError &)
+ {
+ throw;
+ }
+ catch (const Exception & e)
+ {
+ Log::get_instance()->message("e.use.malformed", ll_warning, lc_context) << "Error loading " << raw_name() << " for '" << *_imp->id << "' due to exception '"
+ << e.message() << "' (" << e.what() << "), pretending " << raw_name() << " is empty for this package";
+ }
+
return _imp->value;
}