aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories')
-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
17 files changed, 196 insertions, 56 deletions
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index f38562812..16ec3efda 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 1b7791612..1368de1fb 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 91e18fd2b..9044747ca 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 773d15ba8..d68d4d92b 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 83031fa62..c81dc0775 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 115100ff9..866fabf80 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 688148dba..fbd763783 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 12abbac59..84a52156a 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 07d7aa342..582076c2d 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 9a39e9149..16cb3fb80 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 93f55ec5e..926d676b5 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 caf6c3ce5..f5212ff47 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 6bd0b5c5d..7851880bc 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 446b43520..8d5630f12 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 ab6c67cf7..b388094bb 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 01922fb2e..f5f042121 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 6be75bd0b..8c1368cf5 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);