aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-03 19:17:51 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-03 19:17:51 +0000
commitc51b661f8724964c539eaf6de0ac0fe9655dc99c (patch)
tree27abfbae86da3c70f66c6fc384dc357d0c2b688d
parenta69106c869b1fdd2b624773eba923945112e56ad (diff)
downloadpaludis-c51b661f8724964c539eaf6de0ac0fe9655dc99c.tar.gz
paludis-c51b661f8724964c539eaf6de0ac0fe9655dc99c.tar.xz
Don't assume that every categories entry will have a corresponding directory. This may not be the case, for example for overlays or with rsync excludes.
-rw-r--r--paludis/portage_repository.cc37
1 files changed, 19 insertions, 18 deletions
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index af6088e..0687a23 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -386,26 +386,27 @@ PortageRepository::do_package_names(const CategoryNamePart & c) const
if (_imp->category_names.end() == _imp->category_names.find(c))
return QualifiedPackageNameCollection::Pointer(new QualifiedPackageNameCollection);
- for (DirIterator d(_imp->location / stringify(c)), d_end ; d != d_end ; ++d)
- {
- if (! d->is_directory())
- continue;
- if (DirIterator() == std::find_if(DirIterator(*d), DirIterator(),
- IsFileWithExtension(".ebuild")))
- continue;
-
- try
- {
- _imp->package_names.insert(std::make_pair(
- QualifiedPackageName(c, PackageNamePart(d->basename())), false));
- }
- catch (const NameError &)
+ if ((_imp->location / stringify(c)).is_directory())
+ for (DirIterator d(_imp->location / stringify(c)), d_end ; d != d_end ; ++d)
{
- Log::get_instance()->message(ll_warning, "Skipping entry '" +
- d->basename() + "' in category '" + stringify(c) + "' in repository '"
- + stringify(name()) + "'");
+ if (! d->is_directory())
+ continue;
+ if (DirIterator() == std::find_if(DirIterator(*d), DirIterator(),
+ IsFileWithExtension(".ebuild")))
+ continue;
+
+ try
+ {
+ _imp->package_names.insert(std::make_pair(
+ QualifiedPackageName(c, PackageNamePart(d->basename())), false));
+ }
+ catch (const NameError &)
+ {
+ Log::get_instance()->message(ll_warning, "Skipping entry '" +
+ d->basename() + "' in category '" + stringify(c) + "' in repository '"
+ + stringify(name()) + "'");
+ }
}
- }
_imp->category_names[c] = true;