aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-28 23:06:55 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-28 23:06:55 +0000
commit5ea7e33a8cb1b0a2ab017ba456f6b53b49eccb35 (patch)
tree5806ea6e42ddc147942b2d5aaaa6d48ae7a13248
parent13fe5e2cb38cc825f14beff306b0d0eff732d4e9 (diff)
downloadpaludis-5ea7e33a8cb1b0a2ab017ba456f6b53b49eccb35.tar.gz
paludis-5ea7e33a8cb1b0a2ab017ba456f6b53b49eccb35.tar.xz
r1221@snowdrop: ciaranm | 2006-07-29 00:05:44 +0100
Remove some unnecessary public functions from PortageRepository
-rw-r--r--paludis/repositories/portage/portage_repository.cc14
-rw-r--r--paludis/repositories/portage/portage_repository.hh3
-rw-r--r--paludis/repositories/portage/portage_repository_news.cc23
3 files changed, 15 insertions, 25 deletions
diff --git a/paludis/repositories/portage/portage_repository.cc b/paludis/repositories/portage/portage_repository.cc
index 06a2684..4ba3c35 100644
--- a/paludis/repositories/portage/portage_repository.cc
+++ b/paludis/repositories/portage/portage_repository.cc
@@ -1453,20 +1453,6 @@ PortageRepository::info(bool verbose) const
return result;
}
-FSEntry
-PortageRepository::news_skip_file() const
-{
- return FSEntry(_imp->root / "var" / "lib" / "paludis" / "news" /
- ("news-" + stringify(name()) + ".skip"));
-}
-
-FSEntry
-PortageRepository::news_unread_file() const
-{
- return FSEntry(_imp->root / "var" / "lib" / "paludis" / "news" /
- ("news-" + stringify(name()) + ".unread"));
-}
-
std::string
PortageRepository::profile_variable(const std::string & s) const
{
diff --git a/paludis/repositories/portage/portage_repository.hh b/paludis/repositories/portage/portage_repository.hh
index 98a38eb..2a90520 100644
--- a/paludis/repositories/portage/portage_repository.hh
+++ b/paludis/repositories/portage/portage_repository.hh
@@ -157,9 +157,6 @@ namespace paludis
///\name Information about PortageRepository
///\{
- FSEntry news_skip_file() const;
- FSEntry news_unread_file() const;
-
std::string profile_variable(const std::string &) const;
typedef libwrapiter::ForwardIterator<PortageRepository, std::pair<
diff --git a/paludis/repositories/portage/portage_repository_news.cc b/paludis/repositories/portage/portage_repository_news.cc
index f5915fc..fdfb717 100644
--- a/paludis/repositories/portage/portage_repository_news.cc
+++ b/paludis/repositories/portage/portage_repository_news.cc
@@ -44,11 +44,18 @@ namespace paludis
const PortageRepository * const portage_repository;
const PortageRepositoryParams params;
+ const FSEntry skip_file;
+ const FSEntry unread_file;
+
Implementation(const Environment * const e, const PortageRepository * const p,
const PortageRepositoryParams & k) :
environment(e),
portage_repository(p),
- params(k)
+ params(k),
+ skip_file(params.get<prpk_root>() / "var" / "lib" / "paludis" / "news" /
+ ("news-" + stringify(portage_repository->name()) + ".skip")),
+ unread_file(params.get<prpk_root>() / "var" / "lib" / "paludis" / "news" /
+ ("news-" + stringify(portage_repository->name()) + ".unread"))
{
}
};
@@ -76,11 +83,11 @@ PortageRepositoryNews::update_news() const
std::set<std::string> skip;
- if (_imp->portage_repository->news_skip_file().is_regular_file())
+ if (_imp->skip_file.is_regular_file())
{
Context local_context("When handling news skip file '" + stringify(
- _imp->portage_repository->news_skip_file()) + "':");
- LineConfigFile s(_imp->portage_repository->news_skip_file());
+ _imp->skip_file) + "':");
+ LineConfigFile s(_imp->skip_file);
std::copy(s.begin(), s.end(), std::inserter(skip, skip.end()));
}
@@ -143,20 +150,20 @@ PortageRepositoryNews::update_news() const
if (show)
{
- std::ofstream s(stringify(_imp->portage_repository->news_skip_file()).c_str(),
+ std::ofstream s(stringify(_imp->skip_file).c_str(),
std::ios::out | std::ios::app);
if (! s)
Log::get_instance()->message(ll_warning, lc_no_context,
"Cannot append to news skip file '"
- + stringify(_imp->portage_repository->news_skip_file()) +
+ + stringify(_imp->skip_file) +
"', skipping news item '" + stringify(*d) + "'");
- std::ofstream t(stringify(_imp->portage_repository->news_unread_file()).c_str(),
+ std::ofstream t(stringify(_imp->unread_file).c_str(),
std::ios::out | std::ios::app);
if (! t)
Log::get_instance()->message(ll_warning, lc_no_context,
"Cannot append to unread file '"
- + stringify(_imp->portage_repository->news_unread_file()) +
+ + stringify(_imp->unread_file) +
"', skipping news item '" + stringify(*d) + "'");
if (s && t)