aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-11 18:18:46 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-11 18:19:05 +0000
commitcce405d54052fa56220320997aa2d560fa0b0932 (patch)
tree55ef6449cfe4e474ee669de13b432a4f1aebeaec
parent9e7b0aeb4d1e185a2e88f3af1c6ac178cd6b9021 (diff)
downloadpaludis-cce405d54052fa56220320997aa2d560fa0b0932.tar.gz
paludis-cce405d54052fa56220320997aa2d560fa0b0932.tar.xz
Use out of band messages
-rw-r--r--paludis/action-fwd.hh3
-rw-r--r--paludis/action.cc61
-rw-r--r--paludis/action.hh104
-rw-r--r--paludis/install_task.cc6
-rw-r--r--paludis/repositories/e/e_installed_repository.cc14
-rw-r--r--paludis/repositories/e/e_installed_repository.hh19
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc12
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc5
-rw-r--r--paludis/repositories/e/e_repository_entries.hh3
-rw-r--r--paludis/repositories/e/ebuild.cc19
-rw-r--r--paludis/repositories/e/ebuild.hh6
-rw-r--r--paludis/repositories/e/ebuild_entries.cc20
-rw-r--r--paludis/repositories/e/ebuild_entries.hh3
-rw-r--r--paludis/repositories/e/ebuild_id.cc5
-rw-r--r--paludis/repositories/e/exndbam_repository.cc33
-rw-r--r--paludis/repositories/e/exndbam_repository.hh7
-rw-r--r--paludis/repositories/e/pipe_command_handler.cc34
-rw-r--r--paludis/repositories/e/pipe_command_handler.hh6
-rw-r--r--paludis/repositories/e/vdb_repository.cc35
-rw-r--r--paludis/repositories/e/vdb_repository.hh7
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc24
-rw-r--r--paludis/util/echo_functions.bash.in7
-rw-r--r--paludis/util/output_manager.hh3
-rw-r--r--src/clients/paludis/do_config.cc18
-rw-r--r--src/clients/paludis/info.cc15
25 files changed, 401 insertions, 68 deletions
diff --git a/paludis/action-fwd.hh b/paludis/action-fwd.hh
index 2881e3d..127d785 100644
--- a/paludis/action-fwd.hh
+++ b/paludis/action-fwd.hh
@@ -56,6 +56,9 @@ namespace paludis
struct FetchActionOptions;
struct InstallActionOptions;
struct UninstallActionOptions;
+ struct InfoActionOptions;
+ struct ConfigActionOptions;
+ struct PretendActionOptions;
struct FetchActionFailure;
diff --git a/paludis/action.cc b/paludis/action.cc
index 7fa330c..92a8e3c 100644
--- a/paludis/action.cc
+++ b/paludis/action.cc
@@ -111,16 +111,19 @@ namespace paludis
struct Implementation<PretendAction>
{
bool failed;
+ const PretendActionOptions options;
- Implementation() :
- failed(false)
+ Implementation(const PretendActionOptions & o) :
+ failed(false),
+ options(o)
{
}
};
}
-PretendAction::PretendAction() :
- PrivateImplementationPattern<PretendAction>(new Implementation<PretendAction>)
+PretendAction::PretendAction(const PretendActionOptions & o) :
+ PrivateImplementationPattern<PretendAction>(new Implementation<PretendAction>(o)),
+ options(_imp->options)
{
}
@@ -164,6 +167,54 @@ PretendFetchAction::~PretendFetchAction()
{
}
+namespace paludis
+{
+ template <>
+ struct Implementation<InfoAction>
+ {
+ const InfoActionOptions options;
+
+ Implementation(const InfoActionOptions & o) :
+ options(o)
+ {
+ }
+ };
+}
+
+InfoAction::InfoAction(const InfoActionOptions & o) :
+ PrivateImplementationPattern<InfoAction>(new Implementation<InfoAction>(o)),
+ options(_imp->options)
+{
+}
+
+InfoAction::~InfoAction()
+{
+}
+
+namespace paludis
+{
+ template <>
+ struct Implementation<ConfigAction>
+ {
+ const ConfigActionOptions options;
+
+ Implementation(const ConfigActionOptions & o) :
+ options(o)
+ {
+ }
+ };
+}
+
+ConfigAction::ConfigAction(const ConfigActionOptions & o) :
+ PrivateImplementationPattern<ConfigAction>(new Implementation<ConfigAction>(o)),
+ options(_imp->options)
+{
+}
+
+ConfigAction::~ConfigAction()
+{
+}
+
SupportsActionTestBase::~SupportsActionTestBase()
{
}
@@ -283,6 +334,8 @@ template class PrivateImplementationPattern<InstallAction>;
template class PrivateImplementationPattern<PretendAction>;
template class PrivateImplementationPattern<PretendFetchAction>;
template class PrivateImplementationPattern<UninstallAction>;
+template class PrivateImplementationPattern<InfoAction>;
+template class PrivateImplementationPattern<ConfigAction>;
template class Sequence<FetchActionFailure>;
template class WrappedForwardIterator<Sequence<FetchActionFailure>::ConstIteratorTag, const FetchActionFailure>;
diff --git a/paludis/action.hh b/paludis/action.hh
index f79acca..c638920 100644
--- a/paludis/action.hh
+++ b/paludis/action.hh
@@ -266,6 +266,25 @@ namespace paludis
};
/**
+ * Options for a PretendAction.
+ *
+ * \see PretendAction
+ * \ingroup g_actions
+ * \since 0.36
+ */
+ struct PretendActionOptions
+ {
+ /**
+ * This is a function to avoid chicken / egg problems when using
+ * Environment::create_output_manager.
+ *
+ * \since 0.36
+ */
+ NamedValue<n::make_output_manager, std::tr1::function<std::tr1::shared_ptr<OutputManager> (
+ const PretendAction &)> > make_output_manager;
+ };
+
+ /**
* A PretendAction is used by InstallTask to handle install-pretend-phase
* checks on a PackageID.
*
@@ -282,7 +301,10 @@ namespace paludis
///\name Basic operations
///\{
- PretendAction();
+ /**
+ * \since 0.36
+ */
+ PretendAction(const PretendActionOptions &);
~PretendAction();
///\}
@@ -292,6 +314,11 @@ namespace paludis
/// Mark the action as failed.
void set_failed();
+
+ /**
+ * \since 0.36
+ */
+ const PretendActionOptions & options;
};
/**
@@ -324,6 +351,25 @@ namespace paludis
};
/**
+ * Options for a ConfigAction.
+ *
+ * \see ConfigAction
+ * \ingroup g_actions
+ * \since 0.36
+ */
+ struct ConfigActionOptions
+ {
+ /**
+ * This is a function to avoid chicken / egg problems when using
+ * Environment::create_output_manager.
+ *
+ * \since 0.36
+ */
+ NamedValue<n::make_output_manager, std::tr1::function<std::tr1::shared_ptr<OutputManager> (
+ const ConfigAction &)> > make_output_manager;
+ };
+
+ /**
* A ConfigAction is used via PackageID::perform_action to execute
* post-install configuration (for example, via 'paludis --config')
* on a PackageID.
@@ -334,8 +380,44 @@ namespace paludis
*/
class PALUDIS_VISIBLE ConfigAction :
public Action,
+ private PrivateImplementationPattern<ConfigAction>,
public ImplementAcceptMethods<Action, ConfigAction>
{
+ public:
+ ///\name Basic operations
+ ///\{
+
+ /**
+ * \since 0.36
+ */
+ ConfigAction(const ConfigActionOptions &);
+ ~ConfigAction();
+
+ ///\}
+
+ /**
+ * \since 0.36
+ */
+ const ConfigActionOptions & options;
+ };
+
+ /**
+ * Options for an InfoAction.
+ *
+ * \see InfoAction
+ * \ingroup g_actions
+ * \since 0.36
+ */
+ struct InfoActionOptions
+ {
+ /**
+ * This is a function to avoid chicken / egg problems when using
+ * Environment::create_output_manager.
+ *
+ * \since 0.36
+ */
+ NamedValue<n::make_output_manager, std::tr1::function<std::tr1::shared_ptr<OutputManager> (
+ const InfoAction &)> > make_output_manager;
};
/**
@@ -353,8 +435,26 @@ namespace paludis
*/
class PALUDIS_VISIBLE InfoAction:
public Action,
+ private PrivateImplementationPattern<InfoAction>,
public ImplementAcceptMethods<Action, InfoAction>
{
+ public:
+ ///\name Basic operations
+ ///\{
+
+ /**
+ * \since 0.36
+ */
+ InfoAction(const InfoActionOptions &);
+
+ ~InfoAction();
+
+ ///\}
+
+ /**
+ * \since 0.36
+ */
+ const InfoActionOptions & options;
};
/**
@@ -557,6 +657,8 @@ namespace paludis
extern template class PrivateImplementationPattern<PretendAction>;
extern template class PrivateImplementationPattern<PretendFetchAction>;
extern template class PrivateImplementationPattern<UninstallAction>;
+ extern template class PrivateImplementationPattern<InfoAction>;
+ extern template class PrivateImplementationPattern<ConfigAction>;
#endif
}
diff --git a/paludis/install_task.cc b/paludis/install_task.cc
index ee0cd1a..8f74cc6 100644
--- a/paludis/install_task.cc
+++ b/paludis/install_task.cc
@@ -687,7 +687,11 @@ InstallTask::_pretend()
{
on_pretend_pre(*dep);
- PretendAction pretend_action;
+ PretendActionOptions options(make_named_values<PretendActionOptions>(
+ value_for<n::make_output_manager>(std::tr1::bind(&make_output_manager_for_action,
+ _imp->env, dep->package_id(), std::tr1::placeholders::_1))
+ ));
+ PretendAction pretend_action(options);
dep->package_id()->perform_action(pretend_action);
if (pretend_action.failed())
{
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index f385628..16ec3ef 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -246,7 +246,9 @@ EInstalledRepository::get_environment_variable(
}
void
-EInstalledRepository::perform_config(const std::tr1::shared_ptr<const ERepositoryID> & id) const
+EInstalledRepository::perform_config(
+ const std::tr1::shared_ptr<const ERepositoryID> & id,
+ const ConfigAction & a) const
{
Context context("When configuring '" + stringify(*id) + "':");
@@ -254,6 +256,8 @@ EInstalledRepository::perform_config(const std::tr1::shared_ptr<const ERepositor
throw InstallActionError("Couldn't configure '" + stringify(*id) +
"' because root ('" + stringify(_imp->params.root()) + "') is not a directory");
+ std::tr1::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
+
FSEntry ver_dir(id->fs_location_key()->value());
std::tr1::shared_ptr<FSEntrySequence> eclassdirs(new FSEntrySequence);
@@ -275,6 +279,7 @@ EInstalledRepository::perform_config(const std::tr1::shared_ptr<const ERepositor
value_for<n::environment>(_imp->params.environment()),
value_for<n::exlibsdirs>(make_shared_ptr(new FSEntrySequence)),
value_for<n::files_dir>(ver_dir),
+ value_for<n::maybe_output_manager>(output_manager),
value_for<n::package_id>(id),
value_for<n::portdir>(ver_dir),
value_for<n::sandbox>(phase->option("sandbox")),
@@ -291,7 +296,9 @@ EInstalledRepository::perform_config(const std::tr1::shared_ptr<const ERepositor
}
void
-EInstalledRepository::perform_info(const std::tr1::shared_ptr<const ERepositoryID> & id) const
+EInstalledRepository::perform_info(
+ const std::tr1::shared_ptr<const ERepositoryID> & id,
+ const InfoAction & a) const
{
Context context("When infoing '" + stringify(*id) + "':");
@@ -299,6 +306,8 @@ EInstalledRepository::perform_info(const std::tr1::shared_ptr<const ERepositoryI
throw InstallActionError("Couldn't info '" + stringify(*id) +
"' because root ('" + stringify(_imp->params.root()) + "') is not a directory");
+ std::tr1::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
+
FSEntry ver_dir(id->fs_location_key()->value());
std::tr1::shared_ptr<FSEntrySequence> eclassdirs(new FSEntrySequence);
@@ -374,6 +383,7 @@ EInstalledRepository::perform_info(const std::tr1::shared_ptr<const ERepositoryI
value_for<n::environment>(_imp->params.environment()),
value_for<n::exlibsdirs>(make_shared_ptr(new FSEntrySequence)),
value_for<n::files_dir>(ver_dir),
+ value_for<n::maybe_output_manager>(output_manager),
value_for<n::package_id>(id),
value_for<n::portdir>(ver_dir),
value_for<n::sandbox>(phase->option("sandbox")),
diff --git a/paludis/repositories/e/e_installed_repository.hh b/paludis/repositories/e/e_installed_repository.hh
index 1b77916..1368de1 100644
--- a/paludis/repositories/e/e_installed_repository.hh
+++ b/paludis/repositories/e/e_installed_repository.hh
@@ -97,13 +97,18 @@ namespace paludis
///\name For use by EInstalledRepositoryID
///\{
- virtual void perform_uninstall(const std::tr1::shared_ptr<const erepository::ERepositoryID> & id,
- bool reinstalling, const std::string & merge_config_protect,
- const std::tr1::shared_ptr<OutputManager> &) const = 0;
-
- virtual void perform_config(const std::tr1::shared_ptr<const erepository::ERepositoryID> & id) const;
-
- virtual void perform_info(const std::tr1::shared_ptr<const erepository::ERepositoryID> & id) const;
+ virtual void perform_uninstall(
+ const std::tr1::shared_ptr<const erepository::ERepositoryID> & id,
+ const UninstallAction &,
+ bool reinstalling) const = 0;
+
+ virtual void perform_config(
+ const std::tr1::shared_ptr<const erepository::ERepositoryID> & id,
+ const ConfigAction &) const;
+
+ virtual void perform_info(
+ const std::tr1::shared_ptr<const erepository::ERepositoryID> & id,
+ const InfoAction &) const;
///\}
};
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index 91e18fd..9044747 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -876,24 +876,22 @@ namespace
void visit(const UninstallAction & a)
{
- std::tr1::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
std::tr1::static_pointer_cast<const EInstalledRepository>(id->repository())->perform_uninstall(
- id, false, a.options.config_protect(), output_manager);
- output_manager->succeeded();
+ id, a, false);
}
void visit(const InstalledAction &)
{
}
- void visit(const ConfigAction &)
+ void visit(const ConfigAction & a)
{
- std::tr1::static_pointer_cast<const EInstalledRepository>(id->repository())->perform_config(id);
+ std::tr1::static_pointer_cast<const EInstalledRepository>(id->repository())->perform_config(id, a);
}
- void visit(const InfoAction &)
+ void visit(const InfoAction & a)
{
- std::tr1::static_pointer_cast<const EInstalledRepository>(id->repository())->perform_info(id);
+ std::tr1::static_pointer_cast<const EInstalledRepository>(id->repository())->perform_info(id, a);
}
void visit(const InstallAction & a) PALUDIS_ATTRIBUTE((noreturn));
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 773d15b..d68d4d9 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1703,7 +1703,10 @@ namespace test_cases
std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
env.package_database()->add_repository(2, installed_repo);
- InfoAction action;
+ InfoActionOptions options(make_named_values<InfoActionOptions>(
+ value_for<n::make_output_manager>(&make_standard_output_manager)
+ ));
+ InfoAction action(options);
{
TestMessageSuffix suffix("info success kdebuild-1", true);
diff --git a/paludis/repositories/e/e_repository_entries.hh b/paludis/repositories/e/e_repository_entries.hh
index 83031fa..c81dc07 100644
--- a/paludis/repositories/e/e_repository_entries.hh
+++ b/paludis/repositories/e/e_repository_entries.hh
@@ -27,6 +27,7 @@
#include <paludis/package_id-fwd.hh>
#include <paludis/environment-fwd.hh>
#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/output_manager-fwd.hh>
#include <paludis/repositories/e/e_repository_profile.hh>
#include <paludis/repositories/e/e_repository_params.hh>
#include <paludis/repositories/e/e_repository_id.hh>
@@ -102,12 +103,14 @@ namespace paludis
* Handle a pretend.
*/
virtual bool pretend(const std::tr1::shared_ptr<const ERepositoryID> &,
+ const PretendAction &,
const std::tr1::shared_ptr<const ERepositoryProfile> &) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
* Handle an info.
*/
virtual void info(const std::tr1::shared_ptr<const ERepositoryID> &,
+ const InfoAction &,
const std::tr1::shared_ptr<const ERepositoryProfile> &) const = 0;
/**
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 115100f..866fabf 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -116,7 +116,9 @@ EbuildCommand::operator() ()
}
using namespace std::tr1::placeholders;
- cmd.with_pipe_command_handler(std::tr1::bind(&pipe_command_handler, params.environment(), params.package_id(), _1));
+
+ cmd.with_pipe_command_handler(std::tr1::bind(&pipe_command_handler, params.environment(),
+ params.package_id(), _1, params.maybe_output_manager()));
std::tr1::shared_ptr<const FSEntrySequence> syncers_dirs(params.environment()->syncers_dirs());
std::tr1::shared_ptr<const FSEntrySequence> bashrc_files(params.environment()->bashrc_files());
@@ -247,6 +249,11 @@ EbuildCommand::operator() ()
if (params.package_id()->eapi()->supported()->ebuild_options()->want_portage_emulation_vars())
cmd = add_portage_vars(cmd);
+ if (params.maybe_output_manager())
+ cmd
+ .with_captured_stderr_stream(&params.maybe_output_manager()->stderr_stream())
+ .with_captured_stdout_stream(&params.maybe_output_manager()->stdout_stream());
+
if (do_run_command(cmd))
return success();
else
@@ -677,10 +684,6 @@ EbuildNoFetchCommand::extend_command(const Command & cmd)
j(fetch_params.expand_vars()->end()) ; i != j ; ++i)
result.with_setenv(i->first, i->second);
- result
- .with_captured_stderr_stream(&fetch_params.output_manager()->stderr_stream())
- .with_captured_stdout_stream(&fetch_params.output_manager()->stdout_stream());
-
return result;
}
@@ -876,7 +879,8 @@ WriteVDBEntryCommand::operator() ()
params.package_id()->eapi()->supported()->ebuild_options()->ignore_pivot_env_variables())
.with_setenv("PALUDIS_EBUILD_MODULE_SUFFIXES",
params.package_id()->eapi()->supported()->ebuild_options()->ebuild_module_suffixes())
- .with_pipe_command_handler(std::tr1::bind(&pipe_command_handler, params.environment(), params.package_id(), _1))
+ .with_pipe_command_handler(std::tr1::bind(&pipe_command_handler, params.environment(),
+ params.package_id(), _1, params.maybe_output_manager()))
);
std::string defined_phases(params.package_id()->eapi()->supported()->ebuild_metadata_variables()->defined_phases()->name());
@@ -1093,7 +1097,8 @@ WriteBinaryEbuildCommand::operator() ()
+ params.package_id()->eapi()->exported_name())->supported()->ebuild_environment_variables()->env_distdir())
.with_setenv("PALUDIS_EBUILD_MODULE_SUFFIXES",
params.package_id()->eapi()->supported()->ebuild_options()->ebuild_module_suffixes())
- .with_pipe_command_handler(std::tr1::bind(&pipe_command_handler, params.environment(), params.package_id(), _1))
+ .with_pipe_command_handler(std::tr1::bind(&pipe_command_handler, params.environment(),
+ params.package_id(), _1, params.maybe_output_manager()))
);
if (0 != (run_command(cmd)))
diff --git a/paludis/repositories/e/ebuild.hh b/paludis/repositories/e/ebuild.hh
index 688148d..fbd7637 100644
--- a/paludis/repositories/e/ebuild.hh
+++ b/paludis/repositories/e/ebuild.hh
@@ -65,9 +65,9 @@ namespace paludis
struct info_vars;
struct load_environment;
struct loadsaveenv_dir;
+ struct maybe_output_manager;
struct merger_options;
struct output_directory;
- struct output_manager;
struct package_id;
struct portdir;
struct profiles;
@@ -106,6 +106,7 @@ namespace paludis
NamedValue<n::environment, const Environment *> environment;
NamedValue<n::exlibsdirs, std::tr1::shared_ptr<const FSEntrySequence> > exlibsdirs;
NamedValue<n::files_dir, FSEntry> files_dir;
+ NamedValue<n::maybe_output_manager, std::tr1::shared_ptr<OutputManager> > maybe_output_manager;
NamedValue<n::package_id, std::tr1::shared_ptr<const erepository::ERepositoryID> > package_id;
NamedValue<n::portdir, FSEntry> portdir;
NamedValue<n::sandbox, bool> sandbox;
@@ -124,7 +125,6 @@ namespace paludis
NamedValue<n::a, std::string> a;
NamedValue<n::aa, std::string> aa;
NamedValue<n::expand_vars, std::tr1::shared_ptr<const Map<std::string, std::string> > > expand_vars;
- NamedValue<n::output_manager, std::tr1::shared_ptr<OutputManager> > output_manager;
NamedValue<n::profiles, std::tr1::shared_ptr<const FSEntrySequence> > profiles;
NamedValue<n::root, std::string> root;
NamedValue<n::use, std::string> use;
@@ -249,6 +249,7 @@ namespace paludis
{
NamedValue<n::environment, const Environment *> environment;
NamedValue<n::environment_file, FSEntry> environment_file;
+ NamedValue<n::maybe_output_manager, std::tr1::shared_ptr<OutputManager> > maybe_output_manager;
NamedValue<n::output_directory, FSEntry> output_directory;
NamedValue<n::package_id, std::tr1::shared_ptr<const erepository::ERepositoryID> > package_id;
};
@@ -269,6 +270,7 @@ namespace paludis
NamedValue<n::environment, const Environment *> environment;
NamedValue<n::environment_file, FSEntry> environment_file;
NamedValue<n::image, FSEntry> image;
+ NamedValue<n::maybe_output_manager, std::tr1::shared_ptr<OutputManager> > maybe_output_manager;
NamedValue<n::merger_options, MergerOptions> merger_options;
NamedValue<n::package_id, std::tr1::shared_ptr<const erepository::ERepositoryID> > package_id;
};
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index 12abbac..84a5215 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -473,6 +473,7 @@ EbuildEntries::fetch(const std::tr1::shared_ptr<const ERepositoryID> & id,
value_for<n::environment>(_imp->params.environment()),
value_for<n::exlibsdirs>(exlibsdirs),
value_for<n::files_dir>(_imp->e_repository->layout()->package_directory(id->name()) / "files"),
+ value_for<n::maybe_output_manager>(output_manager),
value_for<n::package_id>(id),
value_for<n::portdir>(
(_imp->params.master_repositories() && ! _imp->params.master_repositories()->empty()) ?
@@ -486,7 +487,6 @@ EbuildEntries::fetch(const std::tr1::shared_ptr<const ERepositoryID> & id,
value_for<n::a>(archives),
value_for<n::aa>(all_archives),
value_for<n::expand_vars>(expand_vars),
- value_for<n::output_manager>(output_manager),
value_for<n::profiles>(_imp->params.profiles()),
value_for<n::root>("/"),
value_for<n::use>(use),
@@ -743,6 +743,7 @@ EbuildEntries::install(const std::tr1::shared_ptr<const ERepositoryID> & id,
value_for<n::environment>(_imp->params.environment()),
value_for<n::exlibsdirs>(exlibsdirs),
value_for<n::files_dir>(_imp->e_repository->layout()->package_directory(id->name()) / "files"),
+ value_for<n::maybe_output_manager>(output_manager),
value_for<n::package_id>(id),
value_for<n::portdir>(
(_imp->params.master_repositories() && ! _imp->params.master_repositories()->empty()) ?
@@ -779,12 +780,15 @@ EbuildEntries::install(const std::tr1::shared_ptr<const ERepositoryID> & id,
void
EbuildEntries::info(const std::tr1::shared_ptr<const ERepositoryID> & id,
+ const InfoAction & a,
const std::tr1::shared_ptr<const ERepositoryProfile> & p) const
{
using namespace std::tr1::placeholders;
Context context("When infoing '" + stringify(*id) + "':");
+ std::tr1::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
+
bool userpriv_restrict;
{
DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(_imp->params.environment());
@@ -827,6 +831,7 @@ EbuildEntries::info(const std::tr1::shared_ptr<const ERepositoryID> & id,
value_for<n::environment>(_imp->params.environment()),
value_for<n::exlibsdirs>(exlibsdirs),
value_for<n::files_dir>(_imp->e_repository->layout()->package_directory(id->name()) / "files"),
+ value_for<n::maybe_output_manager>(output_manager),
value_for<n::package_id>(id),
value_for<n::portdir>(
(_imp->params.master_repositories() && ! _imp->params.master_repositories()->empty()) ?
@@ -855,7 +860,8 @@ EbuildEntries::info(const std::tr1::shared_ptr<const ERepositoryID> & id,
}
std::string
-EbuildEntries::get_environment_variable(const std::tr1::shared_ptr<const ERepositoryID> & id,
+EbuildEntries::get_environment_variable(
+ const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & var, const std::tr1::shared_ptr<const ERepositoryProfile> &) const
{
EAPIPhases phases(id->eapi()->supported()->ebuild_phases()->ebuild_variable());
@@ -894,6 +900,7 @@ EbuildEntries::get_environment_variable(const std::tr1::shared_ptr<const EReposi
value_for<n::environment>(_imp->params.environment()),
value_for<n::exlibsdirs>(exlibsdirs),
value_for<n::files_dir>(_imp->e_repository->layout()->package_directory(id->name()) / "files"),
+ value_for<n::maybe_output_manager>(make_null_shared_ptr()),
value_for<n::package_id>(id),
value_for<n::portdir>(
(_imp->params.master_repositories() && ! _imp->params.master_repositories()->empty()) ?
@@ -942,6 +949,7 @@ EbuildEntries::merge(const MergeParams & m)
value_for<n::environment>(_imp->params.environment()),
value_for<n::environment_file>(m.environment_file()),
value_for<n::image>(m.image_dir()),
+ value_for<n::maybe_output_manager>(m.output_manager()),
value_for<n::merger_options>(std::tr1::static_pointer_cast<const ERepositoryID>(m.package_id())->eapi()->supported()->merger_options()),
value_for<n::package_id>(std::tr1::static_pointer_cast<const ERepositoryID>(m.package_id()))
));
@@ -976,7 +984,9 @@ EbuildEntries::extract_package_file_version(const QualifiedPackageName & n, cons
}
bool
-EbuildEntries::pretend(const std::tr1::shared_ptr<const ERepositoryID> & id,
+EbuildEntries::pretend(
+ const std::tr1::shared_ptr<const ERepositoryID> & id,
+ const PretendAction & a,
const std::tr1::shared_ptr<const ERepositoryProfile> & p) const
{
using namespace std::tr1::placeholders;
@@ -986,6 +996,8 @@ EbuildEntries::pretend(const std::tr1::shared_ptr<const ERepositoryID> & id,
if (! id->eapi()->supported())
return false;
+ std::tr1::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
+
bool result(true);
if (! id->raw_myoptions_key())
@@ -1037,6 +1049,7 @@ EbuildEntries::pretend(const std::tr1::shared_ptr<const ERepositoryID> & id,
value_for<n::environment>(_imp->params.environment()),
value_for<n::exlibsdirs>(exlibsdirs),
value_for<n::files_dir>(_imp->e_repository->layout()->package_directory(id->name()) / "files"),
+ value_for<n::maybe_output_manager>(output_manager),
value_for<n::package_id>(id),
value_for<n::portdir>(
(_imp->params.master_repositories() && ! _imp->params.master_repositories()->empty()) ?
@@ -1084,6 +1097,7 @@ EbuildEntries::pretend(const std::tr1::shared_ptr<const ERepositoryID> & id,
value_for<n::environment>(_imp->params.environment()),
value_for<n::exlibsdirs>(exlibsdirs),
value_for<n::files_dir>(_imp->e_repository->layout()->package_directory(id->name()) / "files"),
+ value_for<n::maybe_output_manager>(output_manager),
value_for<n::package_id>(id),
value_for<n::portdir>(
(_imp->params.master_repositories() && ! _imp->params.master_repositories()->empty()) ?
diff --git a/paludis/repositories/e/ebuild_entries.hh b/paludis/repositories/e/ebuild_entries.hh
index 07d7aa3..582076c 100644
--- a/paludis/repositories/e/ebuild_entries.hh
+++ b/paludis/repositories/e/ebuild_entries.hh
@@ -23,6 +23,7 @@
#include <paludis/repositories/e/e_repository_entries.hh>
#include <paludis/repositories/e/e_repository_params.hh>
#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/output_manager-fwd.hh>
/** \file
* Declaration for the EbuildEntries class.
@@ -93,9 +94,11 @@ namespace paludis
const std::tr1::shared_ptr<const ERepositoryProfile> &) const;
virtual bool pretend(const std::tr1::shared_ptr<const ERepositoryID> &,
+ const PretendAction &,
const std::tr1::shared_ptr<const ERepositoryProfile> &) const;
virtual void info(const std::tr1::shared_ptr<const ERepositoryID> &,
+ const InfoAction &,
const std::tr1::shared_ptr<const ERepositoryProfile> &) const;
virtual std::string get_package_file_manifest_key(const FSEntry &, const QualifiedPackageName &) const;
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 9a39e91..16cb3fb 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -243,6 +243,7 @@ EbuildID::need_keys_added() const
value_for<n::environment>(_imp->environment),
value_for<n::exlibsdirs>(_imp->repository->layout()->exlibsdirs(name())),
value_for<n::files_dir>(_imp->repository->layout()->package_directory(name()) / "files"),
+ value_for<n::maybe_output_manager>(make_null_shared_ptr()),
value_for<n::package_id>(shared_from_this()),
value_for<n::portdir>(
(_imp->repository->params().master_repositories() && ! _imp->repository->params().master_repositories()->empty()) ?
@@ -1058,14 +1059,16 @@ namespace
{
if (! std::tr1::static_pointer_cast<const ERepository>(id->repository())->entries()->pretend(
std::tr1::static_pointer_cast<const ERepositoryID>(id),
+ action,
std::tr1::static_pointer_cast<const ERepository>(id->repository())->profile()))
action.set_failed();
}
- void visit(InfoAction &)
+ void visit(InfoAction & action)
{
std::tr1::static_pointer_cast<const ERepository>(id->repository())->entries()->info(
std::tr1::static_pointer_cast<const ERepositoryID>(id),
+ action,
std::tr1::static_pointer_cast<const ERepository>(id->repository())->profile());
}
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 93f55ec..926d676 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -296,6 +296,11 @@ namespace
else
return ! b->slot_key();
}
+
+ std::tr1::shared_ptr<OutputManager> this_output_manager(const std::tr1::shared_ptr<OutputManager> & o, const Action &)
+ {
+ return o;
+ }
}
void
@@ -346,6 +351,7 @@ ExndbamRepository::merge(const MergeParams & m)
make_named_values<WriteVDBEntryParams>(
value_for<n::environment>(_imp->params.environment()),
value_for<n::environment_file>(m.environment_file()),
+ value_for<n::maybe_output_manager>(m.output_manager()),
value_for<n::output_directory>(target_ver_dir),
value_for<n::package_id>(std::tr1::static_pointer_cast<const ERepositoryID>(m.package_id()))
));
@@ -404,8 +410,13 @@ ExndbamRepository::merge(const MergeParams & m)
if (if_overwritten_id)
{
- perform_uninstall(std::tr1::static_pointer_cast<const ERepositoryID>(if_overwritten_id), true, config_protect, m.output_manager());
+ UninstallActionOptions uo(make_named_values<UninstallActionOptions>(
+ value_for<n::config_protect>(config_protect),
+ value_for<n::make_output_manager>(std::tr1::bind(&this_output_manager, m.output_manager(), std::tr1::placeholders::_1))
+ ));
+ perform_uninstall(std::tr1::static_pointer_cast<const ERepositoryID>(if_overwritten_id), uo, true);
}
+
if (std::tr1::static_pointer_cast<const ERepositoryID>(m.package_id())
->eapi()->supported()->ebuild_phases()->ebuild_new_upgrade_phase_order())
{
@@ -415,7 +426,13 @@ ExndbamRepository::merge(const MergeParams & m)
{
std::tr1::shared_ptr<const ERepositoryID> candidate(std::tr1::static_pointer_cast<const ERepositoryID>(*it));
if (candidate != if_overwritten_id && slot_is_same(candidate, m.package_id()))
- perform_uninstall(candidate, false, "", m.output_manager());
+ {
+ UninstallActionOptions uo(make_named_values<UninstallActionOptions>(
+ value_for<n::config_protect>(config_protect),
+ value_for<n::make_output_manager>(std::tr1::bind(&this_output_manager, m.output_manager(), std::tr1::placeholders::_1))
+ ));
+ perform_uninstall(candidate, uo, false);
+ }
}
}
@@ -428,9 +445,10 @@ ExndbamRepository::merge(const MergeParams & m)
}
void
-ExndbamRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositoryID> & id,
- bool replace, const std::string & merge_config_protect,
- const std::tr1::shared_ptr<OutputManager> & output_manager) const
+ExndbamRepository::perform_uninstall(
+ const std::tr1::shared_ptr<const ERepositoryID> & id,
+ const UninstallAction & a,
+ bool replace) const
{
Context context("When uninstalling '" + stringify(*id) + (replace ? "' for a reinstall:" : "':"));
@@ -438,6 +456,8 @@ ExndbamRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositor
throw InstallActionError("Couldn't uninstall '" + stringify(*id) +
"' because root ('" + stringify(_imp->params.root()) + "') is not a directory");
+ std::tr1::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
+
FSEntry ver_dir(id->fs_location_key()->value());
std::tr1::shared_ptr<FSEntry> load_env(new FSEntry(ver_dir / "environment.bz2"));
@@ -480,7 +500,7 @@ ExndbamRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositor
{
}
- std::string final_config_protect(config_protect + " " + merge_config_protect);
+ std::string final_config_protect(config_protect + " " + a.options.config_protect());
/* unmerge */
NDBAMUnmerger unmerger(
@@ -510,6 +530,7 @@ ExndbamRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositor
value_for<n::environment>(_imp->params.environment()),
value_for<n::exlibsdirs>(make_shared_ptr(new FSEntrySequence)),
value_for<n::files_dir>(ver_dir),
+ value_for<n::maybe_output_manager>(output_manager),
value_for<n::package_id>(id),
value_for<n::portdir>(_imp->params.location()),
value_for<n::sandbox>(phase->option("sandbox")),
diff --git a/paludis/repositories/e/exndbam_repository.hh b/paludis/repositories/e/exndbam_repository.hh
index caf6c3c..f5212ff 100644
--- a/paludis/repositories/e/exndbam_repository.hh
+++ b/paludis/repositories/e/exndbam_repository.hh
@@ -115,9 +115,10 @@ namespace paludis
///\name For use by ExndbamID
///\{
- void perform_uninstall(const std::tr1::shared_ptr<const erepository::ERepositoryID> & id,
- bool reinstalling, const std::string & merge_config_protect,
- const std::tr1::shared_ptr<OutputManager> &) const;
+ void perform_uninstall(
+ const std::tr1::shared_ptr<const erepository::ERepositoryID> & id,
+ const UninstallAction &,
+ bool reinstalling) const;
///\}
diff --git a/paludis/repositories/e/pipe_command_handler.cc b/paludis/repositories/e/pipe_command_handler.cc
index 6bd0b5c..7851880 100644
--- a/paludis/repositories/e/pipe_command_handler.cc
+++ b/paludis/repositories/e/pipe_command_handler.cc
@@ -33,6 +33,7 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/set.hh>
#include <paludis/util/indirect_iterator.hh>
+#include <paludis/util/output_manager.hh>
#include <paludis/package_id.hh>
#include <paludis/environment.hh>
#include <paludis/package_database.hh>
@@ -58,7 +59,8 @@ namespace
std::string
paludis::erepository::pipe_command_handler(const Environment * const environment,
- const std::tr1::shared_ptr<const PackageID> & package_id, const std::string & s)
+ const std::tr1::shared_ptr<const PackageID> & package_id, const std::string & s,
+ const std::tr1::shared_ptr<OutputManager> & maybe_output_manager)
{
Context context("In ebuild pipe command handler for '" + s + "':");
@@ -93,7 +95,35 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
{
Log::get_instance()->message("e.child.message", destringify<LogLevel>(tokens[2]), lc_context)
<< join(next(next(next(tokens.begin()))), tokens.end(), " ");
- return "O";
+ return "O0;";
+ }
+ }
+ else if (tokens[0] == "MESSAGE")
+ {
+ if (tokens.size() != 4)
+ {
+ Log::get_instance()->message("e.pipe_commands.message.bad", ll_warning, lc_context) << "Got bad MESSAGE pipe command";
+ MessageType m;
+ if (tokens[2] == "einfo" || tokens[2] == "einfon")
+ m = mt_info;
+ else if (tokens[2] == "ewarn")
+ m = mt_warn;
+ else if (tokens[2] == "eerror")
+ m = mt_error;
+ else if (tokens[2] == "elog")
+ m = mt_log;
+ else
+ return "EUnknown message type " + tokens[2] + "";
+
+ if (maybe_output_manager)
+ maybe_output_manager->message(m, tokens[3]);
+ return "O0;";
+ }
+ else
+ {
+ Log::get_instance()->message("e.child.message", destringify<LogLevel>(tokens[2]), lc_context)
+ << join(next(next(next(tokens.begin()))), tokens.end(), " ");
+ return "O0;";
}
}
else if (tokens[0] == "BEST_VERSION")
diff --git a/paludis/repositories/e/pipe_command_handler.hh b/paludis/repositories/e/pipe_command_handler.hh
index 446b435..8d5630f 100644
--- a/paludis/repositories/e/pipe_command_handler.hh
+++ b/paludis/repositories/e/pipe_command_handler.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2009 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
@@ -22,6 +22,7 @@
#include <paludis/environment-fwd.hh>
#include <paludis/package_id-fwd.hh>
+#include <paludis/util/output_manager-fwd.hh>
#include <tr1/functional>
#include <string>
@@ -31,7 +32,8 @@ namespace paludis
{
std::string pipe_command_handler(const Environment * const,
const std::tr1::shared_ptr<const PackageID> &,
- const std::string & s);
+ const std::string & s,
+ const std::tr1::shared_ptr<OutputManager> & maybe_output_manager);
}
}
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index ab6c67c..b388094 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -373,9 +373,10 @@ VDBRepositoryKeyReadError::VDBRepositoryKeyReadError(
}
void
-VDBRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositoryID> & id,
- bool reinstalling, const std::string & merge_config_protect,
- const std::tr1::shared_ptr<OutputManager> & output_manager) const
+VDBRepository::perform_uninstall(
+ const std::tr1::shared_ptr<const ERepositoryID> & id,
+ const UninstallAction & a,
+ bool reinstalling) const
{
Context context("When uninstalling '" + stringify(*id) + (reinstalling ? "' for a reinstall:" : "':"));
@@ -383,6 +384,8 @@ VDBRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositoryID>
throw InstallActionError("Couldn't uninstall '" + stringify(*id) +
"' because root ('" + stringify(_imp->params.root()) + "') is not a directory");
+ std::tr1::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
+
std::string reinstalling_str(reinstalling ? "-reinstalling-" : "");
std::tr1::shared_ptr<FSEntrySequence> eclassdirs(new FSEntrySequence);
@@ -429,7 +432,7 @@ VDBRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositoryID>
{
}
- std::string final_config_protect(config_protect + " " + merge_config_protect);
+ std::string final_config_protect(config_protect + " " + a.options.config_protect());
/* unmerge */
VDBUnmerger unmerger(
@@ -457,6 +460,7 @@ VDBRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositoryID>
value_for<n::environment>(_imp->params.environment()),
value_for<n::exlibsdirs>(make_shared_ptr(new FSEntrySequence)),
value_for<n::files_dir>(pkg_dir),
+ value_for<n::maybe_output_manager>(output_manager),
value_for<n::package_id>(id),
value_for<n::portdir>(_imp->params.location()),
value_for<n::sandbox>(phase->option("sandbox")),
@@ -804,6 +808,11 @@ namespace
else
return ! b->slot_key();
}
+
+ std::tr1::shared_ptr<OutputManager> this_output_manager(const std::tr1::shared_ptr<OutputManager> & o, const Action &)
+ {
+ return o;
+ }
}
void
@@ -830,6 +839,7 @@ VDBRepository::merge(const MergeParams & m)
make_named_values<WriteVDBEntryParams>(
value_for<n::environment>(_imp->params.environment()),
value_for<n::environment_file>(m.environment_file()),
+ value_for<n::maybe_output_manager>(m.output_manager()),
value_for<n::output_directory>(tmp_vdb_dir),
value_for<n::package_id>(std::tr1::static_pointer_cast<const ERepositoryID>(m.package_id()))
));
@@ -902,7 +912,14 @@ VDBRepository::merge(const MergeParams & m)
merger.merge();
if (is_replace)
- perform_uninstall(is_replace, true, config_protect, m.output_manager());
+ {
+ UninstallActionOptions uo(make_named_values<UninstallActionOptions>(
+ value_for<n::config_protect>(config_protect),
+ value_for<n::make_output_manager>(std::tr1::bind(&this_output_manager, m.output_manager(), std::tr1::placeholders::_1))
+ ));
+ perform_uninstall(is_replace, uo, true);
+ }
+
if (std::tr1::static_pointer_cast<const ERepositoryID>(m.package_id())
->eapi()->supported()->ebuild_phases()->ebuild_new_upgrade_phase_order())
{
@@ -912,7 +929,13 @@ VDBRepository::merge(const MergeParams & m)
{
std::tr1::shared_ptr<const ERepositoryID> candidate(std::tr1::static_pointer_cast<const ERepositoryID>(*it));
if (candidate != is_replace && slot_is_same(candidate, m.package_id()))
- perform_uninstall(candidate, false, "", m.output_manager());
+ {
+ UninstallActionOptions uo(make_named_values<UninstallActionOptions>(
+ value_for<n::config_protect>(config_protect),
+ value_for<n::make_output_manager>(std::tr1::bind(&this_output_manager, m.output_manager(), std::tr1::placeholders::_1))
+ ));
+ perform_uninstall(candidate, uo, false);
+ }
}
}
diff --git a/paludis/repositories/e/vdb_repository.hh b/paludis/repositories/e/vdb_repository.hh
index 01922fb..f5f0421 100644
--- a/paludis/repositories/e/vdb_repository.hh
+++ b/paludis/repositories/e/vdb_repository.hh
@@ -119,9 +119,10 @@ namespace paludis
virtual void regenerate_cache() const;
- virtual void perform_uninstall(const std::tr1::shared_ptr<const erepository::ERepositoryID> & id,
- bool reinstalling, const std::string & merge_config_protect,
- const std::tr1::shared_ptr<OutputManager> &) const;
+ virtual void perform_uninstall(
+ const std::tr1::shared_ptr<const erepository::ERepositoryID> & id,
+ const UninstallAction &,
+ bool reinstalling) const;
/* RepositoryProvidesInterface */
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index 6be75bd..8c1368c 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -367,8 +367,16 @@ namespace test_cases
value_for<n::make_output_manager>(&make_standard_output_manager)
));
- InfoAction info_action;
- ConfigAction config_action;
+ InfoActionOptions info_action_options(make_named_values<InfoActionOptions>(
+ value_for<n::make_output_manager>(&make_standard_output_manager)
+ ));
+
+ ConfigActionOptions config_action_options(make_named_values<ConfigActionOptions>(
+ value_for<n::make_output_manager>(&make_standard_output_manager)
+ ));
+
+ InfoAction info_action(info_action_options);
+ ConfigAction config_action(config_action_options);
{
TestMessageSuffix suffix("install", true);
@@ -485,8 +493,16 @@ namespace test_cases
value_for<n::make_output_manager>(&make_standard_output_manager)
));
- InfoAction info_action;
- ConfigAction config_action;
+ InfoActionOptions info_action_options(make_named_values<InfoActionOptions>(
+ value_for<n::make_output_manager>(&make_standard_output_manager)
+ ));
+
+ ConfigActionOptions config_action_options(make_named_values<ConfigActionOptions>(
+ value_for<n::make_output_manager>(&make_standard_output_manager)
+ ));
+
+ InfoAction info_action(info_action_options);
+ ConfigAction config_action(config_action_options);
{
TestMessageSuffix suffix("vars", true);
diff --git a/paludis/util/echo_functions.bash.in b/paludis/util/echo_functions.bash.in
index 527d0a0..65ee50a 100644
--- a/paludis/util/echo_functions.bash.in
+++ b/paludis/util/echo_functions.bash.in
@@ -3,7 +3,7 @@
@GENERATED_FILE@
-# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+# Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
@@ -59,6 +59,11 @@ paludis_ecmd()
MESSAGE="${message}" perform_hook "${hook}"
fi
fi
+
+ if type paludis_pipe_command &>/dev/null ; then
+ local r=$(paludis_pipe_command MESSAGE "$EAPI" "$1" "$4" )
+ return ${r%%;*}
+ fi
}
einfon()
diff --git a/paludis/util/output_manager.hh b/paludis/util/output_manager.hh
index 98588d4..f399dc6 100644
--- a/paludis/util/output_manager.hh
+++ b/paludis/util/output_manager.hh
@@ -55,6 +55,9 @@ namespace paludis
*
* Further messages and output may occur even after a call to this
* method.
+ *
+ * Calls to this method are done by the caller, not by whatever
+ * carries out the action in question.
*/
virtual void succeeded() = 0;
};
diff --git a/src/clients/paludis/do_config.cc b/src/clients/paludis/do_config.cc
index 54685d0..0d19f50 100644
--- a/src/clients/paludis/do_config.cc
+++ b/src/clients/paludis/do_config.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 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
@@ -46,12 +46,22 @@ namespace
}
};
+ std::tr1::shared_ptr<OutputManager> make_output_manager_for_action(
+ const Environment * const env, const std::tr1::shared_ptr<const PackageID> & id, const Action & a)
+ {
+ return env->create_output_manager(CreateOutputManagerForPackageIDActionInfo(id, a));
+ }
+
int
- do_one_config_entry(const std::tr1::shared_ptr<const PackageID> & p)
+ do_one_config_entry(const Environment * const env, const std::tr1::shared_ptr<const PackageID> & p)
{
int return_code(0);
- ConfigAction a;
+ ConfigActionOptions options(make_named_values<ConfigActionOptions>(
+ value_for<n::make_output_manager>(std::tr1::bind(&make_output_manager_for_action,
+ env, p, std::tr1::placeholders::_1))
+ ));
+ ConfigAction a(options);
try
{
p->perform_action(a);
@@ -83,7 +93,7 @@ namespace
if (next(entries->begin()) != entries->end())
throw AmbiguousConfigTarget(entries);
- return do_one_config_entry(*entries->begin());
+ return do_one_config_entry(env.get(), *entries->begin());
}
}
diff --git a/src/clients/paludis/info.cc b/src/clients/paludis/info.cc
index 1ad15ba..0c343be 100644
--- a/src/clients/paludis/info.cc
+++ b/src/clients/paludis/info.cc
@@ -25,6 +25,7 @@
#include <paludis/user_dep_spec.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/simple_visitor_cast.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/package_database.hh>
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
@@ -34,6 +35,7 @@
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/selection.hh>
+#include <paludis/create_output_manager_info.hh>
#include <iostream>
#include <iomanip>
#include <set>
@@ -204,6 +206,12 @@ namespace
cout << std::setw(30) << (indent + k.human_name() + ":") << " " << endl;
}
};
+
+ std::tr1::shared_ptr<OutputManager> make_output_manager_for_action(
+ const Environment * const env, const std::tr1::shared_ptr<const PackageID> & id, const Action & a)
+ {
+ return env->create_output_manager(CreateOutputManagerForPackageIDActionInfo(id, a));
+ }
}
int do_one_info(
@@ -239,7 +247,12 @@ int do_one_info(
for (PackageIDSequence::ConstIterator p(to_show_entries->begin()), p_end(to_show_entries->end()) ;
p != p_end ; ++p)
{
- InfoAction a;
+ InfoActionOptions options(make_named_values<InfoActionOptions>(
+ value_for<n::make_output_manager>(std::tr1::bind(&make_output_manager_for_action,
+ env.get(), *p, std::tr1::placeholders::_1))
+ ));
+ InfoAction a(options);
+
try
{
cout << "Package " << colour(cl_package_name, **p) << ":" << endl;