aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-12 11:45:03 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-12 18:26:26 +0100
commitd2a099ba20322fe14bfef923831d0c80aa054022 (patch)
treeef692842edd0c7c63f8e43899f4679458f4b878f
parenta9d0bdd2ddedf24c4e200aaecf9ba01ede313f13 (diff)
downloadpaludis-d2a099ba20322fe14bfef923831d0c80aa054022.tar.gz
paludis-d2a099ba20322fe14bfef923831d0c80aa054022.tar.xz
Let hooks take an output manager
-rw-r--r--paludis/environment.hh6
-rw-r--r--paludis/environments/no_config/no_config_environment.cc5
-rw-r--r--paludis/environments/no_config/no_config_environment.hh4
-rw-r--r--paludis/environments/paludis/paludis_environment.cc6
-rw-r--r--paludis/environments/paludis/paludis_environment.hh4
-rw-r--r--paludis/environments/portage/portage_environment.cc6
-rw-r--r--paludis/environments/portage/portage_environment.hh4
-rw-r--r--paludis/environments/test/test_environment.cc4
-rw-r--r--paludis/environments/test/test_environment.hh4
-rw-r--r--paludis/fs_merger.cc43
-rw-r--r--paludis/fs_merger_TEST.cc6
-rw-r--r--paludis/hooker.cc34
-rw-r--r--paludis/hooker.hh17
-rw-r--r--paludis/hooker_TEST.cc52
-rw-r--r--paludis/legacy/install_task.cc67
-rw-r--r--paludis/legacy/install_task.hh2
-rw-r--r--paludis/legacy/sync_task.cc19
-rw-r--r--paludis/legacy/uninstall_task.cc15
-rw-r--r--paludis/merger.cc40
-rw-r--r--paludis/python_hooks.cc4
-rw-r--r--paludis/repositories/accounts/accounts_repository.cc4
-rw-r--r--paludis/repositories/accounts/accounts_repository.hh4
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc4
-rw-r--r--paludis/repositories/cran/cran_installed_repository.hh4
-rw-r--r--paludis/repositories/cran/cran_repository.cc4
-rw-r--r--paludis/repositories/cran/cran_repository.hh4
-rw-r--r--paludis/repositories/e/e_installed_repository.cc2
-rw-r--r--paludis/repositories/e/e_installed_repository.hh4
-rw-r--r--paludis/repositories/e/e_repository.cc2
-rw-r--r--paludis/repositories/e/e_repository.hh2
-rw-r--r--paludis/repositories/fake/fake_repository_base.cc2
-rw-r--r--paludis/repositories/fake/fake_repository_base.hh4
-rw-r--r--paludis/repositories/gems/gems_repository.cc2
-rw-r--r--paludis/repositories/gems/gems_repository.hh2
-rw-r--r--paludis/repositories/gems/installed_gems_repository.cc2
-rw-r--r--paludis/repositories/gems/installed_gems_repository.hh2
-rw-r--r--paludis/repositories/repository/repository_repository.cc2
-rw-r--r--paludis/repositories/repository/repository_repository.hh2
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.cc2
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.hh2
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc2
-rw-r--r--paludis/repositories/unpackaged/installed_repository.hh2
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.cc2
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.hh2
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.cc2
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.hh2
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc2
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.hh2
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc2
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.hh2
-rw-r--r--paludis/repository.hh5
-rw-r--r--paludis/unmerger.cc45
-rw-r--r--python/additional_tests.cc3
-rw-r--r--python/environment.cc2
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc28
-rw-r--r--src/clients/cave/cmd_perform.cc12
-rw-r--r--src/clients/cave/cmd_sync.cc17
-rw-r--r--src/output/console_install_task.cc6
-rw-r--r--src/output/console_install_task.hh2
59 files changed, 344 insertions, 194 deletions
diff --git a/paludis/environment.hh b/paludis/environment.hh
index b479cd5..e776b4d 100644
--- a/paludis/environment.hh
+++ b/paludis/environment.hh
@@ -397,8 +397,12 @@ namespace paludis
/**
* Perform a hook.
+ *
+ * \since 0.53 takes optional_output_manager
*/
- virtual HookResult perform_hook(const Hook &) const
+ virtual HookResult perform_hook(
+ const Hook &,
+ const std::shared_ptr<OutputManager> & optional_output_manager) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
///\}
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index 6c13024..509d63f 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -542,7 +542,10 @@ NoConfigEnvironment::root() const
}
HookResult
-NoConfigEnvironment::perform_hook(const Hook &) const
+NoConfigEnvironment::perform_hook(
+ const Hook &,
+ const std::shared_ptr<OutputManager> &
+ ) const
{
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
diff --git a/paludis/environments/no_config/no_config_environment.hh b/paludis/environments/no_config/no_config_environment.hh
index 9eaf5a0..d4afc6b 100644
--- a/paludis/environments/no_config/no_config_environment.hh
+++ b/paludis/environments/no_config/no_config_environment.hh
@@ -202,7 +202,9 @@ namespace paludis
virtual std::shared_ptr<const MirrorsSequence> mirrors(const std::string &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual HookResult perform_hook(const Hook &) const
+ virtual HookResult perform_hook(
+ const Hook &,
+ const std::shared_ptr<OutputManager> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool add_to_world(const QualifiedPackageName &) const;
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index d03a4c5..1ceed9d 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -207,7 +207,9 @@ PaludisEnvironment::set_paludis_command(const std::string & s)
}
HookResult
-PaludisEnvironment::perform_hook(const Hook & hook) const
+PaludisEnvironment::perform_hook(
+ const Hook & hook,
+ const std::shared_ptr<OutputManager> & optional_output_manager) const
{
Lock lock(_imp->hook_mutex);
@@ -220,7 +222,7 @@ PaludisEnvironment::perform_hook(const Hook & hook) const
_imp->hooker->add_dir(h->first, h->second);
}
- return _imp->hooker->perform_hook(hook);
+ return _imp->hooker->perform_hook(hook, optional_output_manager);
}
std::shared_ptr<const FSEntrySequence>
diff --git a/paludis/environments/paludis/paludis_environment.hh b/paludis/environments/paludis/paludis_environment.hh
index bc10935..dbedf31 100644
--- a/paludis/environments/paludis/paludis_environment.hh
+++ b/paludis/environments/paludis/paludis_environment.hh
@@ -100,7 +100,9 @@ namespace paludis
virtual std::shared_ptr<const MirrorsSequence> mirrors(const std::string &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual HookResult perform_hook(const Hook &) const
+ virtual HookResult perform_hook(
+ const Hook &,
+ const std::shared_ptr<OutputManager> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::string paludis_command() const
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index 1221bc2..f3cfb86 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -704,7 +704,9 @@ PortageEnvironment::known_choice_value_names(const std::shared_ptr<const Package
}
HookResult
-PortageEnvironment::perform_hook(const Hook & hook) const
+PortageEnvironment::perform_hook(
+ const Hook & hook,
+ const std::shared_ptr<OutputManager> & optional_output_manager) const
{
using namespace std::placeholders;
@@ -717,7 +719,7 @@ PortageEnvironment::perform_hook(const Hook & hook) const
std::bind(std::mem_fn(&Hooker::add_dir), _imp->hooker.get(), _1, false));
}
- return _imp->hooker->perform_hook(hook);
+ return _imp->hooker->perform_hook(hook, optional_output_manager);
}
std::shared_ptr<const FSEntrySequence>
diff --git a/paludis/environments/portage/portage_environment.hh b/paludis/environments/portage/portage_environment.hh
index e16e106..c38e67c 100644
--- a/paludis/environments/portage/portage_environment.hh
+++ b/paludis/environments/portage/portage_environment.hh
@@ -124,7 +124,9 @@ namespace paludis
virtual std::shared_ptr<const MirrorsSequence> mirrors(const std::string &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual HookResult perform_hook(const Hook &) const
+ virtual HookResult perform_hook(
+ const Hook &,
+ const std::shared_ptr<OutputManager> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::shared_ptr<PackageDatabase> package_database()
diff --git a/paludis/environments/test/test_environment.cc b/paludis/environments/test/test_environment.cc
index da4ee72..01fadbb 100644
--- a/paludis/environments/test/test_environment.cc
+++ b/paludis/environments/test/test_environment.cc
@@ -162,7 +162,9 @@ TestEnvironment::mirrors(const std::string & s) const
}
HookResult
-TestEnvironment::perform_hook(const Hook &) const
+TestEnvironment::perform_hook(
+ const Hook &,
+ const std::shared_ptr<OutputManager> &) const
{
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
diff --git a/paludis/environments/test/test_environment.hh b/paludis/environments/test/test_environment.hh
index 67d3137..909b2b8 100644
--- a/paludis/environments/test/test_environment.hh
+++ b/paludis/environments/test/test_environment.hh
@@ -105,7 +105,9 @@ namespace paludis
virtual std::shared_ptr<const MirrorsSequence> mirrors(const std::string &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual HookResult perform_hook(const Hook &) const
+ virtual HookResult perform_hook(
+ const Hook &,
+ const std::shared_ptr<OutputManager> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool add_to_world(const QualifiedPackageName &) const;
diff --git a/paludis/fs_merger.cc b/paludis/fs_merger.cc
index 4dc0b53..426a272 100644
--- a/paludis/fs_merger.cc
+++ b/paludis/fs_merger.cc
@@ -29,6 +29,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/timestamp.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/selinux/security_context.hh>
#include <paludis/environment.hh>
#include <paludis/hook.hh>
@@ -308,7 +309,8 @@ FSMerger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::
Hook("merger_install_file_pre")
("INSTALL_SOURCE", stringify(src))
("INSTALL_DESTINATION", stringify(dst_dir / src.basename()))
- ("REAL_DESTINATION", stringify(dst_real)))).max_exit_status())
+ ("REAL_DESTINATION", stringify(dst_real))),
+ make_null_shared_ptr()).max_exit_status())
Log::get_instance()->message("merger.file.pre_hooks.failure", ll_warning, lc_context) <<
"Merge of '" << src << "' to '" << dst_dir << "' pre hooks returned non-zero";
@@ -416,7 +418,8 @@ FSMerger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::
Hook("merger_install_file_post")
("INSTALL_SOURCE", stringify(src))
("INSTALL_DESTINATION", stringify(dst_dir / src.basename()))
- ("REAL_DESTINATION", stringify(dst_real)))).max_exit_status())
+ ("REAL_DESTINATION", stringify(dst_real))),
+ make_null_shared_ptr()).max_exit_status())
Log::get_instance()->message("merger.file.post_hooks.failed", ll_warning, lc_context) <<
"Merge of '" << src << "' to '" << dst_dir << "' post hooks returned non-zero";
@@ -496,7 +499,8 @@ FSMerger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_install_dir_pre")
("INSTALL_SOURCE", stringify(src))
- ("INSTALL_DESTINATION", stringify(dst_dir / src.basename())))).max_exit_status())
+ ("INSTALL_DESTINATION", stringify(dst_dir / src.basename()))),
+ make_null_shared_ptr()).max_exit_status())
Log::get_instance()->message("merger.dir.pre_hooks.failure", ll_warning, lc_context)
<< "Merge of '" << src << "' to '" << dst_dir << "' pre hooks returned non-zero";
@@ -552,7 +556,8 @@ FSMerger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_install_dir_post")
("INSTALL_SOURCE", stringify(src))
- ("INSTALL_DESTINATION", stringify(dst_dir / src.basename())))).max_exit_status())
+ ("INSTALL_DESTINATION", stringify(dst_dir / src.basename()))),
+ make_null_shared_ptr()).max_exit_status())
Log::get_instance()->message("merger.dir.post_hooks.failure", ll_warning, lc_context)
<< "Merge of '" << src << "' to '" << dst_dir << "' post hooks returned non-zero";
@@ -571,7 +576,8 @@ FSMerger::install_sym(const FSEntry & src, const FSEntry & dst_dir)
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_install_sym_pre")
("INSTALL_SOURCE", stringify(src))
- ("INSTALL_DESTINATION", stringify(dst)))).max_exit_status())
+ ("INSTALL_DESTINATION", stringify(dst))),
+ make_null_shared_ptr()).max_exit_status())
Log::get_instance()->message("merger.sym.pre_hooks.failure", ll_warning, lc_context)
<< "Merge of '" << src << "' to '" << dst_dir << "' pre hooks returned non-zero";
@@ -614,7 +620,8 @@ FSMerger::install_sym(const FSEntry & src, const FSEntry & dst_dir)
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_install_sym_post")
("INSTALL_SOURCE", stringify(src))
- ("INSTALL_DESTINATION", stringify(dst)))).max_exit_status())
+ ("INSTALL_DESTINATION", stringify(dst))),
+ make_null_shared_ptr()).max_exit_status())
Log::get_instance()->message("merger.sym.post_hooks.failure", ll_warning, lc_context) <<
"Merge of '" << src << "' to '" << dst_dir << "' post hooks returned non-zero";
@@ -626,7 +633,8 @@ FSMerger::unlink_file(FSEntry d)
{
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_unlink_file_pre")
- ("UNLINK_TARGET", stringify(d)))).max_exit_status())
+ ("UNLINK_TARGET", stringify(d))),
+ make_null_shared_ptr()).max_exit_status())
Log::get_instance()->message("merger.unlink_file.pre_hooks.failure", ll_warning, lc_context) <<
"Unmerge of '" << d << "' pre hooks returned non-zero";
@@ -635,7 +643,8 @@ FSMerger::unlink_file(FSEntry d)
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_unlink_file_post")
- ("UNLINK_TARGET", stringify(d)))).max_exit_status())
+ ("UNLINK_TARGET", stringify(d))),
+ make_null_shared_ptr()).max_exit_status())
Log::get_instance()->message("merger.unlink_file.post_hooks.failure", ll_warning, lc_context) <<
"Unmerge of '" << d << "' post hooks returned non-zero";
}
@@ -645,7 +654,8 @@ FSMerger::unlink_sym(FSEntry d)
{
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_unlink_sym_pre")
- ("UNLINK_TARGET", stringify(d)))).max_exit_status())
+ ("UNLINK_TARGET", stringify(d))),
+ make_null_shared_ptr()).max_exit_status())
Log::get_instance()->message("merger.unlink_sym.pre_hooks.failure", ll_warning, lc_context) <<
"Unmerge of '" << d << "' pre hooks returned non-zero";
@@ -653,7 +663,8 @@ FSMerger::unlink_sym(FSEntry d)
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_unlink_sym_post")
- ("UNLINK_TARGET", stringify(d)))).max_exit_status())
+ ("UNLINK_TARGET", stringify(d))),
+ make_null_shared_ptr()).max_exit_status())
Log::get_instance()->message("merger.unlink_sym.post_hooks.failure", ll_warning, lc_context) <<
"Unmerge of '" << d << "' post hooks returned non-zero";
}
@@ -663,7 +674,8 @@ FSMerger::unlink_dir(FSEntry d)
{
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_unlink_dir_pre")
- ("UNLINK_TARGET", stringify(d)))).max_exit_status())
+ ("UNLINK_TARGET", stringify(d))),
+ make_null_shared_ptr()).max_exit_status())
Log::get_instance()->message("merger.unlink_dir.pre_hooks.failure", ll_warning, lc_context) <<
"Unmerge of '" << d << "' pre hooks returned non-zero";
@@ -671,7 +683,8 @@ FSMerger::unlink_dir(FSEntry d)
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_unlink_dir_post")
- ("UNLINK_TARGET", stringify(d)))).max_exit_status())
+ ("UNLINK_TARGET", stringify(d))),
+ make_null_shared_ptr()).max_exit_status())
Log::get_instance()->message("merger.unlink_dir.post_hooks.failure", ll_warning, lc_context) <<
"Unmerge of '" << d << "' post hooks returned non-zero";
}
@@ -681,7 +694,8 @@ FSMerger::unlink_misc(FSEntry d)
{
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_unlink_misc_pre")
- ("UNLINK_TARGET", stringify(d)))).max_exit_status())
+ ("UNLINK_TARGET", stringify(d))),
+ make_null_shared_ptr()).max_exit_status())
Log::get_instance()->message("merger.unlink_misc.pre_hooks.failure", ll_warning, lc_context) <<
"Unmerge of '" << d << "' pre hooks returned non-zero";
@@ -689,7 +703,8 @@ FSMerger::unlink_misc(FSEntry d)
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_unlink_misc_post")
- ("UNLINK_TARGET", stringify(d)))).max_exit_status())
+ ("UNLINK_TARGET", stringify(d))),
+ make_null_shared_ptr()).max_exit_status())
Log::get_instance()->message("merger.unlink_misc.post_hooks.failure", ll_warning, lc_context) <<
"Unmerge of '" << d << "' post hooks returned non-zero";
}
diff --git a/paludis/fs_merger_TEST.cc b/paludis/fs_merger_TEST.cc
index 132b18a..bb54e4f 100644
--- a/paludis/fs_merger_TEST.cc
+++ b/paludis/fs_merger_TEST.cc
@@ -67,7 +67,7 @@ namespace paludis
virtual ~HookTestEnvironment();
- virtual HookResult perform_hook(const Hook &) const
+ virtual HookResult perform_hook(const Hook &, const std::shared_ptr<OutputManager> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
};
@@ -83,7 +83,7 @@ namespace paludis
}
HookResult
- HookTestEnvironment::perform_hook(const Hook & hook) const
+ HookTestEnvironment::perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> & optional_output_manager) const
{
if (! hooker)
{
@@ -92,7 +92,7 @@ namespace paludis
h_end(hook_dirs.end()) ; h != h_end ; ++h)
hooker->add_dir(h->first, h->second);
}
- return hooker->perform_hook(hook);
+ return hooker->perform_hook(hook, optional_output_manager);
}
}
diff --git a/paludis/hooker.cc b/paludis/hooker.cc
index 5fcb2df..2aa6fbd 100644
--- a/paludis/hooker.cc
+++ b/paludis/hooker.cc
@@ -72,7 +72,9 @@ namespace
{
}
- virtual HookResult run(const Hook &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual HookResult run(
+ const Hook &,
+ const std::shared_ptr<OutputManager> &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const FSEntry file_name() const
{
@@ -107,7 +109,9 @@ namespace
{
}
- virtual HookResult run(const Hook &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual HookResult run(
+ const Hook &,
+ const std::shared_ptr<OutputManager> &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const FSEntry file_name() const
{
@@ -134,7 +138,9 @@ namespace
public:
SoHookFile(const FSEntry &, const bool, const Environment * const);
- virtual HookResult run(const Hook &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual HookResult run(
+ const Hook &,
+ const std::shared_ptr<OutputManager> &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const FSEntry file_name() const
{
@@ -148,7 +154,9 @@ namespace
}
HookResult
-BashHookFile::run(const Hook & hook) const
+BashHookFile::run(
+ const Hook & hook,
+ const std::shared_ptr<OutputManager> &) const
{
Context c("When running hook script '" + stringify(file_name()) + "' for hook '" + hook.name() + "':");
@@ -199,7 +207,8 @@ BashHookFile::run(const Hook & hook) const
}
HookResult
-FancyHookFile::run(const Hook & hook) const
+FancyHookFile::run(const Hook & hook,
+ const std::shared_ptr<OutputManager> &) const
{
Context c("When running hook script '" + stringify(file_name()) + "' for hook '" + hook.name() + "':");
@@ -403,7 +412,8 @@ SoHookFile::SoHookFile(const FSEntry & f, const bool, const Environment * const
}
HookResult
-SoHookFile::run(const Hook & hook) const
+SoHookFile::run(const Hook & hook,
+ const std::shared_ptr<OutputManager> &) const
{
Context c("When running .so hook '" + stringify(file_name()) + "' for hook '" + hook.name() + "':");
@@ -701,7 +711,9 @@ Hooker::_find_hooks(const Hook & hook) const
}
HookResult
-Hooker::perform_hook(const Hook & hook) const
+Hooker::perform_hook(
+ const Hook & hook,
+ const std::shared_ptr<OutputManager> & optional_output_manager) const
{
HookResult result(make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = ""));
@@ -718,14 +730,14 @@ Hooker::perform_hook(const Hook & hook) const
for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
result.max_exit_status() = std::max(result.max_exit_status(),
- ((*r)->perform_hook(hook)).max_exit_status());
+ ((*r)->perform_hook(hook, optional_output_manager)).max_exit_status());
continue;
case hod_grab:
for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
{
- HookResult tmp((*r)->perform_hook(hook));
+ HookResult tmp((*r)->perform_hook(hook, optional_output_manager));
if (tmp.max_exit_status() > result.max_exit_status())
result = tmp;
else if (! tmp.output().empty())
@@ -767,7 +779,7 @@ Hooker::perform_hook(const Hook & hook) const
for (Sequence<std::shared_ptr<HookFile> >::ConstIterator f(h->second->begin()),
f_end(h->second->end()) ; f != f_end ; ++f)
if ((*f)->file_name().is_regular_file_or_symlink_to_regular_file())
- result.max_exit_status() = std::max(result.max_exit_status(), (*f)->run(hook).max_exit_status());
+ result.max_exit_status() = std::max(result.max_exit_status(), (*f)->run(hook, optional_output_manager).max_exit_status());
else
Log::get_instance()->message("hook.not_regular_file", ll_warning, lc_context) << "Hook file '" <<
(*f)->file_name() << "' is not a regular file or has been removed";
@@ -784,7 +796,7 @@ Hooker::perform_hook(const Hook & hook) const
continue;
}
- HookResult tmp((*f)->run(hook));
+ HookResult tmp((*f)->run(hook, optional_output_manager));
if (tmp.max_exit_status() > result.max_exit_status())
result = tmp;
else if (! tmp.output().empty())
diff --git a/paludis/hooker.hh b/paludis/hooker.hh
index 7466cbe..0efc36f 100644
--- a/paludis/hooker.hh
+++ b/paludis/hooker.hh
@@ -24,6 +24,7 @@
#include <paludis/util/pimp.hh>
#include <paludis/util/graph-fwd.hh>
#include <paludis/util/sequence-fwd.hh>
+#include <paludis/output_manager-fwd.hh>
#include <memory>
#include <string>
@@ -64,9 +65,17 @@ namespace paludis
///\}
- virtual HookResult run(const Hook &) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ /**
+ * \since 0.53 takes optional_output_manager
+ */
+ virtual HookResult run(
+ const Hook &,
+ const std::shared_ptr<OutputManager> & optional_output_manager) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
virtual const FSEntry file_name() const = 0;
+
virtual void add_dependencies(const Hook &, DirectedGraph<std::string, int> &) = 0;
+
virtual const std::shared_ptr<const Sequence<std::string> > auto_hook_names() const = 0;
};
@@ -96,8 +105,12 @@ namespace paludis
/**
* Perform a hook, return HookResult.
+ *
+ * \since 0.53 takes optional_output_manager
*/
- HookResult perform_hook(const Hook &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ HookResult perform_hook(
+ const Hook &,
+ const std::shared_ptr<OutputManager> & optional_output_manager) const PALUDIS_ATTRIBUTE((warn_unused_result));
/**
* Add a new hook directory.
diff --git a/paludis/hooker_TEST.cc b/paludis/hooker_TEST.cc
index 1026b3c..f33aa17 100644
--- a/paludis/hooker_TEST.cc
+++ b/paludis/hooker_TEST.cc
@@ -24,6 +24,7 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/safe_ifstream.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
#include <iterator>
@@ -45,19 +46,24 @@ namespace test_cases
hooker.add_dir(FSEntry("hooker_TEST_dir/"), false);
#ifdef ENABLE_PYTHON_HOOKS
- result = hooker.perform_hook(Hook("py_hook"));
+ result = hooker.perform_hook(Hook("py_hook"),
+ make_null_shared_ptr());
TEST_CHECK_EQUAL(result.max_exit_status(), 0);
#endif
- result = hooker.perform_hook(Hook("simple_hook"));
+ result = hooker.perform_hook(Hook("simple_hook"),
+ make_null_shared_ptr());
TEST_CHECK_EQUAL(result.max_exit_status(), 3);
TEST_CHECK_EQUAL(result.output(), "");
- result = hooker.perform_hook(Hook("fancy_hook"));
+ result = hooker.perform_hook(Hook("fancy_hook"),
+ make_null_shared_ptr());
TEST_CHECK_EQUAL(result.max_exit_status(), 5);
TEST_CHECK_EQUAL(result.output(), "");
- result = hooker.perform_hook(Hook("so_hook"));
+ result = hooker.perform_hook(Hook("so_hook"),
+ make_null_shared_ptr());
TEST_CHECK_EQUAL(result.max_exit_status(), 6);
TEST_CHECK_EQUAL(result.output(), "");
- result = hooker.perform_hook(Hook("several_hooks"));
+ result = hooker.perform_hook(Hook("several_hooks"),
+ make_null_shared_ptr());
TEST_CHECK_EQUAL(result.max_exit_status(), 7);
TEST_CHECK_EQUAL(result.output(), "");
@@ -76,7 +82,8 @@ namespace test_cases
FSEntry("hooker_TEST_dir/ordering.out").unlink();
hooker.add_dir(FSEntry("hooker_TEST_dir/"), false);
- HookResult result(hooker.perform_hook(Hook("ordering")));
+ HookResult result(hooker.perform_hook(Hook("ordering"),
+ make_null_shared_ptr()));
TEST_CHECK_EQUAL(result.max_exit_status(), 0);
TEST_CHECK_EQUAL(result.output(), "");
@@ -104,7 +111,8 @@ namespace test_cases
FSEntry("hooker_TEST_dir/bad_hooks.out").unlink();
hooker.add_dir(FSEntry("hooker_TEST_dir/"), false);
- HookResult result(hooker.perform_hook(Hook("bad_hooks")));
+ HookResult result(hooker.perform_hook(Hook("bad_hooks"),
+ make_null_shared_ptr()));
TEST_CHECK_EQUAL(result.max_exit_status(), 123);
TEST_CHECK_EQUAL(result.output(), "");
@@ -127,7 +135,8 @@ namespace test_cases
FSEntry("hooker_TEST_dir/cycles.out").unlink();
hooker.add_dir(FSEntry("hooker_TEST_dir/"), false);
- HookResult result(hooker.perform_hook(Hook("cycles")));
+ HookResult result(hooker.perform_hook(Hook("cycles"),
+ make_null_shared_ptr()));
TEST_CHECK_EQUAL(result.max_exit_status(), 0);
TEST_CHECK_EQUAL(result.output(), "");
@@ -153,44 +162,52 @@ namespace test_cases
hooker.add_dir(FSEntry("hooker_TEST_dir/"), false);
result = hooker.perform_hook(Hook("simple_hook_output")
- .grab_output(Hook::AllowedOutputValues()("foo")));
+ .grab_output(Hook::AllowedOutputValues()("foo")),
+ make_null_shared_ptr());
TEST_CHECK_EQUAL(result.max_exit_status(), 0);
TEST_CHECK_EQUAL(result.output(), "foo");
result = hooker.perform_hook(Hook("fancy_hook_output")
- .grab_output(Hook::AllowedOutputValues()("foo")));
+ .grab_output(Hook::AllowedOutputValues()("foo")),
+ make_null_shared_ptr());
TEST_CHECK_EQUAL(result.max_exit_status(), 0);
TEST_CHECK_EQUAL(result.output(), "foo");
result = hooker.perform_hook(Hook("so_hook_output")
- .grab_output(Hook::AllowedOutputValues()("foo")));
+ .grab_output(Hook::AllowedOutputValues()("foo")),
+ make_null_shared_ptr());
TEST_CHECK_EQUAL(result.max_exit_status(), 0);
TEST_CHECK_EQUAL(result.output(), "foo");
#ifdef ENABLE_PYTHON_HOOKS
result = hooker.perform_hook(Hook("py_hook_output")
- .grab_output(Hook::AllowedOutputValues()("foo")));
+ .grab_output(Hook::AllowedOutputValues()("foo")),
+ make_null_shared_ptr());
TEST_CHECK_EQUAL(result.max_exit_status(), 0);
TEST_CHECK_EQUAL(result.output(), "foo");
#endif
result = hooker.perform_hook(Hook("several_hooks_output")
- .grab_output(Hook::AllowedOutputValues()));
+ .grab_output(Hook::AllowedOutputValues()),
+ make_null_shared_ptr());
TEST_CHECK_EQUAL(result.max_exit_status(), 0);
TEST_CHECK_EQUAL(result.output(), "one");
result = hooker.perform_hook(Hook("several_hooks_output")
- .grab_output(Hook::AllowedOutputValues()("one")));
+ .grab_output(Hook::AllowedOutputValues()("one")),
+ make_null_shared_ptr());
TEST_CHECK_EQUAL(result.max_exit_status(), 0);
TEST_CHECK_EQUAL(result.output(), "one");
result = hooker.perform_hook(Hook("several_hooks_output")
- .grab_output(Hook::AllowedOutputValues()("two")("three")));
+ .grab_output(Hook::AllowedOutputValues()("two")("three")),
+ make_null_shared_ptr());
TEST_CHECK_EQUAL(result.max_exit_status(), 0);
TEST_CHECK_EQUAL(result.output(), "two");
result = hooker.perform_hook(Hook("several_hooks_output")
- .grab_output(Hook::AllowedOutputValues()("blah")));
+ .grab_output(Hook::AllowedOutputValues()("blah")),
+ make_null_shared_ptr());
TEST_CHECK_EQUAL(result.output(), "");
TEST_CHECK_EQUAL(result.max_exit_status(), 0);
@@ -216,7 +233,8 @@ namespace test_cases
hooker.add_dir(FSEntry("hooker_TEST_dir/"), false);
HookResult result(hooker.perform_hook(Hook("several_hooks_output_bad")
- .grab_output(Hook::AllowedOutputValues())));
+ .grab_output(Hook::AllowedOutputValues()),
+ make_null_shared_ptr()));
TEST_CHECK_EQUAL(result.output(), "two");
TEST_CHECK_EQUAL(result.max_exit_status(), 99);
diff --git a/paludis/legacy/install_task.cc b/paludis/legacy/install_task.cc
index ea78a63..7d8cd55 100644
--- a/paludis/legacy/install_task.cc
+++ b/paludis/legacy/install_task.cc
@@ -50,6 +50,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/return_literal_function.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/create_output_manager_info.hh>
#include <paludis/output_manager_from_environment.hh>
#include <paludis/output_manager.hh>
@@ -590,10 +591,9 @@ InstallTask::_display_task_list()
if (_imp->pretend &&
0 != perform_hook(Hook("install_pretend_pre")
- ("TARGETS", join(
- _imp->raw_targets.begin(), _imp->raw_targets.end(), " "))
- ("DEPLIST_HAS_ERRORS", stringify(_imp->dep_list.has_errors()))
- ).max_exit_status())
+ ("TARGETS", join(_imp->raw_targets.begin(), _imp->raw_targets.end(), " "))
+ ("DEPLIST_HAS_ERRORS", stringify(_imp->dep_list.has_errors())),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Pretend install aborted by hook");
on_display_merge_list_pre();
@@ -605,7 +605,8 @@ InstallTask::_display_task_list()
if (_imp->pretend &&
0 != perform_hook(Hook("install_pretend_display_item_pre")
("TARGET", stringify(*dep->package_id()))
- ("KIND", stringify(dep->kind()))).max_exit_status())
+ ("KIND", stringify(dep->kind())),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Pretend install aborted by hook");
on_display_merge_list_entry(*dep);
@@ -613,7 +614,8 @@ InstallTask::_display_task_list()
if (_imp->pretend &&
0 != perform_hook(Hook("install_pretend_display_item_post")
("TARGET", stringify(*dep->package_id()))
- ("KIND", stringify(dep->kind()))).max_exit_status())
+ ("KIND", stringify(dep->kind())),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Pretend install aborted by hook");
}
@@ -803,10 +805,9 @@ InstallTask::_pretend()
if (_imp->pretend)
{
if (0 != perform_hook(Hook("install_pretend_post")
- ("TARGETS", join(
- _imp->raw_targets.begin(), _imp->raw_targets.end(), " "))
- ("DEPLIST_HAS_ERRORS", stringify(_imp->dep_list.has_errors()))
- ).max_exit_status())
+ ("TARGETS", join(_imp->raw_targets.begin(), _imp->raw_targets.end(), " "))
+ ("DEPLIST_HAS_ERRORS", stringify(_imp->dep_list.has_errors())),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Pretend install aborted by hook");
}
@@ -823,7 +824,8 @@ InstallTask::_clean(
{
/* clean one item */
if (0 != perform_hook(Hook("clean_pre")("TARGET", stringify(*id))
- ("X_OF_Y", stringify(x) + " of " + stringify(y))).max_exit_status())
+ ("X_OF_Y", stringify(x) + " of " + stringify(y)),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Clean of '" + cpvr + "' aborted by hook");
on_clean_pre(*dep, *id, x, y, s, f);
@@ -836,13 +838,15 @@ InstallTask::_clean(
{
on_clean_fail(*dep, *id, x, y, s, f);
HookResult PALUDIS_ATTRIBUTE((unused)) dummy(perform_hook(Hook("clean_fail")
- ("TARGET", stringify(*id))("MESSAGE", e.message())));
+ ("TARGET", stringify(*id))("MESSAGE", e.message()),
+ make_null_shared_ptr()));
throw;
}
on_clean_post(*dep, *id, x, y, s, f);
if (0 != perform_hook(Hook("clean_post")("TARGET", stringify(*id))
- ("X_OF_Y", stringify(x) + " of " + stringify(y))).max_exit_status())
+ ("X_OF_Y", stringify(x) + " of " + stringify(y)),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Clean of '" + cpvr + "' aborted by hook");
}
@@ -868,7 +872,8 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
{
if (0 != perform_hook(Hook("fetch_pre")
("TARGET", cpvr)
- ("X_OF_Y", stringify(x) + " of " + stringify(y))).max_exit_status())
+ ("X_OF_Y", stringify(x) + " of " + stringify(y)),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Fetch of '" + cpvr + "' aborted by hook");
on_fetch_pre(*dep, x, y, s, f);
}
@@ -877,7 +882,8 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
if (0 != perform_hook(Hook("install_pre")
("TARGET", cpvr)
("X_OF_Y", stringify(x) + " of " + stringify(y))
- ("PALUDIS_NO_LIVE_DESTINATION", live_destination ? "" : "yes")).max_exit_status())
+ ("PALUDIS_NO_LIVE_DESTINATION", live_destination ? "" : "yes"),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Install of '" + cpvr + "' aborted by hook");
on_install_pre(*dep, x, y, s, f);
}
@@ -957,7 +963,8 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
catch (const ActionFailedError & e)
{
on_install_fail(*dep, x, y, s, f);
- HookResult PALUDIS_ATTRIBUTE((unused)) dummy(perform_hook(Hook("install_fail")("TARGET", cpvr)("MESSAGE", e.message())));
+ HookResult PALUDIS_ATTRIBUTE((unused)) dummy(perform_hook(Hook("install_fail")("TARGET", cpvr)("MESSAGE", e.message()),
+ make_null_shared_ptr()));
throw;
}
@@ -967,7 +974,8 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
on_fetch_post(*dep, x, y, s, f);
if (0 != perform_hook(Hook("fetch_post")
("TARGET", cpvr)
- ("X_OF_Y", stringify(x) + " of " + stringify(y))).max_exit_status())
+ ("X_OF_Y", stringify(x) + " of " + stringify(y)),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Fetch of '" + cpvr + "' aborted by hook");
}
else
@@ -976,7 +984,8 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
if (0 != perform_hook(Hook("install_post")
("TARGET", cpvr)
("X_OF_Y", stringify(x) + " of " + stringify(y))
- ("PALUDIS_NO_LIVE_DESTINATION", live_destination ? "" : "yes")).max_exit_status())
+ ("PALUDIS_NO_LIVE_DESTINATION", live_destination ? "" : "yes"),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Install of '" + cpvr + "' aborted by hook");
}
@@ -1014,7 +1023,8 @@ InstallTask::_main_actions_pre_hooks()
if (_imp->fetch_only)
{
if (0 != perform_hook(Hook("fetch_all_pre")("TARGETS", join(
- _imp->raw_targets.begin(), _imp->raw_targets.end(), " "))).max_exit_status())
+ _imp->raw_targets.begin(), _imp->raw_targets.end(), " ")),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Fetch aborted by hook");
on_fetch_all_pre();
}
@@ -1029,7 +1039,8 @@ InstallTask::_main_actions_pre_hooks()
if (0 != perform_hook(Hook("install_all_pre")
("TARGETS", join(_imp->raw_targets.begin(), _imp->raw_targets.end(), " "))
- ("PALUDIS_NO_LIVE_DESTINATION", any_live_destination ? "" : "yes")).max_exit_status())
+ ("PALUDIS_NO_LIVE_DESTINATION", any_live_destination ? "" : "yes"),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Install aborted by hook");
on_install_all_pre();
}
@@ -1217,14 +1228,16 @@ InstallTask::_main_actions_post_hooks()
{
on_fetch_all_post();
if (0 != perform_hook(Hook("fetch_all_post")("TARGETS", join(
- _imp->raw_targets.begin(), _imp->raw_targets.end(), " "))).max_exit_status())
+ _imp->raw_targets.begin(), _imp->raw_targets.end(), " ")),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Fetch aborted by hook");
}
else
{
on_install_all_post();
if (0 != perform_hook(Hook("install_all_post")("TARGETS", join(
- _imp->raw_targets.begin(), _imp->raw_targets.end(), " "))).max_exit_status())
+ _imp->raw_targets.begin(), _imp->raw_targets.end(), " ")),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Install aborted by hook");
}
}
@@ -1262,7 +1275,8 @@ InstallTask::execute()
("PRETEND", stringify(_imp->pretend))
("FETCH_ONLY", stringify(_imp->fetch_only))
("DEPLIST_HAS_ERRORS", stringify(_imp->dep_list.has_errors()))
- ).max_exit_status())
+ ,
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Install task execute aborted by hook");
_execute();
@@ -1311,7 +1325,8 @@ InstallTask::execute()
("FETCH_ONLY", stringify(_imp->fetch_only))
("SUCCESS", stringify(success))
("DEPLIST_HAS_ERRORS", stringify(_imp->dep_list.has_errors()))
- ).max_exit_status())
+ ,
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Install task execute aborted by hook");
}
@@ -1381,9 +1396,9 @@ InstallTask::set_safe_resume(const bool value)
}
HookResult
-InstallTask::perform_hook(const Hook & hook)
+InstallTask::perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> & optional_output_manager)
{
- return _imp->env->perform_hook(hook);
+ return _imp->env->perform_hook(hook, optional_output_manager);
}
void
diff --git a/paludis/legacy/install_task.hh b/paludis/legacy/install_task.hh
index 98378f1..fc488ba 100644
--- a/paludis/legacy/install_task.hh
+++ b/paludis/legacy/install_task.hh
@@ -256,7 +256,7 @@ namespace paludis
/**
* Perform a hook. By default, delegates to environment.
*/
- virtual HookResult perform_hook(const Hook &)
+ virtual HookResult perform_hook(const Hook &, const std::shared_ptr<OutputManager> &)
PALUDIS_ATTRIBUTE((warn_unused_result));
/**
diff --git a/paludis/legacy/sync_task.cc b/paludis/legacy/sync_task.cc
index 8586f91..4900541 100644
--- a/paludis/legacy/sync_task.cc
+++ b/paludis/legacy/sync_task.cc
@@ -24,6 +24,7 @@
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/action_queue.hh>
#include <paludis/util/mutex.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/package_database.hh>
#include <paludis/hook.hh>
#include <paludis/create_output_manager_info.hh>
@@ -108,8 +109,8 @@ namespace
{
if (0 !=
env->perform_hook(Hook("sync_pre")("TARGET", stringify(r))
- ("X_OF_Y", stringify(x) + " of " + stringify(y) + " (" + stringify(a) + " active)")
- ).max_exit_status())
+ ("X_OF_Y", stringify(x) + " of " + stringify(y) + " (" + stringify(a) + " active)"),
+ make_null_shared_ptr()).max_exit_status())
throw SyncFailedError("Sync of '" + stringify(r) + "' aborted by hook");
{
@@ -139,8 +140,8 @@ namespace
if (0 !=
env->perform_hook(Hook("sync_post")("TARGET", stringify(r))
- ("X_OF_Y", stringify(x) + " of " + stringify(y) + " (" + stringify(a) + " active)")
- ).max_exit_status())
+ ("X_OF_Y", stringify(x) + " of " + stringify(y) + " (" + stringify(a) + " active)") ,
+ make_null_shared_ptr()).max_exit_status())
throw SyncFailedError("Sync of '" + stringify(r) + "' aborted by hook");
{
@@ -152,8 +153,8 @@ namespace
catch (const SyncFailedError & e)
{
HookResult PALUDIS_ATTRIBUTE((unused)) dummy(env->perform_hook(Hook("sync_fail")("TARGET", stringify(r))
- ("X_OF_Y", stringify(x) + " of " + stringify(y) + " (" + stringify(a) + " active)")
- ));
+ ("X_OF_Y", stringify(x) + " of " + stringify(y) + " (" + stringify(a) + " active)") ,
+ make_null_shared_ptr()));
Lock l(mutex);
task->on_sync_fail(r, e);
--a;
@@ -175,7 +176,8 @@ SyncTask::execute()
if (0 !=
_imp->env->perform_hook(Hook("sync_all_pre")("TARGETS", join(_imp->targets.begin(),
- _imp->targets.end(), " "))).max_exit_status())
+ _imp->targets.end(), " ")),
+ make_null_shared_ptr()).max_exit_status())
throw SyncFailedError("Sync aborted by hook");
on_sync_all_pre();
@@ -202,7 +204,8 @@ SyncTask::execute()
on_sync_all_post();
if (0 !=
_imp->env->perform_hook(Hook("sync_all_post")("TARGETS", join(_imp->targets.begin(),
- _imp->targets.end(), " "))).max_exit_status())
+ _imp->targets.end(), " ")),
+ make_null_shared_ptr()).max_exit_status())
throw SyncFailedError("Sync aborted by hook");
}
diff --git a/paludis/legacy/uninstall_task.cc b/paludis/legacy/uninstall_task.cc
index 57c16a0..5026aaa 100644
--- a/paludis/legacy/uninstall_task.cc
+++ b/paludis/legacy/uninstall_task.cc
@@ -355,7 +355,8 @@ UninstallTask::execute()
if (0 !=
_imp->env->perform_hook(Hook("uninstall_all_pre")("TARGETS", join(_imp->raw_targets.begin(),
- _imp->raw_targets.end(), " "))).max_exit_status())
+ _imp->raw_targets.end(), " ")),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Uninstall aborted by hook");
on_uninstall_all_pre();
@@ -374,7 +375,8 @@ UninstallTask::execute()
if (0 !=
_imp->env->perform_hook(Hook("uninstall_pre")("TARGET", cpvr)
- ("X_OF_Y", stringify(x) + " of " + stringify(y))).max_exit_status())
+ ("X_OF_Y", stringify(x) + " of " + stringify(y)),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Uninstall of '" + cpvr + "' aborted by hook");
on_uninstall_pre(*i);
@@ -397,21 +399,24 @@ UninstallTask::execute()
}
catch (const ActionFailedError & e)
{
- HookResult PALUDIS_ATTRIBUTE((unused)) dummy(_imp->env->perform_hook(Hook("uninstall_fail")("TARGET", cpvr)("MESSAGE", e.message())));
+ HookResult PALUDIS_ATTRIBUTE((unused)) dummy(_imp->env->perform_hook(Hook("uninstall_fail")("TARGET", cpvr)("MESSAGE", e.message()),
+ make_null_shared_ptr()));
throw;
}
on_uninstall_post(*i);
if (0 !=
_imp->env->perform_hook(Hook("uninstall_post")("TARGET", cpvr)
- ("X_OF_Y", stringify(x) + " of " + stringify(y))).max_exit_status())
+ ("X_OF_Y", stringify(x) + " of " + stringify(y)),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Uninstall of '" + cpvr + "' aborted by hook");
}
on_uninstall_all_post();
if (0 !=
_imp->env->perform_hook(Hook("uninstall_all_post")("TARGETS", join(_imp->raw_targets.begin(),
- _imp->raw_targets.end(), " "))).max_exit_status())
+ _imp->raw_targets.end(), " ")),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Uninstall aborted by hook");
}
diff --git a/paludis/merger.cc b/paludis/merger.cc
index 342daf9..88a2971 100644
--- a/paludis/merger.cc
+++ b/paludis/merger.cc
@@ -24,6 +24,7 @@
#include <paludis/util/log.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/selinux/security_context.hh>
#include <paludis/environment.hh>
#include <paludis/hook.hh>
@@ -82,7 +83,8 @@ Merger::check()
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_check_pre")
("INSTALL_SOURCE", stringify(_imp->params.image()))
- ("INSTALL_DESTINATION", stringify(_imp->params.root())))).max_exit_status())
+ ("INSTALL_DESTINATION", stringify(_imp->params.root()))),
+ make_null_shared_ptr()).max_exit_status())
make_check_fail();
do_dir_recursive(true, _imp->params.image(), _imp->params.root() / _imp->params.install_under());
@@ -90,7 +92,8 @@ Merger::check()
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_check_post")
("INSTALL_SOURCE", stringify(_imp->params.image()))
- ("INSTALL_DESTINATION", stringify(_imp->params.root())))).max_exit_status())
+ ("INSTALL_DESTINATION", stringify(_imp->params.root()))),
+ make_null_shared_ptr()).max_exit_status())
make_check_fail();
return _imp->result;
@@ -105,7 +108,8 @@ Merger::merge()
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_install_pre")
("INSTALL_SOURCE", stringify(_imp->params.image()))
- ("INSTALL_DESTINATION", stringify(_imp->params.root())))).max_exit_status())
+ ("INSTALL_DESTINATION", stringify(_imp->params.root()))),
+ make_null_shared_ptr()).max_exit_status())
Log::get_instance()->message("merger.pre_hooks.failure", ll_warning, lc_context) <<
"Merge of '" << _imp->params.image() << "' to '" << _imp->params.root() << "' pre hooks returned non-zero";
@@ -120,7 +124,8 @@ Merger::merge()
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_install_post")
("INSTALL_SOURCE", stringify(_imp->params.image()))
- ("INSTALL_DESTINATION", stringify(_imp->params.root())))).max_exit_status())
+ ("INSTALL_DESTINATION", stringify(_imp->params.root()))),
+ make_null_shared_ptr()).max_exit_status())
Log::get_instance()->message("merger.post_hooks.failure", ll_warning, lc_context) <<
"Merge of '" << _imp->params.image() << "' to '" << _imp->params.root() << "' post hooks returned non-zero";
}
@@ -233,7 +238,8 @@ Merger::on_file(bool is_check, const FSEntry & src, const FSEntry & dst)
0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_check_file_pre")
("INSTALL_SOURCE", stringify(src))
- ("INSTALL_DESTINATION", stringify(dst / src.basename())))).max_exit_status())
+ ("INSTALL_DESTINATION", stringify(dst / src.basename()))),
+ make_null_shared_ptr()).max_exit_status())
make_check_fail();
if (! is_check)
@@ -242,7 +248,8 @@ Merger::on_file(bool is_check, const FSEntry & src, const FSEntry & dst)
Hook("merger_install_file_override")
("INSTALL_SOURCE", stringify(src))
("INSTALL_DESTINATION", stringify(dst / src.basename()))
- .grab_output(Hook::AllowedOutputValues()("skip")))));
+ .grab_output(Hook::AllowedOutputValues()("skip"))),
+ make_null_shared_ptr()));
if (hr.max_exit_status() != 0)
Log::get_instance()->message("merger.file.skip_hooks.failure", ll_warning, lc_context) << "Merge of '"
@@ -264,7 +271,8 @@ Merger::on_file(bool is_check, const FSEntry & src, const FSEntry & dst)
0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_check_file_post")
("INSTALL_SOURCE", stringify(src))
- ("INSTALL_DESTINATION", stringify(dst / src.basename())))).max_exit_status())
+ ("INSTALL_DESTINATION", stringify(dst / src.basename()))),
+ make_null_shared_ptr()).max_exit_status())
make_check_fail();
}
@@ -277,7 +285,8 @@ Merger::on_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_check_dir_pre")
("INSTALL_SOURCE", stringify(src))
- ("INSTALL_DESTINATION", stringify(dst / src.basename())))).max_exit_status())
+ ("INSTALL_DESTINATION", stringify(dst / src.basename()))),
+ make_null_shared_ptr()).max_exit_status())
make_check_fail();
if (! is_check)
@@ -286,7 +295,8 @@ Merger::on_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
Hook("merger_install_dir_override")
("INSTALL_SOURCE", stringify(src))
("INSTALL_DESTINATION", stringify(dst / src.basename()))
- .grab_output(Hook::AllowedOutputValues()("skip")))));
+ .grab_output(Hook::AllowedOutputValues()("skip"))),
+ make_null_shared_ptr()));
if (hr.max_exit_status() != 0)
Log::get_instance()->message("merger.dir.skip_hooks.failure", ll_warning, lc_context) << "Merge of '"
@@ -306,7 +316,8 @@ Merger::on_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_check_dir_post")
("INSTALL_SOURCE", stringify(src))
- ("INSTALL_DESTINATION", stringify(dst / src.basename())))).max_exit_status())
+ ("INSTALL_DESTINATION", stringify(dst / src.basename()))),
+ make_null_shared_ptr()).max_exit_status())
make_check_fail();
}
@@ -319,7 +330,8 @@ Merger::on_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_check_sym_pre")
("INSTALL_SOURCE", stringify(src))
- ("INSTALL_DESTINATION", stringify(dst / src.basename())))).max_exit_status())
+ ("INSTALL_DESTINATION", stringify(dst / src.basename()))),
+ make_null_shared_ptr()).max_exit_status())
make_check_fail();
if (! is_check)
@@ -328,7 +340,8 @@ Merger::on_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
Hook("merger_install_sym_override")
("INSTALL_SOURCE", stringify(src))
("INSTALL_DESTINATION", stringify(dst / src.basename()))
- .grab_output(Hook::AllowedOutputValues()("skip")))));
+ .grab_output(Hook::AllowedOutputValues()("skip"))),
+ make_null_shared_ptr()));
if (hr.max_exit_status() != 0)
Log::get_instance()->message("merger.sym.skip_hooks.failure", ll_warning, lc_context) << "Merge of '"
@@ -356,7 +369,8 @@ Merger::on_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_check_sym_post")
("INSTALL_SOURCE", stringify(src))
- ("INSTALL_DESTINATION", stringify(dst / src.basename())))).max_exit_status())
+ ("INSTALL_DESTINATION", stringify(dst / src.basename()))),
+ make_null_shared_ptr()).max_exit_status())
make_check_fail();
}
diff --git a/paludis/python_hooks.cc b/paludis/python_hooks.cc
index 7daebaa..0f0cd1a 100644
--- a/paludis/python_hooks.cc
+++ b/paludis/python_hooks.cc
@@ -63,7 +63,7 @@ namespace
public:
PyHookFile(const FSEntry &, const bool, const Environment * const);
- virtual HookResult run(const Hook &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual HookResult run(const Hook &, const std::shared_ptr<OutputManager> &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const FSEntry file_name() const
{
@@ -151,7 +151,7 @@ PyHookFile::PyHookFile(const FSEntry & f, const bool r, const Environment * cons
}
HookResult
-PyHookFile::run(const Hook & hook) const
+PyHookFile::run(const Hook & hook, const std::shared_ptr<OutputManager> &) const
{
Context c("When running hook '" + stringify(file_name()) + "' for hook '" + hook.name() + "':");
diff --git a/paludis/repositories/accounts/accounts_repository.cc b/paludis/repositories/accounts/accounts_repository.cc
index ca4b2a7..b72072e 100644
--- a/paludis/repositories/accounts/accounts_repository.cc
+++ b/paludis/repositories/accounts/accounts_repository.cc
@@ -441,7 +441,9 @@ AccountsRepository::populate_sets() const
}
HookResult
-AccountsRepository::perform_hook(const Hook &)
+AccountsRepository::perform_hook(
+ const Hook &,
+ const std::shared_ptr<OutputManager> &)
{
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
diff --git a/paludis/repositories/accounts/accounts_repository.hh b/paludis/repositories/accounts/accounts_repository.hh
index 6fb8d18..a7c6a4e 100644
--- a/paludis/repositories/accounts/accounts_repository.hh
+++ b/paludis/repositories/accounts/accounts_repository.hh
@@ -142,7 +142,9 @@ namespace paludis
virtual void invalidate_masks();
virtual void regenerate_cache() const;
- virtual HookResult perform_hook(const Hook & hook);
+ virtual HookResult perform_hook(
+ const Hook & hook,
+ const std::shared_ptr<OutputManager> &);
virtual bool sync(const std::shared_ptr<OutputManager> &) const;
///\}
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index db8f5b4..0d2a764 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -585,7 +585,9 @@ CRANInstalledRepository::populate_sets() const
}
HookResult
-CRANInstalledRepository::perform_hook(const Hook &)
+CRANInstalledRepository::perform_hook(
+ const Hook &,
+ const std::shared_ptr<OutputManager> &)
{
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
diff --git a/paludis/repositories/cran/cran_installed_repository.hh b/paludis/repositories/cran/cran_installed_repository.hh
index 8c1a09c..74865ed 100644
--- a/paludis/repositories/cran/cran_installed_repository.hh
+++ b/paludis/repositories/cran/cran_installed_repository.hh
@@ -106,7 +106,9 @@ namespace paludis
virtual void invalidate();
virtual void invalidate_masks();
- virtual HookResult perform_hook(const Hook & hook);
+ virtual HookResult perform_hook(
+ const Hook & hook,
+ const std::shared_ptr<OutputManager> &);
/* RepositoryDestinationInterface */
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index 359a062..d73074b 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -563,7 +563,9 @@ CRANRepository::populate_sets() const
}
HookResult
-CRANRepository::perform_hook(const Hook &)
+CRANRepository::perform_hook(
+ const Hook &,
+ const std::shared_ptr<OutputManager> &)
{
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
diff --git a/paludis/repositories/cran/cran_repository.hh b/paludis/repositories/cran/cran_repository.hh
index 1a7ecc2..0355e56 100644
--- a/paludis/repositories/cran/cran_repository.hh
+++ b/paludis/repositories/cran/cran_repository.hh
@@ -168,7 +168,9 @@ namespace paludis
///\}
- virtual HookResult perform_hook(const Hook & hook);
+ virtual HookResult perform_hook(
+ const Hook & hook,
+ const std::shared_ptr<OutputManager> &);
};
/**
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index 5881861..3d37455 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -156,7 +156,7 @@ EInstalledRepository::want_pre_post_phases() const
}
HookResult
-EInstalledRepository::perform_hook(const Hook & hook)
+EInstalledRepository::perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> &)
{
Context context("When performing hook '" + stringify(hook.name()) + "' for repository '"
+ stringify(name()) + "':");
diff --git a/paludis/repositories/e/e_installed_repository.hh b/paludis/repositories/e/e_installed_repository.hh
index 7b3e27b..2950dec 100644
--- a/paludis/repositories/e/e_installed_repository.hh
+++ b/paludis/repositories/e/e_installed_repository.hh
@@ -83,7 +83,9 @@ namespace paludis
virtual bool some_ids_might_not_be_masked() const;
- HookResult perform_hook(const Hook & hook)
+ HookResult perform_hook(
+ const Hook & hook,
+ const std::shared_ptr<OutputManager> &)
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool sync(const std::shared_ptr<OutputManager> &) const;
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 8c700d7..1fd924c 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -990,7 +990,7 @@ ERepository::want_pre_post_phases() const
}
HookResult
-ERepository::perform_hook(const Hook & hook)
+ERepository::perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> &)
{
Context context("When performing hook '" + stringify(hook.name()) + "' for repository '"
+ stringify(name()) + "':");
diff --git a/paludis/repositories/e/e_repository.hh b/paludis/repositories/e/e_repository.hh
index e2345c9..e8b4b7c 100644
--- a/paludis/repositories/e/e_repository.hh
+++ b/paludis/repositories/e/e_repository.hh
@@ -149,7 +149,7 @@ namespace paludis
std::string profile_variable(const std::string &) const;
std::string environment_updated_profile_variable(const std::string &) const;
- HookResult perform_hook(const Hook &)
+ HookResult perform_hook(const Hook &, const std::shared_ptr<OutputManager> &)
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names() const;
diff --git a/paludis/repositories/fake/fake_repository_base.cc b/paludis/repositories/fake/fake_repository_base.cc
index 513b2a9..378dc5e 100644
--- a/paludis/repositories/fake/fake_repository_base.cc
+++ b/paludis/repositories/fake/fake_repository_base.cc
@@ -203,7 +203,7 @@ FakeRepositoryBase::populate_sets() const
}
HookResult
-FakeRepositoryBase::perform_hook(const Hook &)
+FakeRepositoryBase::perform_hook(const Hook &, const std::shared_ptr<OutputManager> &)
{
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
diff --git a/paludis/repositories/fake/fake_repository_base.hh b/paludis/repositories/fake/fake_repository_base.hh
index 83bd07b..ed6c0c3 100644
--- a/paludis/repositories/fake/fake_repository_base.hh
+++ b/paludis/repositories/fake/fake_repository_base.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* 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
@@ -126,7 +126,7 @@ namespace paludis
///\}
- virtual HookResult perform_hook(const Hook & hook);
+ virtual HookResult perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> &);
};
}
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index 86e3fdc..88fd606 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -414,7 +414,7 @@ GemsRepository::populate_sets() const
}
HookResult
-GemsRepository::perform_hook(const Hook &)
+GemsRepository::perform_hook(const Hook &, const std::shared_ptr<OutputManager> &)
{
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
diff --git a/paludis/repositories/gems/gems_repository.hh b/paludis/repositories/gems/gems_repository.hh
index d9e0152..41b254d 100644
--- a/paludis/repositories/gems/gems_repository.hh
+++ b/paludis/repositories/gems/gems_repository.hh
@@ -122,7 +122,7 @@ namespace paludis
///\}
- virtual HookResult perform_hook(const Hook & hook);
+ virtual HookResult perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> &);
};
}
diff --git a/paludis/repositories/gems/installed_gems_repository.cc b/paludis/repositories/gems/installed_gems_repository.cc
index d7e8981..e2e6331 100644
--- a/paludis/repositories/gems/installed_gems_repository.cc
+++ b/paludis/repositories/gems/installed_gems_repository.cc
@@ -432,7 +432,7 @@ InstalledGemsRepository::populate_sets() const
}
HookResult
-InstalledGemsRepository::perform_hook(const Hook &)
+InstalledGemsRepository::perform_hook(const Hook &, const std::shared_ptr<OutputManager> &)
{
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
diff --git a/paludis/repositories/gems/installed_gems_repository.hh b/paludis/repositories/gems/installed_gems_repository.hh
index cd7bdce..838ae38 100644
--- a/paludis/repositories/gems/installed_gems_repository.hh
+++ b/paludis/repositories/gems/installed_gems_repository.hh
@@ -137,7 +137,7 @@ namespace paludis
///\}
- virtual HookResult perform_hook(const Hook & hook)
+ virtual HookResult perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> &)
PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/repositories/repository/repository_repository.cc b/paludis/repositories/repository/repository_repository.cc
index 389084b..57f7a00 100644
--- a/paludis/repositories/repository/repository_repository.cc
+++ b/paludis/repositories/repository/repository_repository.cc
@@ -326,7 +326,7 @@ RepositoryRepository::populate_sets() const
}
HookResult
-RepositoryRepository::perform_hook(const Hook &)
+RepositoryRepository::perform_hook(const Hook &, const std::shared_ptr<OutputManager> &)
{
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
diff --git a/paludis/repositories/repository/repository_repository.hh b/paludis/repositories/repository/repository_repository.hh
index c86ac15..f078eb9 100644
--- a/paludis/repositories/repository/repository_repository.hh
+++ b/paludis/repositories/repository/repository_repository.hh
@@ -134,7 +134,7 @@ namespace paludis
///\}
- virtual HookResult perform_hook(const Hook & hook);
+ virtual HookResult perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> &);
};
}
diff --git a/paludis/repositories/unavailable/unavailable_repository.cc b/paludis/repositories/unavailable/unavailable_repository.cc
index cd3d3b4..38bf698 100644
--- a/paludis/repositories/unavailable/unavailable_repository.cc
+++ b/paludis/repositories/unavailable/unavailable_repository.cc
@@ -358,7 +358,7 @@ UnavailableRepository::populate_sets() const
}
HookResult
-UnavailableRepository::perform_hook(const Hook &)
+UnavailableRepository::perform_hook(const Hook &, const std::shared_ptr<OutputManager> &)
{
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
diff --git a/paludis/repositories/unavailable/unavailable_repository.hh b/paludis/repositories/unavailable/unavailable_repository.hh
index c206358..d4bdb8b 100644
--- a/paludis/repositories/unavailable/unavailable_repository.hh
+++ b/paludis/repositories/unavailable/unavailable_repository.hh
@@ -122,7 +122,7 @@ namespace paludis
///\}
- virtual HookResult perform_hook(const Hook & hook);
+ virtual HookResult perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> &);
};
}
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 5767fff..57ae138 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -496,7 +496,7 @@ InstalledUnpackagedRepository::populate_sets() const
}
HookResult
-InstalledUnpackagedRepository::perform_hook(const Hook &)
+InstalledUnpackagedRepository::perform_hook(const Hook &, const std::shared_ptr<OutputManager> &)
{
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
diff --git a/paludis/repositories/unpackaged/installed_repository.hh b/paludis/repositories/unpackaged/installed_repository.hh
index fbc1d1a..5b50c81 100644
--- a/paludis/repositories/unpackaged/installed_repository.hh
+++ b/paludis/repositories/unpackaged/installed_repository.hh
@@ -138,7 +138,7 @@ namespace paludis
///\}
- virtual HookResult perform_hook(const Hook & hook)
+ virtual HookResult perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> &)
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool sync(const std::shared_ptr<OutputManager> &) const;
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.cc b/paludis/repositories/unpackaged/unpackaged_repository.cc
index 26d9259..b119416 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository.cc
@@ -301,7 +301,7 @@ UnpackagedRepository::populate_sets() const
}
HookResult
-UnpackagedRepository::perform_hook(const Hook &)
+UnpackagedRepository::perform_hook(const Hook &, const std::shared_ptr<OutputManager> &)
{
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.hh b/paludis/repositories/unpackaged/unpackaged_repository.hh
index 718afa2..c619b2e 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.hh
+++ b/paludis/repositories/unpackaged/unpackaged_repository.hh
@@ -143,7 +143,7 @@ namespace paludis
///\}
- virtual HookResult perform_hook(const Hook & hook)
+ virtual HookResult perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> &)
PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/repositories/unwritten/unwritten_repository.cc b/paludis/repositories/unwritten/unwritten_repository.cc
index c7bfef0..19b8055 100644
--- a/paludis/repositories/unwritten/unwritten_repository.cc
+++ b/paludis/repositories/unwritten/unwritten_repository.cc
@@ -358,7 +358,7 @@ UnwrittenRepository::populate_sets() const
}
HookResult
-UnwrittenRepository::perform_hook(const Hook &)
+UnwrittenRepository::perform_hook(const Hook &, const std::shared_ptr<OutputManager> &)
{
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
diff --git a/paludis/repositories/unwritten/unwritten_repository.hh b/paludis/repositories/unwritten/unwritten_repository.hh
index 31a22e3..edd58b6 100644
--- a/paludis/repositories/unwritten/unwritten_repository.hh
+++ b/paludis/repositories/unwritten/unwritten_repository.hh
@@ -121,7 +121,7 @@ namespace paludis
///\}
- virtual HookResult perform_hook(const Hook & hook);
+ virtual HookResult perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> &);
};
}
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 59452c0..b5f3c86 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -231,7 +231,7 @@ InstalledVirtualsRepository::invalidate_masks()
}
HookResult
-InstalledVirtualsRepository::perform_hook(const Hook & hook)
+InstalledVirtualsRepository::perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> &)
{
Context context("When performing hook '" + stringify(hook.name()) + "' for repository '"
+ stringify(name()) + "':");
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.hh b/paludis/repositories/virtuals/installed_virtuals_repository.hh
index a3ad32f..0e162f0 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.hh
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.hh
@@ -84,7 +84,7 @@ namespace paludis
virtual const bool is_unimportant() const;
- HookResult perform_hook(const Hook &)
+ HookResult perform_hook(const Hook &, const std::shared_ptr<OutputManager> &)
PALUDIS_ATTRIBUTE((warn_unused_result));
/* Repository */
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index e93014e..9760965 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -466,7 +466,7 @@ VirtualsRepository::populate_sets() const
}
HookResult
-VirtualsRepository::perform_hook(const Hook &)
+VirtualsRepository::perform_hook(const Hook &, const std::shared_ptr<OutputManager> &)
{
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
diff --git a/paludis/repositories/virtuals/virtuals_repository.hh b/paludis/repositories/virtuals/virtuals_repository.hh
index fed3c2e..e93c783 100644
--- a/paludis/repositories/virtuals/virtuals_repository.hh
+++ b/paludis/repositories/virtuals/virtuals_repository.hh
@@ -130,7 +130,7 @@ namespace paludis
///\}
- virtual HookResult perform_hook(const Hook & hook)
+ virtual HookResult perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> &)
PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/repository.hh b/paludis/repository.hh
index e5ade90..efc4922 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -425,8 +425,11 @@ namespace paludis
* Perform a hook.
*
* \since 0.40 (previously in an interface)
+ * \since 0.53 takes optional_output_manager
*/
- virtual HookResult perform_hook(const Hook & hook)
+ virtual HookResult perform_hook(
+ const Hook & hook,
+ const std::shared_ptr<OutputManager> & optional_output_manager)
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
diff --git a/paludis/unmerger.cc b/paludis/unmerger.cc
index 511674e..1a82a30 100644
--- a/paludis/unmerger.cc
+++ b/paludis/unmerger.cc
@@ -18,10 +18,11 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "unmerger.hh"
+#include <paludis/unmerger.hh>
#include <paludis/environment.hh>
#include <paludis/hook.hh>
#include <paludis/util/pimp-impl.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/contents.hh>
#include <paludis/metadata_key.hh>
#include <sys/types.h>
@@ -78,7 +79,8 @@ Unmerger::unmerge()
if (0 != _imp->options.environment()->perform_hook(extend_hook(
Hook("unmerger_unlink_pre")
- ("UNLINK_TARGET", stringify(_imp->options.root())))).max_exit_status())
+ ("UNLINK_TARGET", stringify(_imp->options.root()))),
+ make_null_shared_ptr()).max_exit_status())
throw UnmergerError("Unmerge from '" + stringify(_imp->options.root()) + "' aborted by hook");
for (UnmergeEntriesIterator i(_imp->unmerge_entries.rbegin()), i_end(_imp->unmerge_entries.rend()) ; i != i_end ; ++i)
@@ -112,7 +114,8 @@ Unmerger::unmerge()
if (0 != _imp->options.environment()->perform_hook(extend_hook(
Hook("unmerger_unlink_post")
- ("UNLINK_TARGET", stringify(_imp->options.root())))).max_exit_status())
+ ("UNLINK_TARGET", stringify(_imp->options.root()))),
+ make_null_shared_ptr()).max_exit_status())
throw UnmergerError("Unmerge from '" + stringify(_imp->options.root()) + "' aborted by hook");
}
@@ -124,7 +127,8 @@ Unmerger::unmerge_file(const std::shared_ptr<const ContentsEntry> & e) const
HookResult hr(_imp->options.environment()->perform_hook(extend_hook(
Hook("unmerger_unlink_file_override")
("UNLINK_TARGET", stringify(f_real))
- .grab_output(Hook::AllowedOutputValues()("skip")("force")))));
+ .grab_output(Hook::AllowedOutputValues()("skip")("force"))),
+ make_null_shared_ptr()));
if (hr.max_exit_status() != 0)
throw UnmergerError("Unmerge of '" + stringify(e->location_key()->value()) + "' aborted by hook");
@@ -152,7 +156,8 @@ Unmerger::unmerge_sym(const std::shared_ptr<const ContentsEntry> & e) const
HookResult hr(_imp->options.environment()->perform_hook(extend_hook(
Hook("unmerger_unlink_sym_override")
("UNLINK_TARGET", stringify(f_real))
- .grab_output(Hook::AllowedOutputValues()("skip")("force")))));
+ .grab_output(Hook::AllowedOutputValues()("skip")("force"))),
+ make_null_shared_ptr()));
if (hr.max_exit_status() != 0)
throw UnmergerError("Unmerge of '" + stringify(e->location_key()->value()) + "' aborted by hook");
@@ -180,7 +185,8 @@ Unmerger::unmerge_dir(const std::shared_ptr<const ContentsEntry> & e) const
HookResult hr(_imp->options.environment()->perform_hook(extend_hook(
Hook("unmerger_unlink_dir_override")
("UNLINK_TARGET", stringify(f_real))
- .grab_output(Hook::AllowedOutputValues()("skip")))));
+ .grab_output(Hook::AllowedOutputValues()("skip"))),
+ make_null_shared_ptr()));
if (hr.max_exit_status() != 0)
throw UnmergerError("Unmerge of '" + stringify(e->location_key()->value()) + "' aborted by hook");
@@ -203,7 +209,8 @@ Unmerger::unmerge_misc(const std::shared_ptr<const ContentsEntry> & e) const
HookResult hr(_imp->options.environment()->perform_hook(extend_hook(
Hook("unmerger_unlink_misc_override")
("UNLINK_TARGET", stringify(f_real))
- .grab_output(Hook::AllowedOutputValues()("skip")("force")))));
+ .grab_output(Hook::AllowedOutputValues()("skip")("force"))),
+ make_null_shared_ptr()));
if (hr.max_exit_status() != 0)
throw UnmergerError("Unmerge of '" + stringify(e->location_key()->value()) + "' aborted by hook");
@@ -228,7 +235,8 @@ Unmerger::unlink_file(FSEntry f, const std::shared_ptr<const ContentsEntry> & e)
{
if (0 != _imp->options.environment()->perform_hook(extend_hook(
Hook("unmerger_unlink_file_pre")
- ("UNLINK_TARGET", stringify(e->location_key()->value())))).max_exit_status())
+ ("UNLINK_TARGET", stringify(e->location_key()->value()))),
+ make_null_shared_ptr()).max_exit_status())
throw UnmergerError("Unmerge of '" + stringify(e->location_key()->value()) + "' aborted by hook");
if (f.is_regular_file())
@@ -245,7 +253,8 @@ Unmerger::unlink_file(FSEntry f, const std::shared_ptr<const ContentsEntry> & e)
if (0 != _imp->options.environment()->perform_hook(extend_hook(
Hook("unmerger_unlink_file_post")
- ("UNLINK_TARGET", stringify(e->location_key()->value())))).max_exit_status())
+ ("UNLINK_TARGET", stringify(e->location_key()->value()))),
+ make_null_shared_ptr()).max_exit_status())
throw UnmergerError("Unmerge of '" + stringify(e->location_key()->value()) + "' aborted by hook");
}
@@ -254,14 +263,16 @@ Unmerger::unlink_sym(FSEntry f, const std::shared_ptr<const ContentsEntry> & e)
{
if (0 != _imp->options.environment()->perform_hook(extend_hook(
Hook("unmerger_unlink_sym_pre")
- ("UNLINK_TARGET", stringify(e->location_key()->value())))).max_exit_status())
+ ("UNLINK_TARGET", stringify(e->location_key()->value()))),
+ make_null_shared_ptr()).max_exit_status())
throw UnmergerError("Unmerge of '" + stringify(e->location_key()->value()) + "' aborted by hook");
f.unlink();
if (0 != _imp->options.environment()->perform_hook(extend_hook(
Hook("unmerger_unlink_sym_post")
- ("UNLINK_TARGET", stringify(e->location_key()->value())))).max_exit_status())
+ ("UNLINK_TARGET", stringify(e->location_key()->value()))),
+ make_null_shared_ptr()).max_exit_status())
throw UnmergerError("Unmerge of '" + stringify(e->location_key()->value()) + "' aborted by hook");
}
@@ -270,14 +281,16 @@ Unmerger::unlink_dir(FSEntry f, const std::shared_ptr<const ContentsEntry> & e)
{
if (0 != _imp->options.environment()->perform_hook(extend_hook(
Hook("unmerger_unlink_dir_pre")
- ("UNLINK_TARGET", stringify(e->location_key()->value())))).max_exit_status())
+ ("UNLINK_TARGET", stringify(e->location_key()->value()))),
+ make_null_shared_ptr()).max_exit_status())
throw UnmergerError("Unmerge of '" + stringify(e->location_key()->value()) + "' aborted by hook");
f.rmdir();
if (0 != _imp->options.environment()->perform_hook(extend_hook(
Hook("unmerger_unlink_dir_post")
- ("UNLINK_TARGET", stringify(e->location_key()->value())))).max_exit_status())
+ ("UNLINK_TARGET", stringify(e->location_key()->value()))),
+ make_null_shared_ptr()).max_exit_status())
throw UnmergerError("Unmerge of '" + stringify(e->location_key()->value()) + "' aborted by hook");
}
@@ -286,14 +299,16 @@ Unmerger::unlink_misc(FSEntry f, const std::shared_ptr<const ContentsEntry> & e)
{
if (0 != _imp->options.environment()->perform_hook(extend_hook(
Hook("unmerger_unlink_misc_pre")
- ("UNLINK_TARGET", stringify(e->location_key()->value())))).max_exit_status())
+ ("UNLINK_TARGET", stringify(e->location_key()->value()))),
+ make_null_shared_ptr()).max_exit_status())
throw UnmergerError("Unmerge of '" + stringify(e->location_key()->value()) + "' aborted by hook");
f.unlink();
if (0 != _imp->options.environment()->perform_hook(extend_hook(
Hook("unmerger_unlink_misc_post")
- ("UNLINK_TARGET", stringify(e->location_key()->value())))).max_exit_status())
+ ("UNLINK_TARGET", stringify(e->location_key()->value()))),
+ make_null_shared_ptr()).max_exit_status())
throw UnmergerError("Unmerge of '" + stringify(e->location_key()->value()) + "' aborted by hook");
}
diff --git a/python/additional_tests.cc b/python/additional_tests.cc
index 3087319..cd9d774 100644
--- a/python/additional_tests.cc
+++ b/python/additional_tests.cc
@@ -25,6 +25,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/environment.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/package_database.hh>
@@ -93,7 +94,7 @@ namespace environment
e.default_destinations();
- e.perform_hook(Hook("test"));
+ e.perform_hook(Hook("test"), make_null_shared_ptr());
e.distribution();
diff --git a/python/environment.cc b/python/environment.cc
index b4d0913..f8030a0 100644
--- a/python/environment.cc
+++ b/python/environment.cc
@@ -302,7 +302,7 @@ class EnvironmentImplementationWrapper :
}
// FIXME - Hooks are not exposed
- virtual HookResult perform_hook(const Hook & h) const
+ virtual HookResult perform_hook(const Hook & h, const std::shared_ptr<OutputManager> &) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index 7ca0a27..cd8eadb 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -673,8 +673,8 @@ namespace
int x(0), y(lists->pretend_job_list()->length()), prev_x(0);
if (0 != env->perform_hook(Hook("pretend_all_pre")
- ("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " "))
- ).max_exit_status())
+ ("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " ")),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Aborted by hook");
for (JobList<PretendJob>::ConstIterator c(lists->pretend_job_list()->begin()),
@@ -693,8 +693,8 @@ namespace
cout << endl;
if (0 != env->perform_hook(Hook("pretend_all_post")
- ("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " "))
- ).max_exit_status())
+ ("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " ")),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Aborted by hook");
return failed ? 1 : 0;
@@ -1428,8 +1428,8 @@ namespace
(*c)->accept(counts);
if (0 != env->perform_hook(Hook("install_all_pre")
- ("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " "))
- ).max_exit_status())
+ ("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " ")),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Aborted by hook");
JobRequirementIf require_if(last_jri);
@@ -1458,8 +1458,8 @@ namespace
executor.execute();
if (0 != env->perform_hook(Hook("install_all_post")
- ("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " "))
- ).max_exit_status())
+ ("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " ")),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Aborted by hook");
return retcode;
@@ -1640,8 +1640,8 @@ namespace
int retcode(0);
if (0 != env->perform_hook(Hook("install_task_execute_pre")
- ("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " "))
- ).max_exit_status())
+ ("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " ")),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Aborted by hook");
try
@@ -1659,8 +1659,8 @@ namespace
if (0 != env->perform_hook(Hook("install_task_execute_post")
("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " "))
("PRETEND", stringify(cmdline.a_pretend.specified()))
- ("SUCCESS", stringify(false))
- ).max_exit_status())
+ ("SUCCESS", stringify(false)),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Aborted by hook");
throw;
}
@@ -1674,8 +1674,8 @@ namespace
if (0 != env->perform_hook(Hook("install_task_execute_post")
("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " "))
("PRETEND", stringify(cmdline.a_pretend.specified()))
- ("SUCCESS", stringify(true))
- ).max_exit_status())
+ ("SUCCESS", stringify(true)),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Aborted by hook");
return retcode;
diff --git a/src/clients/cave/cmd_perform.cc b/src/clients/cave/cmd_perform.cc
index 89b3d12..e6fa7a6 100644
--- a/src/clients/cave/cmd_perform.cc
+++ b/src/clients/cave/cmd_perform.cc
@@ -244,8 +244,8 @@ namespace
if (cmdline.a_hooks.specified())
if (0 != env->perform_hook(Hook(action_name + "_pre")
("TARGET", stringify(*id))
- ("X_OF_Y", cmdline.a_x_of_y.argument())
- ).max_exit_status())
+ ("X_OF_Y", cmdline.a_x_of_y.argument()),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Aborted by hook");
try
@@ -259,8 +259,8 @@ namespace
HookResult PALUDIS_ATTRIBUTE((unused)) dummy(env->perform_hook(Hook(action_name + "_fail")
("TARGET", stringify(*id))
("MESSAGE", e.message())
- ("X_OF_Y", cmdline.a_x_of_y.argument())
- ));
+ ("X_OF_Y", cmdline.a_x_of_y.argument()),
+ make_null_shared_ptr()));
}
throw;
@@ -269,8 +269,8 @@ namespace
if (cmdline.a_hooks.specified())
if (0 != env->perform_hook(Hook(action_name + "_post")
("TARGET", stringify(*id))
- ("X_OF_Y", cmdline.a_x_of_y.argument())
- ).max_exit_status())
+ ("X_OF_Y", cmdline.a_x_of_y.argument()),
+ make_null_shared_ptr()).max_exit_status())
throw ActionAbortedError("Aborted by hook");
if (cmdline.a_x_of_y.specified() && ! cmdline.a_no_terminal_titles.specified())
diff --git a/src/clients/cave/cmd_sync.cc b/src/clients/cave/cmd_sync.cc
index 2653a67..15d75f0 100644
--- a/src/clients/cave/cmd_sync.cc
+++ b/src/clients/cave/cmd_sync.cc
@@ -31,6 +31,7 @@
#include <paludis/util/return_literal_function.hh>
#include <paludis/util/executor.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/output_manager.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/repository.hh>
@@ -156,8 +157,8 @@ namespace
("TARGET", stringify(name))
("NUMBER_DONE", stringify(executor->done()))
("NUMBER_ACTIVE", stringify(executor->active()))
- ("NUMBER_PENDING", stringify(executor->pending()))
- ).max_exit_status())
+ ("NUMBER_PENDING", stringify(executor->pending())),
+ make_null_shared_ptr()).max_exit_status())
throw SyncFailedError("Sync aborted by hook");
const std::shared_ptr<Repository> repo(env->package_database()->fetch_repository(name));
@@ -258,8 +259,8 @@ namespace
("TARGET", stringify(name))
("NUMBER_DONE", stringify(executor->done()))
("NUMBER_ACTIVE", stringify(executor->active()))
- ("NUMBER_PENDING", stringify(executor->pending()))
- ).max_exit_status())
+ ("NUMBER_PENDING", stringify(executor->pending())),
+ make_null_shared_ptr()).max_exit_status())
throw SyncFailedError("Sync aborted by hook");
}
@@ -385,8 +386,8 @@ SyncCommand::run(
cout << format_general_s(f::sync_heading(), "Starting sync");
if (0 != env->perform_hook(Hook("sync_all_pre")
- ("TARGETS", join(repos.begin(), repos.end(), " ")
- )).max_exit_status())
+ ("TARGETS", join(repos.begin(), repos.end(), " ")),
+ make_null_shared_ptr()).max_exit_status())
throw SyncFailedError("Sync aborted by hook");
cout << format_general_s(f::sync_repos_title(), "");
@@ -401,8 +402,8 @@ SyncCommand::run(
}
if (0 != env->perform_hook(Hook("sync_all_post")
- ("TARGETS", join(repos.begin(), repos.end(), " ")
- )).max_exit_status())
+ ("TARGETS", join(repos.begin(), repos.end(), " ")),
+ make_null_shared_ptr()).max_exit_status())
throw SyncFailedError("Sync aborted by hook");
return retcode;
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index dc860cc..ec5f227 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -1971,12 +1971,12 @@ ConsoleInstallTask::on_installed_paludis()
}
HookResult
-ConsoleInstallTask::perform_hook(const Hook & hook)
+ConsoleInstallTask::perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> & optional_output_manager)
{
std::string resume_command(make_resume_command(true));
if (resume_command.empty())
- return InstallTask::perform_hook(hook);
- return InstallTask::perform_hook(hook("RESUME_COMMAND", resume_command));
+ return InstallTask::perform_hook(hook, optional_output_manager);
+ return InstallTask::perform_hook(hook("RESUME_COMMAND", resume_command), optional_output_manager);
}
void
diff --git a/src/output/console_install_task.hh b/src/output/console_install_task.hh
index 09591e6..81ba943 100644
--- a/src/output/console_install_task.hh
+++ b/src/output/console_install_task.hh
@@ -250,7 +250,7 @@ namespace paludis
void show_resume_command(const std::string &) const;
virtual std::string make_resume_command(const bool undo_failures) const = 0;
virtual void on_installed_paludis();
- virtual HookResult perform_hook(const Hook &);
+ virtual HookResult perform_hook(const Hook &, const std::shared_ptr<OutputManager> &);
///\}