aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Mike Kelly <pioto@pioto.org> 2009-01-17 00:45:53 -0500
committerAvatar Mike Kelly <pioto@pioto.org> 2009-01-17 00:45:53 -0500
commit1e6b94d9124b3fef26e1f93c1fc3e6a97b8810bf (patch)
tree5ce7a6cdd742feb8d501065f3e0cca01bef073c5
parentc561e114666313f4644243aff702794345982d8c (diff)
downloadpaludis-1e6b94d9124b3fef26e1f93c1fc3e6a97b8810bf.tar.gz
paludis-1e6b94d9124b3fef26e1f93c1fc3e6a97b8810bf.tar.xz
Support different news directories for different distributions.
Trying it again. Fixes: ticket:657
-rw-r--r--paludis/distributions/exherbo/e.conf1
-rw-r--r--paludis/distributions/gentoo/e.conf1
-rw-r--r--paludis/repositories/e/e_repository_news.cc11
-rw-r--r--paludis/repositories/e/extra_distribution_data.cc1
-rw-r--r--paludis/repositories/e/extra_distribution_data.hh3
5 files changed, 15 insertions, 2 deletions
diff --git a/paludis/distributions/exherbo/e.conf b/paludis/distributions/exherbo/e.conf
index b4c92e0..35a8ff0 100644
--- a/paludis/distributions/exherbo/e.conf
+++ b/paludis/distributions/exherbo/e.conf
@@ -7,6 +7,7 @@ default_names_cache = /var/cache/paludis/names
default_profile_eapi = exheres-0
default_provides_cache = /var/empty
default_write_cache = /var/cache/paludis/metadata
+news_directory = /var/lib/exherbo/news
qa_category_dir_checks =
qa_eclass_file_contents_checks =
qa_package_dir_checks =
diff --git a/paludis/distributions/gentoo/e.conf b/paludis/distributions/gentoo/e.conf
index adda8ed..f668ee4 100644
--- a/paludis/distributions/gentoo/e.conf
+++ b/paludis/distributions/gentoo/e.conf
@@ -7,6 +7,7 @@ default_names_cache =
default_profile_eapi = 0
default_provides_cache =
default_write_cache = /var/empty
+news_directory = /var/lib/gentoo/news
qa_category_dir_checks = stray_category_dir_files
qa_eclass_file_contents_checks = variable_assigns deprecated_functions subshell_die header function_keyword whitespace
qa_package_dir_checks = manifest ebuild_count changelog misc_files files_dir_size
diff --git a/paludis/repositories/e/e_repository_news.cc b/paludis/repositories/e/e_repository_news.cc
index cac18a6..03acd64 100644
--- a/paludis/repositories/e/e_repository_news.cc
+++ b/paludis/repositories/e/e_repository_news.cc
@@ -20,6 +20,7 @@
#include <paludis/repositories/e/e_repository.hh>
#include <paludis/repositories/e/e_repository_news.hh>
#include <paludis/repositories/e/eapi.hh>
+#include <paludis/repositories/e/extra_distribution_data.hh>
#include <paludis/util/config_file.hh>
#include <paludis/environment.hh>
@@ -31,6 +32,7 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/distribution.hh>
#include <paludis/elike_package_dep_spec.hh>
#include <paludis/selection.hh>
#include <paludis/generator.hh>
@@ -43,6 +45,7 @@
#include <list>
using namespace paludis;
+using namespace paludis::erepository;
template class WrappedForwardIterator<NewsFile::DisplayIfInstalledConstIteratorTag, const std::string>;
template class WrappedForwardIterator<NewsFile::DisplayIfKeywordConstIteratorTag, const std::string>;
@@ -62,6 +65,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 +74,12 @@ namespace paludis
environment(e),
e_repository(p),
params(k),
- skip_file(e->root() / "var" / "lib" / "gentoo" / "news" /
+ news_directory(EExtraDistributionData::get_instance()->data_from_distribution(
+ *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"))
{
}
diff --git a/paludis/repositories/e/extra_distribution_data.cc b/paludis/repositories/e/extra_distribution_data.cc
index 69e0b79..14852fe 100644
--- a/paludis/repositories/e/extra_distribution_data.cc
+++ b/paludis/repositories/e/extra_distribution_data.cc
@@ -60,6 +60,7 @@ namespace paludis
value_for<n::default_profile_eapi>(k->get("default_profile_eapi")),
value_for<n::default_provides_cache>(k->get("default_provides_cache")),
value_for<n::default_write_cache>(k->get("default_write_cache")),
+ value_for<n::news_directory>(FSEntry(k->get("news_directory"))),
value_for<n::qa_category_dir_checks>(make_set(k->get("qa_category_dir_checks"))),
value_for<n::qa_eclass_file_contents_checks>(make_set(k->get("qa_eclass_file_contents_checks"))),
value_for<n::qa_package_dir_checks>(make_set(k->get("qa_package_dir_checks"))),
diff --git a/paludis/repositories/e/extra_distribution_data.hh b/paludis/repositories/e/extra_distribution_data.hh
index 28e4586..6fd44b3 100644
--- a/paludis/repositories/e/extra_distribution_data.hh
+++ b/paludis/repositories/e/extra_distribution_data.hh
@@ -21,6 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_PALUDIS_REPOSITORIES_E_EXTRA_DISTRIBUTION_DATA_HH 1
#include <paludis/distribution-fwd.hh>
+#include <paludis/util/fs_entry.hh>
#include <paludis/util/named_value.hh>
#include <paludis/util/set.hh>
#include <tr1/memory>
@@ -39,6 +40,7 @@ namespace paludis
struct default_profile_eapi;
struct default_provides_cache;
struct default_write_cache;
+ struct news_directory;
struct qa_category_dir_checks;
struct qa_eclass_file_contents_checks;
struct qa_package_dir_checks;
@@ -60,6 +62,7 @@ namespace paludis
NamedValue<n::default_profile_eapi, std::string> default_profile_eapi;
NamedValue<n::default_provides_cache, std::string> default_provides_cache;
NamedValue<n::default_write_cache, std::string> default_write_cache;
+ NamedValue<n::news_directory, FSEntry> news_directory;
NamedValue<n::qa_category_dir_checks, std::tr1::shared_ptr<const Set<std::string> > > qa_category_dir_checks;
NamedValue<n::qa_eclass_file_contents_checks, std::tr1::shared_ptr<const Set<std::string> > > qa_eclass_file_contents_checks;
NamedValue<n::qa_package_dir_checks, std::tr1::shared_ptr<const Set<std::string> > > qa_package_dir_checks;