aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-15 15:31:10 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-15 15:31:10 +0000
commitaa90df29b89764996c6bd4216153d9a021792e62 (patch)
tree17d91c3674aab8cbff762284ed547850943dfe93
parentbc34340680f49301819340cc2ba1a8def98b8611 (diff)
downloadpaludis-aa90df29b89764996c6bd4216153d9a021792e62.tar.gz
paludis-aa90df29b89764996c6bd4216153d9a021792e62.tar.xz
Fix for virtuals loading sometimes missing provided entries over virtual entries. Fixes: ticket:17
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 88e3e0e..c1ab7fc 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -128,7 +128,9 @@ VirtualsRepository::need_names() const
new PackageDepAtom(stringify(p->provided_by_name)))));
}
- std::sort(_imp->names.begin(), _imp->names.end());
+ std::sort(_imp->names.begin(), _imp->names.end(), NamesNameComparator());
+
+ std::vector<std::pair<QualifiedPackageName, PackageDepAtom::ConstPointer> > new_names;
for (PackageDatabase::RepositoryIterator r(_imp->env->package_database()->begin_repositories()),
r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
@@ -149,11 +151,14 @@ VirtualsRepository::need_names() const
NamesNameComparator()));
if (p.first == p.second)
- _imp->names.push_back(std::make_pair(v->virtual_name, v->provided_by_atom));
+ new_names.push_back(std::make_pair(v->virtual_name, v->provided_by_atom));
}
}
- std::sort(_imp->names.begin(), _imp->names.end());
+ std::copy(new_names.begin(), new_names.end(), std::back_inserter(_imp->names));
+ std::sort(_imp->names.begin(), _imp->names.end(), NamesNameComparator());
+
+ _imp->has_names = true;
}
void