aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-11-13 16:50:45 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-11-13 16:50:45 +0000
commit50930835d8c0d6cf4c4955fa7d865d27904853fa (patch)
treeeb4fc3f16e6d9d1625ad699dc32f0254ef9d2e81
parent178bf7a92313db98efacd38aad3eef703d111160 (diff)
downloadpaludis-50930835d8c0d6cf4c4955fa7d865d27904853fa.tar.gz
paludis-50930835d8c0d6cf4c4955fa7d865d27904853fa.tar.xz
Don't require that the env sets dir exists
-rw-r--r--paludis/environment/default/default_environment.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/paludis/environment/default/default_environment.cc b/paludis/environment/default/default_environment.cc
index a755685..acc94f1 100644
--- a/paludis/environment/default/default_environment.cc
+++ b/paludis/environment/default/default_environment.cc
@@ -496,14 +496,15 @@ DefaultEnvironment::sets_list() const
{
SetsCollection::Pointer result(new SetsCollection::Concrete);
- for (DirIterator d(FSEntry(DefaultConfig::get_instance()->config_dir()) / "sets"), d_end ;
- d != d_end ; ++d)
- {
- if (! IsFileWithExtension(".conf")(*d))
- continue;
+ if ((FSEntry(DefaultConfig::get_instance()->config_dir()) / "sets").exists())
+ for (DirIterator d(FSEntry(DefaultConfig::get_instance()->config_dir()) / "sets"), d_end ;
+ d != d_end ; ++d)
+ {
+ if (! IsFileWithExtension(".conf")(*d))
+ continue;
- result->insert(SetName(strip_trailing_string(d->basename(), ".conf")));
- }
+ result->insert(SetName(strip_trailing_string(d->basename(), ".conf")));
+ }
return result;
}