aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-01-19 18:19:15 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-01-19 18:19:15 +0000
commit598b07fdff1a361502c9e001cbc3eef2b26e13e4 (patch)
tree90f2bb07aebfd11d064714d789518251829388b8
parent6c809f3c793c6c901c895ebc4007dd1cb82b2ad3 (diff)
downloadpaludis-598b07fdff1a361502c9e001cbc3eef2b26e13e4.tar.gz
paludis-598b07fdff1a361502c9e001cbc3eef2b26e13e4.tar.xz
Add Layout::categories_file.
-rw-r--r--paludis/repositories/e/exheres_layout.cc12
-rw-r--r--paludis/repositories/e/exheres_layout.hh3
-rw-r--r--paludis/repositories/e/layout.hh3
-rw-r--r--paludis/repositories/e/traditional_layout.cc12
-rw-r--r--paludis/repositories/e/traditional_layout.hh3
5 files changed, 27 insertions, 6 deletions
diff --git a/paludis/repositories/e/exheres_layout.cc b/paludis/repositories/e/exheres_layout.cc
index dde7108..117f358 100644
--- a/paludis/repositories/e/exheres_layout.cc
+++ b/paludis/repositories/e/exheres_layout.cc
@@ -120,6 +120,12 @@ ExheresLayout::~ExheresLayout()
{
}
+FSEntry
+ExheresLayout::categories_file() const
+{
+ return _imp->tree_root / "metadata" / "categories.conf";
+}
+
void
ExheresLayout::need_category_names() const
{
@@ -135,9 +141,9 @@ ExheresLayout::need_category_names() const
bool found_one(false);
std::list<FSEntry> cats_list;
- if (master_repository_location())
- cats_list.push_back(*master_repository_location() / "metadata" / "categories.conf");
- cats_list.push_back(_imp->tree_root / "metadata" / "categories.conf");
+ if (_imp->repository->params().master_repository)
+ cats_list.push_back(_imp->repository->params().master_repository->layout()->categories_file());
+ cats_list.push_back(categories_file());
for (std::list<FSEntry>::const_iterator i(cats_list.begin()), i_end(cats_list.end()) ;
i != i_end ; ++i)
diff --git a/paludis/repositories/e/exheres_layout.hh b/paludis/repositories/e/exheres_layout.hh
index 3b8669a..fca1f13 100644
--- a/paludis/repositories/e/exheres_layout.hh
+++ b/paludis/repositories/e/exheres_layout.hh
@@ -62,6 +62,9 @@ namespace paludis
virtual bool has_package_named(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSEntry categories_file() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
virtual tr1::shared_ptr<const CategoryNamePartSet> category_names() const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/layout.hh b/paludis/repositories/e/layout.hh
index 486c026..f91929a 100644
--- a/paludis/repositories/e/layout.hh
+++ b/paludis/repositories/e/layout.hh
@@ -82,6 +82,9 @@ namespace paludis
virtual bool has_package_named(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual FSEntry categories_file() const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
virtual tr1::shared_ptr<const CategoryNamePartSet> category_names() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
diff --git a/paludis/repositories/e/traditional_layout.cc b/paludis/repositories/e/traditional_layout.cc
index e3aca65..8038b8a 100644
--- a/paludis/repositories/e/traditional_layout.cc
+++ b/paludis/repositories/e/traditional_layout.cc
@@ -118,6 +118,12 @@ TraditionalLayout::~TraditionalLayout()
{
}
+FSEntry
+TraditionalLayout::categories_file() const
+{
+ return _imp->tree_root / "profiles" / "categories";
+}
+
void
TraditionalLayout::need_category_names() const
{
@@ -133,9 +139,9 @@ TraditionalLayout::need_category_names() const
bool found_one(false);
std::list<FSEntry> cats_list;
- if (master_repository_location())
- cats_list.push_back(*master_repository_location() / "profiles" / "categories");
- cats_list.push_back(_imp->tree_root / "profiles" / "categories");
+ if (_imp->repository->params().master_repository)
+ cats_list.push_back(_imp->repository->params().master_repository->layout()->categories_file());
+ cats_list.push_back(categories_file());
for (std::list<FSEntry>::const_iterator i(cats_list.begin()), i_end(cats_list.end()) ;
i != i_end ; ++i)
diff --git a/paludis/repositories/e/traditional_layout.hh b/paludis/repositories/e/traditional_layout.hh
index f53c7b8..dbc5fd2 100644
--- a/paludis/repositories/e/traditional_layout.hh
+++ b/paludis/repositories/e/traditional_layout.hh
@@ -63,6 +63,9 @@ namespace paludis
virtual bool has_package_named(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSEntry categories_file() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
virtual tr1::shared_ptr<const CategoryNamePartSet> category_names() const
PALUDIS_ATTRIBUTE((warn_unused_result));