aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-04-16 06:00:15 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-04-16 06:00:15 +0000
commit4490dec34393ec67d346b7773af5ffe9d404fcd0 (patch)
tree37bf414022038e0eb77ef26f928e7772d07e7218
parent80f0b74a19b455e736455bb33fa531618b3a8127 (diff)
downloadpaludis-4490dec34393ec67d346b7773af5ffe9d404fcd0.tar.gz
paludis-4490dec34393ec67d346b7773af5ffe9d404fcd0.tar.xz
Kill off RepositoryNewsInterface.
-rw-r--r--hooks/Makefile.am.m410
-rwxr-xr-xhooks/news.bash50
-rwxr-xr-xhooks/news.hook49
-rw-r--r--paludis/hooker.cc43
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc1
-rw-r--r--paludis/repositories/cran/cran_repository.cc1
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc1
-rw-r--r--paludis/repositories/fake/fake_repository.cc1
-rw-r--r--paludis/repositories/gems/gems_repository.cc1
-rw-r--r--paludis/repositories/gentoo/portage_repository.cc4
-rw-r--r--paludis/repositories/gentoo/portage_repository.hh6
-rw-r--r--paludis/repositories/gentoo/portage_repository_news.cc7
-rw-r--r--paludis/repositories/gentoo/vdb_repository.cc1
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc1
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc1
-rw-r--r--paludis/repository.cc4
-rw-r--r--paludis/repository.hh24
-rw-r--r--paludis/repository.sr1
-rw-r--r--ruby/repository.cc2
-rw-r--r--ruby/repository_TEST.rb2
-rw-r--r--src/clients/paludis/Makefile.am1
-rw-r--r--src/clients/paludis/command_line.cc6
-rw-r--r--src/clients/paludis/command_line.hh5
-rw-r--r--src/clients/paludis/news.cc50
-rw-r--r--src/clients/paludis/news.hh39
-rw-r--r--src/clients/paludis/paludis.cc8
-rw-r--r--src/clients/paludis/sync.cc1
27 files changed, 101 insertions, 219 deletions
diff --git a/hooks/Makefile.am.m4 b/hooks/Makefile.am.m4
index 1b10757..a149f74 100644
--- a/hooks/Makefile.am.m4
+++ b/hooks/Makefile.am.m4
@@ -17,7 +17,7 @@ installhookcommonprog_SCRIPTS = \
gnu_info_index.bash \
eselect_env_update.bash \
log.bash \
- news.bash \
+ news.hook \
installable_cache_regen.bash \
installed_cache_regen.bash \
write_cache_clean.bash \
@@ -243,9 +243,9 @@ install-data-local :
ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_post/
ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/sync_pre/
ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/sync_post/
- ln -sf ../common/news.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/sync_all_post/
- ln -sf ../common/news.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/install_all_post/
- ln -sf ../common/news.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/install_pretend_post/
+ ln -sf ../common/news.hook $(DESTDIR)/$(libexecdir)/paludis/hooks/sync_all_post/
+ ln -sf ../common/news.hook $(DESTDIR)/$(libexecdir)/paludis/hooks/install_all_post/
+ ln -sf ../common/news.hook $(DESTDIR)/$(libexecdir)/paludis/hooks/install_pretend_post/
ln -sf ../common/installable_cache_regen.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/sync_all_post/
ln -sf ../common/write_cache_clean.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/sync_all_post/
ln -sf ../common/installed_cache_regen.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/install_post/
@@ -258,7 +258,7 @@ uninstall-local :
rm -f $(DESTDIR)/$(libexecdir)/paludis/hooks/*/gnu_info_index.bash
rm -f $(DESTDIR)/$(libexecdir)/paludis/hooks/*/eselect_env_update.bash
rm -f $(DESTDIR)/$(libexecdir)/paludis/hooks/*/log.bash
- rm -f $(DESTDIR)/$(libexecdir)/paludis/hooks/*/news.bash
+ rm -f $(DESTDIR)/$(libexecdir)/paludis/hooks/*/news.hook
rm -f $(DESTDIR)/$(libexecdir)/paludis/hooks/*/write_cache_clean.bash
rm -f $(DESTDIR)/$(libexecdir)/paludis/hooks/*/fix_symlinks.bash
diff --git a/hooks/news.bash b/hooks/news.bash
deleted file mode 100755
index 1fd5a42..0000000
--- a/hooks/news.bash
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/bash
-# vim: set et sw=4 sts=4 :
-
-# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
-#
-# This file is part of the Paludis package manager. Paludis is free software;
-# you can redistribute it and/or modify it under the terms of the GNU General
-# Public License, version 2, as published by the Free Software Foundation.
-#
-# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place, Suite 330, Boston, MA 02111-1307 USA
-
-export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
-source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
-
-mkdir -p ${ROOT}/var/lib/paludis/news/
-
-done_echo=
-
-if [[ "${HOOK/pretend}" == "${HOOK}" ]] ; then
- [[ -z "${done_echo}" ]] && echo ; done_echo=yes
- einfo_unhooked "Checking for news items..."
-
- ${PALUDIS_COMMAND} --update-news
-fi
-
-count=0
-for f in "${ROOT}/var/lib/paludis/news/"news-*.unread ; do
- [[ -f "${f}" ]] || continue
- if grep --silent . "${f}" ; then
- count=$(( count + $(grep --count . < "${f}" ) ))
- fi
-done
-
-if [[ ${count} -gt 0 ]] ; then
- [[ -z "${done_echo}" ]] && echo ; done_echo=yes
- ewarn "You have ${count} unread news items (use 'eselect news' to read)"
-elif [[ "${HOOK/pretend}" == "${HOOK}" ]] ; then
- [[ -z "${done_echo}" ]] && echo ; done_echo=yes
- einfo_unhooked "No unread news items found"
-fi
-
-true
-
diff --git a/hooks/news.hook b/hooks/news.hook
new file mode 100755
index 0000000..9b7d569
--- /dev/null
+++ b/hooks/news.hook
@@ -0,0 +1,49 @@
+#!/bin/bash
+# vim: set et sw=4 sts=4 :
+
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+check_for_news()
+{
+ export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
+ source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+
+ mkdir -p ${ROOT}/var/lib/paludis/news/
+
+ done_echo=
+
+ count=0
+ for f in "${ROOT}/var/lib/paludis/news/"news-*.unread ; do
+ [[ -f "${f}" ]] || continue
+ if grep --silent . "${f}" ; then
+ count=$(( count + $(grep --count . < "${f}" ) ))
+ fi
+ done
+
+ if [[ ${count} -gt 0 ]] ; then
+ [[ -z "${done_echo}" ]] && echo ; done_echo=yes
+ ewarn "You have ${count} unread news items (use 'eselect news' to read)"
+ elif [[ "${HOOK/pretend}" == "${HOOK}" ]] ; then
+ [[ -z "${done_echo}" ]] && echo ; done_echo=yes
+ einfo_unhooked "No unread news items found"
+ fi
+}
+
+for h in sync_all_post install_all_post install_pretend_post ; do
+ eval "hook_run_${h}() { check_for_news ; }"
+ eval "hook_after_${h}() { echo gnu_info_index eselect_env_update log write_cache_clean ; }"
+done
+
diff --git a/paludis/hooker.cc b/paludis/hooker.cc
index b9115a5..71ef622 100644
--- a/paludis/hooker.cc
+++ b/paludis/hooker.cc
@@ -199,6 +199,9 @@ FancyHookFile::add_dependencies(const Hook & hook, DirectedGraph<std::string, in
void
FancyHookFile::_add_dependency_class(const Hook & hook, DirectedGraph<std::string, int> & g, bool depend)
{
+ Context context("When adding dependency class '" + stringify(depend ? "depend" : "after") + "' for hook '"
+ + stringify(hook.name()) + "' file '" + stringify(file_name()) + "':");
+
Log::get_instance()->message(ll_debug, lc_no_context, "Starting hook script '" +
stringify(file_name()) + "' for dependencies of '" + hook.name() + "'");
@@ -333,28 +336,32 @@ Hooker::perform_hook(const Hook & hook) const
}
}
- Context context_local("When determining hook execution order for '" + hook.name() + "':");
-
DirectedGraph<std::string, int> hook_deps;
- for (std::map<std::string, std::tr1::shared_ptr<HookFile> >::const_iterator f(hook_files.begin()), f_end(hook_files.end()) ;
- f != f_end ; ++f)
- hook_deps.add_node(f->first);
-
- for (std::map<std::string, std::tr1::shared_ptr<HookFile> >::const_iterator f(hook_files.begin()), f_end(hook_files.end()) ;
- f != f_end ; ++f)
- f->second->add_dependencies(hook, hook_deps);
-
- std::list<std::string> ordered;
- try
{
- hook_deps.topological_sort(std::back_inserter(ordered));
+ Context context_local("When determining hook dependencies for '" + hook.name() + "':");
+ for (std::map<std::string, std::tr1::shared_ptr<HookFile> >::const_iterator f(hook_files.begin()), f_end(hook_files.end()) ;
+ f != f_end ; ++f)
+ hook_deps.add_node(f->first);
+
+ for (std::map<std::string, std::tr1::shared_ptr<HookFile> >::const_iterator f(hook_files.begin()), f_end(hook_files.end()) ;
+ f != f_end ; ++f)
+ f->second->add_dependencies(hook, hook_deps);
}
- catch (const NoGraphTopologicalOrderExistsError & e)
+
+ std::list<std::string> ordered;
{
- Log::get_instance()->message(ll_warning, lc_context, "Could not resolve dependency order for hook '"
- + hook.name() + "' due to exception '" + e.message() + "' (" + e.what() + "'), skipping hooks '" +
- join(e.remaining_nodes()->begin(), e.remaining_nodes()->end(), "', '") + "' and using hooks '" + join(ordered.begin(),
- ordered.end(), "', '") + "' in that order");;
+ Context context_local("When determining hook ordering for '" + hook.name() + "':");
+ try
+ {
+ hook_deps.topological_sort(std::back_inserter(ordered));
+ }
+ catch (const NoGraphTopologicalOrderExistsError & e)
+ {
+ Log::get_instance()->message(ll_warning, lc_context, "Could not resolve dependency order for hook '"
+ + hook.name() + "' due to exception '" + e.message() + "' (" + e.what() + "'), skipping hooks '" +
+ join(e.remaining_nodes()->begin(), e.remaining_nodes()->end(), "', '") + "' and using hooks '" + join(ordered.begin(),
+ ordered.end(), "', '") + "' in that order");;
+ }
}
for (std::list<std::string>::const_iterator o(ordered.begin()), o_end(ordered.end()) ;
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index e6ecc49..083e3e7 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -174,7 +174,6 @@ CRANInstalledRepository::CRANInstalledRepository(const CRANInstalledRepositoryPa
.installable_interface(0)
.installed_interface(this)
.contents_interface(this)
- .news_interface(0)
.sets_interface(this)
.syncable_interface(0)
.uninstallable_interface(this)
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index 2a4f4c7..dc59cf5 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -167,7 +167,6 @@ CRANRepository::CRANRepository(const CRANRepositoryParams & p) :
.mask_interface(0)
.installable_interface(this)
.installed_interface(0)
- .news_interface(0)
.sets_interface(this)
.syncable_interface(this)
.uninstallable_interface(0)
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index d7c85cb..4db9a5c 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -31,7 +31,6 @@ FakeInstalledRepository::FakeInstalledRepository(const Environment * const e, co
.installed_interface(this)
.contents_interface(0)
.mask_interface(this)
- .news_interface(0)
.sets_interface(this)
.syncable_interface(0)
.uninstallable_interface(0)
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index 0dc7c8c..fb10658 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -29,7 +29,6 @@ FakeRepository::FakeRepository(const Environment * const e, const RepositoryName
.installed_interface(0)
.contents_interface(0)
.mask_interface(this)
- .news_interface(0)
.sets_interface(this)
.syncable_interface(0)
.uninstallable_interface(0)
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index 7aa912a..d0cc3f4 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -244,7 +244,6 @@ GemsRepository::GemsRepository(const GemsRepositoryParams & p) :
.contents_interface(0)
.installable_interface(this)
.installed_interface(0)
- .news_interface(0)
.sets_interface(this)
.syncable_interface(this)
.uninstallable_interface(0)
diff --git a/paludis/repositories/gentoo/portage_repository.cc b/paludis/repositories/gentoo/portage_repository.cc
index bfc30e2..ca4645c 100644
--- a/paludis/repositories/gentoo/portage_repository.cc
+++ b/paludis/repositories/gentoo/portage_repository.cc
@@ -276,7 +276,6 @@ PortageRepository::PortageRepository(const PortageRepositoryParams & p) :
.mask_interface(this)
.installable_interface(this)
.installed_interface(0)
- .news_interface(this)
.sets_interface(this)
.syncable_interface(this)
.uninstallable_interface(0)
@@ -1290,6 +1289,9 @@ PortageRepository::perform_hook(const Hook & hook) const
Context context("When performing hook '" + stringify(hook.name()) + "' for repository '"
+ stringify(name()) + "':");
+ if (hook.name() == "sync_all_post")
+ update_news();
+
return 0;
}
diff --git a/paludis/repositories/gentoo/portage_repository.hh b/paludis/repositories/gentoo/portage_repository.hh
index 7c8ec64..1008092 100644
--- a/paludis/repositories/gentoo/portage_repository.hh
+++ b/paludis/repositories/gentoo/portage_repository.hh
@@ -52,7 +52,6 @@ namespace paludis
public RepositoryUseInterface,
public RepositoryInstallableInterface,
public RepositorySyncableInterface,
- public RepositoryNewsInterface,
public RepositorySetsInterface,
public RepositoryEnvironmentVariableInterface,
public RepositoryMirrorsInterface,
@@ -161,8 +160,6 @@ namespace paludis
virtual void invalidate();
virtual void regenerate_cache() const;
- virtual void update_news() const;
-
virtual std::string get_environment_variable(
const PackageDatabaseEntry & for_package,
const std::string & var) const;
@@ -193,6 +190,9 @@ namespace paludis
int perform_hook(const Hook &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ void update_news() const;
+
};
}
diff --git a/paludis/repositories/gentoo/portage_repository_news.cc b/paludis/repositories/gentoo/portage_repository_news.cc
index 339b652..0223e35 100644
--- a/paludis/repositories/gentoo/portage_repository_news.cc
+++ b/paludis/repositories/gentoo/portage_repository_news.cc
@@ -100,6 +100,13 @@ PortageRepositoryNews::update_news() const
{
Context local_context("When handling news entry '" + stringify(*d) + "':");
+ if (0 == stringify(_imp->portage_repository->name()).compare(0, 2, "x-"))
+ {
+ Log::get_instance()->message(ll_warning, lc_context, "Cannot enable GLEP 42 news items for repository '"
+ + stringify(_imp->portage_repository->name()) + "' because it is using a generated repository name");
+ return;
+ }
+
if (! d->is_directory())
continue;
if (! (*d / (d->basename() + ".en.txt")).is_regular_file())
diff --git a/paludis/repositories/gentoo/vdb_repository.cc b/paludis/repositories/gentoo/vdb_repository.cc
index 7e2b23f..979699e 100644
--- a/paludis/repositories/gentoo/vdb_repository.cc
+++ b/paludis/repositories/gentoo/vdb_repository.cc
@@ -514,7 +514,6 @@ VDBRepository::VDBRepository(const VDBRepositoryParams & p) :
.installable_interface(0)
.installed_interface(this)
.mask_interface(0)
- .news_interface(0)
.sets_interface(this)
.syncable_interface(0)
.uninstallable_interface(this)
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index fa28eda..0c5750d 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -89,7 +89,6 @@ InstalledVirtualsRepository::InstalledVirtualsRepository(const Environment * con
.mask_interface(this)
.installed_interface(this)
.use_interface(0)
- .news_interface(0)
.sets_interface(0)
.syncable_interface(0)
.uninstallable_interface(0)
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 21a5d09..e2d4b93 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -80,7 +80,6 @@ VirtualsRepository::VirtualsRepository(const Environment * const env) :
.mask_interface(this)
.installed_interface(0)
.use_interface(0)
- .news_interface(0)
.sets_interface(0)
.syncable_interface(0)
.uninstallable_interface(0)
diff --git a/paludis/repository.cc b/paludis/repository.cc
index 836230c..5665f00 100644
--- a/paludis/repository.cc
+++ b/paludis/repository.cc
@@ -270,10 +270,6 @@ RepositoryMaskInterface::~RepositoryMaskInterface()
{
}
-RepositoryNewsInterface::~RepositoryNewsInterface()
-{
-}
-
RepositorySetsInterface::~RepositorySetsInterface()
{
}
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 49aedcb..8ce76d7 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -54,7 +54,6 @@ namespace paludis
class RepositoryInstallableInterface;
class RepositoryInstalledInterface;
class RepositoryMaskInterface;
- class RepositoryNewsInterface;
class RepositorySetsInterface;
class RepositorySyncableInterface;
class RepositoryUninstallableInterface;
@@ -863,29 +862,6 @@ namespace paludis
};
/**
- * Interface for news handling for repositories.
- *
- * \see Repository
- * \ingroup grprepository
- * \nosubgrouping
- */
- class RepositoryNewsInterface
- {
- public:
- ///\name News functionality
- ///\{
-
- /**
- * Update our news.unread file.
- */
- virtual void update_news() const = 0;
-
- ///\}
-
- virtual ~RepositoryNewsInterface();
- };
-
- /**
* Interface for environment variable querying for repositories.
*
* \see Repository
diff --git a/paludis/repository.sr b/paludis/repository.sr
index 02aa7f9..6bd9bd1 100644
--- a/paludis/repository.sr
+++ b/paludis/repository.sr
@@ -40,7 +40,6 @@ make_class_RepositoryCapabilities()
key installable_interface "RepositoryInstallableInterface *"
key installed_interface "RepositoryInstalledInterface *"
key mask_interface "RepositoryMaskInterface *"
- key news_interface "RepositoryNewsInterface *"
key sets_interface "RepositorySetsInterface *"
key syncable_interface "RepositorySyncableInterface *"
key uninstallable_interface "RepositoryUninstallableInterface *"
diff --git a/ruby/repository.cc b/ruby/repository.cc
index 17a163e..b15be6c 100644
--- a/ruby/repository.cc
+++ b/ruby/repository.cc
@@ -961,8 +961,6 @@ namespace
&Repository::installed_interface>::fetch)), 0);
rb_define_method(c_repository, "mask_interface", RUBY_FUNC_CAST((&Interface<RepositoryMaskInterface,
&Repository::mask_interface>::fetch)), 0);
- rb_define_method(c_repository, "news_interface", RUBY_FUNC_CAST((&Interface<RepositoryNewsInterface,
- &Repository::news_interface>::fetch)), 0);
rb_define_method(c_repository, "sets_interface", RUBY_FUNC_CAST((&Interface<RepositorySetsInterface,
&Repository::sets_interface>::fetch)), 0);
rb_define_method(c_repository, "syncable_interface", RUBY_FUNC_CAST((&Interface<RepositorySyncableInterface,
diff --git a/ruby/repository_TEST.rb b/ruby/repository_TEST.rb
index 0dc3f74..e517d93 100644
--- a/ruby/repository_TEST.rb
+++ b/ruby/repository_TEST.rb
@@ -188,7 +188,7 @@ module Paludis
def test_responds
repo = no_config_testrepo.main_repository
- [:installable_interface, :installed_interface, :mask_interface, :news_interface,
+ [:installable_interface, :installed_interface, :mask_interface,
:sets_interface, :syncable_interface, :uninstallable_interface, :use_interface,
:world_interface, :mirrors_interface, :environment_variable_interface,
:provides_interface, :virtuals_interface, :contents_interface, :portage_interface].each do |sym|
diff --git a/src/clients/paludis/Makefile.am b/src/clients/paludis/Makefile.am
index e8cf0e3..57657c1 100644
--- a/src/clients/paludis/Makefile.am
+++ b/src/clients/paludis/Makefile.am
@@ -42,7 +42,6 @@ paludis_SOURCES = \
do_contents.hh do_contents.cc \
do_config.hh do_config.cc \
owner.hh owner.cc \
- news.hh news.cc \
report.hh report.cc \
paludis.cc
diff --git a/src/clients/paludis/command_line.cc b/src/clients/paludis/command_line.cc
index f7d14fe..29769be 100644
--- a/src/clients/paludis/command_line.cc
+++ b/src/clients/paludis/command_line.cc
@@ -56,7 +56,6 @@ CommandLine::CommandLine() :
a_list_repository_formats(&action_args_internal, "list-repository-formats", '\0',
"List available repository formats"),
a_list_dep_tag_categories(&action_args_internal, "list-dep-tag-categories", '\0', "List known dep tag categories"),
- a_update_news(&action_args_internal, "update-news", '\0', "Regenerate news.unread files"),
a_regenerate_installed_cache(&action_args_internal, "regenerate-installed-cache", '\0',
"Regenerate (non-metadata) cache for installed repositories"),
a_regenerate_installable_cache(&action_args_internal, "regenerate-installable-cache", '\0',
@@ -237,7 +236,9 @@ CommandLine::CommandLine() :
a_add_to_world_atom(&deprecated_args, "add-to-world-atom", '\0',
"Replaced by --add-to-world-spec"),
a_config_suffix(&deprecated_args, "config-suffix", 'c',
- "Replaced by --environment")
+ "Replaced by --environment"),
+ a_update_news(&action_args_internal, "update-news", '\0',
+ "No longer useful, does nothing")
{
add_usage_line("--query [query options] target ...");
add_usage_line("--install [install options] target ...");
@@ -260,7 +261,6 @@ CommandLine::CommandLine() :
add_usage_line("--list-sync-protocols");
add_usage_line("--list-repository-formats");
add_usage_line("--list-dep-tag-categories");
- add_usage_line("--update-news");
add_environment_variable("PALUDIS_HOME", "Overrides the home directory used when searching "
"for configuration files etc.");
diff --git a/src/clients/paludis/command_line.hh b/src/clients/paludis/command_line.hh
index e5c288d..f1f01e9 100644
--- a/src/clients/paludis/command_line.hh
+++ b/src/clients/paludis/command_line.hh
@@ -134,9 +134,6 @@ class CommandLine :
/// --list-dep-tag-categories
paludis::args::SwitchArg a_list_dep_tag_categories;
- /// --update-news
- paludis::args::SwitchArg a_update_news;
-
/// --regenerate-installed-cache
paludis::args::SwitchArg a_regenerate_installed_cache;
@@ -314,7 +311,7 @@ class CommandLine :
paludis::args::StringArg a_show_install_reasons;
paludis::args::StringArg a_add_to_world_atom;
paludis::args::StringArg a_config_suffix;
-
+ paludis::args::SwitchArg a_update_news;
///\}
};
diff --git a/src/clients/paludis/news.cc b/src/clients/paludis/news.cc
deleted file mode 100644
index da1cb3c..0000000
--- a/src/clients/paludis/news.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <src/output/colour.hh>
-#include "news.hh"
-#include <functional>
-#include <iomanip>
-#include <iostream>
-#include <paludis/paludis.hh>
-#include <string>
-
-/** \file
- * Handle the --update-news action for the main paludis program.
- */
-
-using namespace paludis;
-
-int
-do_update_news(std::tr1::shared_ptr<Environment> env)
-{
- int return_code(0);
-
- Context context("When performing update-news action from command line:");
-
- for (PackageDatabase::RepositoryIterator r(env->package_database()->begin_repositories()),
- r_end(env->package_database()->end_repositories()) ; r != r_end ; ++r)
- if ((*r)->news_interface)
- (*r)->news_interface->update_news();
-
- return return_code;
-}
-
-
-
diff --git a/src/clients/paludis/news.hh b/src/clients/paludis/news.hh
deleted file mode 100644
index 4c2e88f..0000000
--- a/src/clients/paludis/news.hh
+++ /dev/null
@@ -1,39 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_SRC_NEWS_HH
-#define PALUDIS_GUARD_SRC_NEWS_HH 1
-
-#include "command_line.hh"
-
-/** \file
- * Declaration for the do_update_news function.
- */
-
-namespace paludis
-{
- class Environment;
-}
-
-/// Handle --update-news.
-int do_update_news(std::tr1::shared_ptr<paludis::Environment>);
-
-#endif
-
-
diff --git a/src/clients/paludis/paludis.cc b/src/clients/paludis/paludis.cc
index ddadd00..eef32c9 100644
--- a/src/clients/paludis/paludis.cc
+++ b/src/clients/paludis/paludis.cc
@@ -24,7 +24,6 @@
#include "do_config.hh"
#include "install.hh"
#include "list.hh"
-#include "news.hh"
#include "owner.hh"
#include "query.hh"
#include "report.hh"
@@ -485,10 +484,9 @@ main(int argc, char *argv[])
if (CommandLine::get_instance()->a_update_news.specified())
{
- if (! CommandLine::get_instance()->empty())
- throw args::DoHelp("update-news action takes no parameters");
-
- return do_update_news(env);
+ Log::get_instance()->message(ll_warning, lc_no_context,
+ "Calling --update-news is no longer useful or necessary");
+ return EXIT_SUCCESS;
}
if (CommandLine::get_instance()->a_regenerate_installed_cache.specified() ||
diff --git a/src/clients/paludis/sync.cc b/src/clients/paludis/sync.cc
index a9ead07..f05db29 100644
--- a/src/clients/paludis/sync.cc
+++ b/src/clients/paludis/sync.cc
@@ -121,6 +121,7 @@ int do_sync(std::tr1::shared_ptr<Environment> env)
task.add_target(*q);
task.execute();
+ cout << endl;
return task.return_code();
}