aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-29 10:00:55 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-29 10:00:55 +0100
commit1f0c1eef60d958954dba2cdc1af89c7602745ee1 (patch)
tree6a9e7dbed46dd7652705029ea26e5c8a8e8ac640
parentcc3a464d6a56f5e509c75924c4b5ffc268647d26 (diff)
downloadpaludis-1f0c1eef60d958954dba2cdc1af89c7602745ee1.tar.gz
paludis-1f0c1eef60d958954dba2cdc1af89c7602745ee1.tar.xz
Be more failure tolerant when applying updates
Ideally we'd do this by having repositories and their contents being different things. But that's a lot of work. Fixes: ticket:897
-rw-r--r--paludis/repositories/e/vdb_repository.cc50
1 files changed, 28 insertions, 22 deletions
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index bbfb257..cd7fe5d 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -1354,32 +1354,38 @@ VDBRepository::perform_updates()
{
Context context_2("When performing updates from '" + stringify((*r)->name()) + "':");
- Repository::MetadataConstIterator k_iter((*r)->find_metadata("e_updates_location"));
- if (k_iter == (*r)->end_metadata())
+ try
{
- Log::get_instance()->message("e.vdb.updates.no_key", ll_debug, lc_context) <<
- "Repository " << (*r)->name() << " defines no e_updates_location key";
- continue;
- }
+ if (0 == stringify((*r)->name()).compare(0, 2, "x-"))
+ {
+ /* ticket:897. not really the best solution, but it'll do for now. */
+ continue;
+ }
- const MetadataValueKey<FSEntry> * k(simple_visitor_cast<const MetadataValueKey<FSEntry> >(**k_iter));
- if (! k)
- {
- Log::get_instance()->message("e.vdb.udpates.bad_key", ll_warning, lc_context) <<
- "Repository " << (*r)->name() << " defines an e_updates_location key, but it is not an FSEntry key";
- continue;
- }
+ Repository::MetadataConstIterator k_iter((*r)->find_metadata("e_updates_location"));
+ if (k_iter == (*r)->end_metadata())
+ {
+ Log::get_instance()->message("e.vdb.updates.no_key", ll_debug, lc_context) <<
+ "Repository " << (*r)->name() << " defines no e_updates_location key";
+ continue;
+ }
- FSEntry dir(k->value());
- if (! dir.is_directory_or_symlink_to_directory())
- {
- Log::get_instance()->message("e.vdb.updates.bad_key", ll_warning, lc_context) <<
- "Repository " << (*r)->name() << " has e_updates_location " << dir << ", but this is not a directory";
- continue;
- }
+ const MetadataValueKey<FSEntry> * k(simple_visitor_cast<const MetadataValueKey<FSEntry> >(**k_iter));
+ if (! k)
+ {
+ Log::get_instance()->message("e.vdb.udpates.bad_key", ll_warning, lc_context) <<
+ "Repository " << (*r)->name() << " defines an e_updates_location key, but it is not an FSEntry key";
+ continue;
+ }
+
+ FSEntry dir(k->value());
+ if (! dir.is_directory_or_symlink_to_directory())
+ {
+ Log::get_instance()->message("e.vdb.updates.bad_key", ll_warning, lc_context) <<
+ "Repository " << (*r)->name() << " has e_updates_location " << dir << ", but this is not a directory";
+ continue;
+ }
- try
- {
for (DirIterator d(k->value(), DirIteratorOptions()), d_end ;
d != d_end ; ++d)
{