aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Mike Kelly <pioto@pioto.org> 2009-01-04 03:17:20 -0500
committerAvatar Mike Kelly <pioto@pioto.org> 2009-01-04 03:17:20 -0500
commit9d7f93b688e2088b86f7a1bb1e7c61fdb30e5b45 (patch)
treec871cb6b01a73679b6fbea88de88fea40ce1e04d
parente4d1ea05e6ebeb6cfbc8c447d828b04ad0bf7ace (diff)
downloadpaludis-9d7f93b688e2088b86f7a1bb1e7c61fdb30e5b45.tar.gz
paludis-9d7f93b688e2088b86f7a1bb1e7c61fdb30e5b45.tar.xz
Support different news directories for different distributions.
-rw-r--r--paludis/distribution.cc3
-rw-r--r--paludis/distribution.hh2
-rw-r--r--paludis/distributions/exherbo.conf1
-rw-r--r--paludis/distributions/gentoo.conf1
-rw-r--r--paludis/repositories/e/e_repository_news.cc7
5 files changed, 11 insertions, 3 deletions
diff --git a/paludis/distribution.cc b/paludis/distribution.cc
index 3149518..4bd17c8 100644
--- a/paludis/distribution.cc
+++ b/paludis/distribution.cc
@@ -74,7 +74,8 @@ namespace paludis
value_for<n::fallback_environment>(k.get("fallback_environment")),
value_for<n::name>(strip_trailing_string(d->basename(), ".conf")),
value_for<n::paludis_package>(k.get("paludis_package")),
- value_for<n::support_old_style_virtuals>(destringify<bool>(k.get("support_old_style_virtuals")))
+ value_for<n::support_old_style_virtuals>(destringify<bool>(k.get("support_old_style_virtuals"))),
+ value_for<n::news_directory>(FSEntry(k.get("news_directory")))
)))));
}
}
diff --git a/paludis/distribution.hh b/paludis/distribution.hh
index 847bbbf..7ef6ce8 100644
--- a/paludis/distribution.hh
+++ b/paludis/distribution.hh
@@ -53,6 +53,7 @@ namespace paludis
struct name;
struct paludis_package;
struct support_old_style_virtuals;
+ struct news_directory;
}
/**
@@ -77,6 +78,7 @@ namespace paludis
NamedValue<n::name, std::string> name;
NamedValue<n::paludis_package, std::string> paludis_package;
NamedValue<n::support_old_style_virtuals, bool> support_old_style_virtuals;
+ NamedValue<n::news_directory, FSEntry> news_directory;
};
/**
diff --git a/paludis/distributions/exherbo.conf b/paludis/distributions/exherbo.conf
index 1ba46ad..7fd2e06 100644
--- a/paludis/distributions/exherbo.conf
+++ b/paludis/distributions/exherbo.conf
@@ -7,4 +7,5 @@ default_environment = paludis
fallback_environment =
paludis_package = sys-apps/paludis
support_old_style_virtuals = false
+news_directory = /var/lib/exherbo/news
diff --git a/paludis/distributions/gentoo.conf b/paludis/distributions/gentoo.conf
index b4d6bde..cb69b62 100644
--- a/paludis/distributions/gentoo.conf
+++ b/paludis/distributions/gentoo.conf
@@ -7,4 +7,5 @@ default_environment = paludis
fallback_environment = portage
paludis_package = sys-apps/paludis
support_old_style_virtuals = true
+news_directory = /var/lib/gentoo/news
diff --git a/paludis/repositories/e/e_repository_news.cc b/paludis/repositories/e/e_repository_news.cc
index cac18a6..b0198c1 100644
--- a/paludis/repositories/e/e_repository_news.cc
+++ b/paludis/repositories/e/e_repository_news.cc
@@ -36,6 +36,7 @@
#include <paludis/generator.hh>
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
+#include <paludis/distribution.hh>
#include <set>
#include <ostream>
@@ -62,6 +63,7 @@ namespace paludis
const ERepository * const e_repository;
const erepository::ERepositoryParams params;
+ const FSEntry news_directory;
const FSEntry skip_file;
const FSEntry unread_file;
@@ -70,9 +72,10 @@ namespace paludis
environment(e),
e_repository(p),
params(k),
- skip_file(e->root() / "var" / "lib" / "gentoo" / "news" /
+ news_directory((*DistributionData::get_instance()->distribution_from_string(e->distribution())).news_directory()),
+ skip_file(e->root() / news_directory /
("news-" + stringify(e_repository->name()) + ".skip")),
- unread_file(e->root() / "var" / "lib" / "gentoo" / "news" /
+ unread_file(e->root() / news_directory /
("news-" + stringify(e_repository->name()) + ".unread"))
{
}