aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-07 14:06:15 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-07 14:06:15 +0000
commitfc4695c629f9cf2b5727d32b451cbfa081f97836 (patch)
tree989fbcfa77b68a7dc9dcbe583e1bbc61b5753ddc
parent7baffcaec4696b62b10ca39cd22d59cc87b20ad6 (diff)
downloadpaludis-fc4695c629f9cf2b5727d32b451cbfa081f97836.tar.gz
paludis-fc4695c629f9cf2b5727d32b451cbfa081f97836.tar.xz
Use output manager
-rw-r--r--paludis/action.hh5
-rw-r--r--paludis/install_task.cc3
-rw-r--r--paludis/ndbam_merger.cc12
-rw-r--r--paludis/ndbam_merger.hh5
-rw-r--r--paludis/ndbam_unmerger.cc4
-rw-r--r--paludis/ndbam_unmerger.hh5
-rw-r--r--paludis/repositories/accounts/dummy_accounts_handler.cc6
-rw-r--r--paludis/repositories/accounts/passwd_accounts_handler.cc10
-rw-r--r--paludis/repositories/e/e_installed_repository.hh5
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc3
-rw-r--r--paludis/repositories/e/e_stripper.cc12
-rw-r--r--paludis/repositories/e/e_stripper.hh5
-rw-r--r--paludis/repositories/e/ebuild_entries.cc5
-rw-r--r--paludis/repositories/e/exndbam_repository.cc14
-rw-r--r--paludis/repositories/e/exndbam_repository.hh5
-rw-r--r--paludis/repositories/e/exndbam_repository_TEST.cc3
-rw-r--r--paludis/repositories/e/fetch_visitor.cc1
-rw-r--r--paludis/repositories/e/qa/manifest.cc1
-rw-r--r--paludis/repositories/e/vdb_merger.cc12
-rw-r--r--paludis/repositories/e/vdb_merger.hh5
-rw-r--r--paludis/repositories/e/vdb_merger_TEST.cc3
-rw-r--r--paludis/repositories/e/vdb_repository.cc14
-rw-r--r--paludis/repositories/e/vdb_repository.hh5
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc15
-rw-r--r--paludis/repositories/e/vdb_unmerger.cc4
-rw-r--r--paludis/repositories/e/vdb_unmerger.hh4
-rw-r--r--paludis/repositories/e/vdb_unmerger_TEST.cc3
-rw-r--r--paludis/repositories/unpackaged/installed_id.cc7
-rw-r--r--paludis/repositories/unpackaged/installed_id.hh3
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc3
-rw-r--r--paludis/repositories/unpackaged/installed_repository_TEST.cc12
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc1
-rw-r--r--paludis/repositories/unpackaged/unpackaged_stripper.cc12
-rw-r--r--paludis/repositories/unpackaged/unpackaged_stripper.hh5
-rw-r--r--paludis/sohooks_TEST.cc1
-rw-r--r--paludis/uninstall_task.cc6
-rw-r--r--python/action.cc3
-rw-r--r--ruby/action.cc3
38 files changed, 140 insertions, 85 deletions
diff --git a/paludis/action.hh b/paludis/action.hh
index f2389b4..28eff0e 100644
--- a/paludis/action.hh
+++ b/paludis/action.hh
@@ -116,6 +116,11 @@ namespace paludis
struct UninstallActionOptions
{
NamedValue<n::config_protect, std::string> config_protect;
+
+ /**
+ * \since 0.36
+ */
+ NamedValue<n::output_manager, std::tr1::shared_ptr<OutputManager> > output_manager;
};
/**
diff --git a/paludis/install_task.cc b/paludis/install_task.cc
index 4a2c7ee..8a5bcbc 100644
--- a/paludis/install_task.cc
+++ b/paludis/install_task.cc
@@ -876,7 +876,8 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
{
UninstallAction uninstall_action(
make_named_values<UninstallActionOptions>(
- value_for<n::config_protect>(_imp->config_protect)
+ value_for<n::config_protect>(_imp->config_protect),
+ value_for<n::output_manager>(make_shared_ptr(new StandardOutputManager))
));
(*c)->perform_action(uninstall_action);
}
diff --git a/paludis/ndbam_merger.cc b/paludis/ndbam_merger.cc
index c7e3b7b..611933e 100644
--- a/paludis/ndbam_merger.cc
+++ b/paludis/ndbam_merger.cc
@@ -28,6 +28,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/options.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/output_manager.hh>
#include <paludis/hook.hh>
#include <paludis/package_id.hh>
#include <paludis/util/md5.hh>
@@ -36,7 +37,6 @@
#include <paludis/ndbam_merger.hh>
#include <paludis/metadata_key.hh>
#include <fstream>
-#include <iostream>
#include <iomanip>
#include <list>
@@ -206,7 +206,7 @@ NDBAMMerger::on_error(bool is_check, const std::string & s)
make_check_fail();
if (is_check)
- std::cout << "." << std::endl << "!!! " << s << std::endl;
+ _imp->params.output_manager()->stdout_stream() << "." << std::endl << "!!! " << s << std::endl;
else
throw MergerError(s);
}
@@ -343,9 +343,9 @@ NDBAMMerger::merge()
bool
NDBAMMerger::check()
{
- std::cout << ">>> Checking whether we can merge to " << _imp->params.root() << " ";
+ _imp->params.output_manager()->stdout_stream() << ">>> Checking whether we can merge to " << _imp->params.root() << " ";
bool result(Merger::check());
- std::cout << std::endl;
+ _imp->params.output_manager()->stdout_stream() << std::endl;
return result;
}
@@ -355,12 +355,12 @@ NDBAMMerger::on_enter_dir(bool is_check, const FSEntry)
if (! is_check)
return;
- std::cout << "." << std::flush;
+ _imp->params.output_manager()->stdout_stream() << "." << std::flush;
}
void
NDBAMMerger::display_override(const std::string & message) const
{
- std::cout << message << std::endl;
+ _imp->params.output_manager()->stdout_stream() << message << std::endl;
}
diff --git a/paludis/ndbam_merger.hh b/paludis/ndbam_merger.hh
index 30baf69..8eb4e9b 100644
--- a/paludis/ndbam_merger.hh
+++ b/paludis/ndbam_merger.hh
@@ -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
@@ -23,6 +23,7 @@
#include <paludis/merger.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/util/named_value.hh>
+#include <paludis/util/output_manager-fwd.hh>
#include <tr1/functional>
namespace paludis
@@ -37,6 +38,7 @@ namespace paludis
struct image;
struct install_under;
struct options;
+ struct output_manager;
struct package_id;
struct root;
}
@@ -51,6 +53,7 @@ namespace paludis
NamedValue<n::image, FSEntry> image;
NamedValue<n::install_under, FSEntry> install_under;
NamedValue<n::options, MergerOptions> options;
+ NamedValue<n::output_manager, std::tr1::shared_ptr<OutputManager> > output_manager;
NamedValue<n::package_id, std::tr1::shared_ptr<const PackageID> > package_id;
NamedValue<n::root, FSEntry> root;
};
diff --git a/paludis/ndbam_unmerger.cc b/paludis/ndbam_unmerger.cc
index 03d4439..05d3002 100644
--- a/paludis/ndbam_unmerger.cc
+++ b/paludis/ndbam_unmerger.cc
@@ -37,13 +37,13 @@
#include <paludis/util/strip.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/output_manager.hh>
#include <paludis/metadata_key.hh>
#include <tr1/functional>
#include <list>
#include <map>
#include <vector>
#include <fstream>
-#include <iostream>
using namespace paludis;
@@ -291,7 +291,7 @@ NDBAMUnmerger::check_dir(const FSEntry & f, const std::tr1::shared_ptr<ExtraInfo
void
NDBAMUnmerger::display(const std::string & message) const
{
- std::cout << message << std::endl;
+ _imp->options.output_manager()->stdout_stream() << message << std::endl;
}
NDBAMUnmergerError::NDBAMUnmergerError(const std::string & s) throw () :
diff --git a/paludis/ndbam_unmerger.hh b/paludis/ndbam_unmerger.hh
index a3366bc..dcbe2a3 100644
--- a/paludis/ndbam_unmerger.hh
+++ b/paludis/ndbam_unmerger.hh
@@ -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
* Copyright (c) 2007 Piotr Jaroszyński
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -23,6 +23,7 @@
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/fs_entry.hh>
+#include <paludis/util/output_manager-fwd.hh>
#include <paludis/unmerger.hh>
#include <paludis/environment-fwd.hh>
#include <paludis/package_id-fwd.hh>
@@ -36,6 +37,7 @@ namespace paludis
struct contents_file;
struct environment;
struct ndbam;
+ struct output_manager;
struct package_id;
struct root;
}
@@ -49,6 +51,7 @@ namespace paludis
NamedValue<n::contents_file, FSEntry> contents_file;
NamedValue<n::environment, const Environment *> environment;
NamedValue<n::ndbam, const NDBAM *> ndbam;
+ NamedValue<n::output_manager, std::tr1::shared_ptr<OutputManager> > output_manager;
NamedValue<n::package_id, std::tr1::shared_ptr<const PackageID> > package_id;
NamedValue<n::root, FSEntry> root;
};
diff --git a/paludis/repositories/accounts/dummy_accounts_handler.cc b/paludis/repositories/accounts/dummy_accounts_handler.cc
index d811753..0c81fa9 100644
--- a/paludis/repositories/accounts/dummy_accounts_handler.cc
+++ b/paludis/repositories/accounts/dummy_accounts_handler.cc
@@ -18,9 +18,9 @@
*/
#include <paludis/repositories/accounts/dummy_accounts_handler.hh>
+#include <paludis/util/output_manager.hh>
#include <paludis/package_id.hh>
#include <paludis/repository.hh>
-#include <iostream>
using namespace paludis;
using namespace paludis::accounts_repository;
@@ -28,7 +28,7 @@ using namespace paludis::accounts_repository;
void
DummyAccountsHandler::merge(const MergeParams & m)
{
- std::cout << ">>> Installing " << *m.package_id() << " using dummy handler" << std::endl;
- std::cout << ">>> Finished installing " << *m.package_id() << std::endl;
+ m.output_manager()->stdout_stream() << ">>> Installing " << *m.package_id() << " using dummy handler" << std::endl;
+ m.output_manager()->stdout_stream() << ">>> Finished installing " << *m.package_id() << std::endl;
}
diff --git a/paludis/repositories/accounts/passwd_accounts_handler.cc b/paludis/repositories/accounts/passwd_accounts_handler.cc
index 4415272..83407db 100644
--- a/paludis/repositories/accounts/passwd_accounts_handler.cc
+++ b/paludis/repositories/accounts/passwd_accounts_handler.cc
@@ -25,11 +25,11 @@
#include <paludis/util/set.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/join.hh>
+#include <paludis/util/output_manager.hh>
#include <paludis/action.hh>
#include <paludis/repository.hh>
#include <paludis/metadata_key.hh>
#include <paludis/package_id.hh>
-#include <iostream>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
@@ -42,14 +42,14 @@ PasswdAccountsHandler::merge(const MergeParams & params)
{
Context context("When installing '" + stringify(*params.package_id()) + "':");
- std::cout << ">>> Installing " << *params.package_id() << " using passwd handler" << std::endl;
+ params.output_manager()->stdout_stream() << ">>> Installing " << *params.package_id() << " using passwd handler" << std::endl;
if (params.package_id()->end_metadata() != params.package_id()->find_metadata("groupname"))
merge_group(params);
else
merge_user(params);
- std::cout << ">>> Finished installing " << *params.package_id() << std::endl;
+ params.output_manager()->stdout_stream() << ">>> Finished installing " << *params.package_id() << std::endl;
}
void
@@ -111,7 +111,7 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
uid_t uid(destringify<uid_t>(preferred_uid));
if (getpwuid(uid))
{
- std::cout << ">>> Preferred UID " << uid << " already in use, not specifying an ID" << std::endl;
+ params.output_manager()->stdout_stream() << ">>> Preferred UID " << uid << " already in use, not specifying an ID" << std::endl;
preferred_uid = "";
}
@@ -247,7 +247,7 @@ PasswdAccountsHandler::merge_group(const MergeParams & params)
uid_t gid(destringify<uid_t>(preferred_gid));
if (getgrgid(gid))
{
- std::cout << ">>> Preferred GID " << gid << " already in use, not specifying an ID" << std::endl;
+ params.output_manager()->stdout_stream() << ">>> Preferred GID " << gid << " already in use, not specifying an ID" << std::endl;
preferred_gid = "";
}
diff --git a/paludis/repositories/e/e_installed_repository.hh b/paludis/repositories/e/e_installed_repository.hh
index ab9c239..1b77916 100644
--- a/paludis/repositories/e/e_installed_repository.hh
+++ b/paludis/repositories/e/e_installed_repository.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -98,7 +98,8 @@ namespace paludis
///\{
virtual void perform_uninstall(const std::tr1::shared_ptr<const erepository::ERepositoryID> & id,
- bool reinstalling, const std::string & merge_config_protect) const = 0;
+ 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;
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index c4f1e85..b2155c9 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -878,7 +878,8 @@ namespace
void visit(const UninstallAction & a)
{
- std::tr1::static_pointer_cast<const EInstalledRepository>(id->repository())->perform_uninstall(id, false, a.options.config_protect());
+ std::tr1::static_pointer_cast<const EInstalledRepository>(id->repository())->perform_uninstall(id, false, a.options.config_protect(),
+ a.options.output_manager());
}
void visit(const InstalledAction &)
diff --git a/paludis/repositories/e/e_stripper.cc b/paludis/repositories/e/e_stripper.cc
index ada0484..8a008ab 100644
--- a/paludis/repositories/e/e_stripper.cc
+++ b/paludis/repositories/e/e_stripper.cc
@@ -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
@@ -21,7 +21,7 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/make_named_values.hh>
-#include <iostream>
+#include <paludis/util/output_manager.hh>
using namespace paludis;
using namespace paludis::erepository;
@@ -59,20 +59,20 @@ EStripper::~EStripper()
void
EStripper::on_strip(const FSEntry & f)
{
- std::cout << "str " << f.strip_leading(_imp->options.image_dir()) << std::endl;
+ _imp->options.output_manager()->stdout_stream() << "str " << f.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
EStripper::on_split(const FSEntry & f, const FSEntry & g)
{
- std::cout << "spl " << f.strip_leading(_imp->options.image_dir()) <<
+ _imp->options.output_manager()->stdout_stream() << "spl " << f.strip_leading(_imp->options.image_dir()) <<
" -> " << g.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
EStripper::on_unknown(const FSEntry & f)
{
- std::cout << "--- " << f.strip_leading(_imp->options.image_dir()) << std::endl;
+ _imp->options.output_manager()->stdout_stream() << "--- " << f.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
@@ -88,7 +88,7 @@ EStripper::on_leave_dir(const FSEntry &)
void
EStripper::strip()
{
- std::cout << ">>> Stripping inside " << _imp->options.image_dir() << std::endl;
+ _imp->options.output_manager()->stdout_stream() << ">>> Stripping inside " << _imp->options.image_dir() << std::endl;
Stripper::strip();
}
diff --git a/paludis/repositories/e/e_stripper.hh b/paludis/repositories/e/e_stripper.hh
index c1dfb51..d0ac489 100644
--- a/paludis/repositories/e/e_stripper.hh
+++ b/paludis/repositories/e/e_stripper.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
@@ -23,6 +23,7 @@
#include <paludis/stripper.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/output_manager-fwd.hh>
#include <tr1/memory>
namespace paludis
@@ -31,6 +32,7 @@ namespace paludis
{
struct debug_dir;
struct image_dir;
+ struct output_manager;
struct package_id;
struct split;
struct strip;
@@ -42,6 +44,7 @@ namespace paludis
{
NamedValue<n::debug_dir, FSEntry> debug_dir;
NamedValue<n::image_dir, FSEntry> image_dir;
+ NamedValue<n::output_manager, std::tr1::shared_ptr<OutputManager> > output_manager;
NamedValue<n::package_id, std::tr1::shared_ptr<const PackageID> > package_id;
NamedValue<n::split, bool> split;
NamedValue<n::strip, bool> strip;
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index 690c1b5..cc715d9 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -56,8 +56,8 @@
#include <paludis/util/instantiation_policy-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/output_manager.hh>
#include <tr1/functional>
-#include <iostream>
#include <fstream>
#include <list>
#include <set>
@@ -644,7 +644,7 @@ EbuildEntries::install(const std::tr1::shared_ptr<const ERepositoryID> & id,
if (can_skip_phase(id, *phase))
{
- std::cout << "--- No need to do anything for " << phase->equal_option("skipname") << " phase" << std::endl;
+ o.output_manager()->stdout_stream() << "--- No need to do anything for " << phase->equal_option("skipname") << " phase" << std::endl;
continue;
}
@@ -693,6 +693,7 @@ EbuildEntries::install(const std::tr1::shared_ptr<const ERepositoryID> & id,
stringify(id->name().package()) + "-" + stringify(id->version())) / "image" / "usr" / libdir / "debug"),
value_for<n::image_dir>(_imp->params.builddir() / (stringify(id->name().category()) + "-" +
stringify(id->name().package()) + "-" + stringify(id->version())) / "image"),
+ value_for<n::output_manager>(o.output_manager()),
value_for<n::package_id>(id),
value_for<n::split>(split_choice && split_choice->enabled()),
value_for<n::strip>(strip_choice && strip_choice->enabled())
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 89d47b0..bd37e7a 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -36,6 +36,7 @@
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/system.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/output_manager.hh>
#include <paludis/distribution.hh>
#include <paludis/environment.hh>
#include <paludis/ndbam.hh>
@@ -46,7 +47,6 @@
#include <paludis/action.hh>
#include <paludis/literal_metadata_key.hh>
#include <tr1/functional>
-#include <iostream>
#include <fstream>
using namespace paludis;
@@ -372,6 +372,7 @@ ExndbamRepository::merge(const MergeParams & m)
value_for<n::image>(m.image_dir()),
value_for<n::install_under>(FSEntry("/")),
value_for<n::options>(m.options()),
+ value_for<n::output_manager>(m.output_manager()),
value_for<n::package_id>(m.package_id()),
value_for<n::root>(installed_root_key()->value())
));
@@ -393,7 +394,7 @@ ExndbamRepository::merge(const MergeParams & m)
if (if_overwritten_id)
{
- perform_uninstall(std::tr1::static_pointer_cast<const ERepositoryID>(if_overwritten_id), true, config_protect);
+ perform_uninstall(std::tr1::static_pointer_cast<const ERepositoryID>(if_overwritten_id), true, config_protect, m.output_manager());
}
if (std::tr1::static_pointer_cast<const ERepositoryID>(m.package_id())
->eapi()->supported()->ebuild_phases()->ebuild_new_upgrade_phase_order())
@@ -404,7 +405,7 @@ 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, "");
+ perform_uninstall(candidate, false, "", m.output_manager());
}
}
@@ -418,7 +419,8 @@ 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
+ bool replace, const std::string & merge_config_protect,
+ const std::tr1::shared_ptr<OutputManager> & output_manager) const
{
Context context("When uninstalling '" + stringify(*id) + (replace ? "' for a reinstall:" : "':"));
@@ -438,7 +440,8 @@ ExndbamRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositor
{
if (can_skip_phase(id, *phase))
{
- std::cout << "--- No need to do anything for " << phase->equal_option("skipname") << " phase" << std::endl;
+ output_manager->stdout_stream() << "--- No need to do anything for " <<
+ phase->equal_option("skipname") << " phase" << std::endl;
continue;
}
@@ -466,6 +469,7 @@ ExndbamRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositor
value_for<n::contents_file>(ver_dir / "contents"),
value_for<n::environment>(_imp->params.environment()),
value_for<n::ndbam>(&_imp->ndbam),
+ value_for<n::output_manager>(output_manager),
value_for<n::package_id>(id),
value_for<n::root>(installed_root_key()->value())
));
diff --git a/paludis/repositories/e/exndbam_repository.hh b/paludis/repositories/e/exndbam_repository.hh
index 6ea44a4..caf6c3c 100644
--- a/paludis/repositories/e/exndbam_repository.hh
+++ b/paludis/repositories/e/exndbam_repository.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
@@ -116,7 +116,8 @@ namespace paludis
///\{
void perform_uninstall(const std::tr1::shared_ptr<const erepository::ERepositoryID> & id,
- bool reinstalling, const std::string & merge_config_protect) const;
+ bool reinstalling, const std::string & merge_config_protect,
+ const std::tr1::shared_ptr<OutputManager> &) const;
///\}
diff --git a/paludis/repositories/e/exndbam_repository_TEST.cc b/paludis/repositories/e/exndbam_repository_TEST.cc
index f5ea42e..7c17f60 100644
--- a/paludis/repositories/e/exndbam_repository_TEST.cc
+++ b/paludis/repositories/e/exndbam_repository_TEST.cc
@@ -130,7 +130,8 @@ namespace test_cases
));
UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
- value_for<n::config_protect>("")
+ value_for<n::config_protect>(""),
+ value_for<n::output_manager>(make_shared_ptr(new StandardOutputManager))
));
TEST_CHECK(exndbam_repo->package_ids(QualifiedPackageName("cat/pkg"))->empty());
diff --git a/paludis/repositories/e/fetch_visitor.cc b/paludis/repositories/e/fetch_visitor.cc
index 005caff..8765978 100644
--- a/paludis/repositories/e/fetch_visitor.cc
+++ b/paludis/repositories/e/fetch_visitor.cc
@@ -36,7 +36,6 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/output_manager.hh>
-#include <iostream>
#include <list>
using namespace paludis;
diff --git a/paludis/repositories/e/qa/manifest.cc b/paludis/repositories/e/qa/manifest.cc
index ad2f967..c5bd695 100644
--- a/paludis/repositories/e/qa/manifest.cc
+++ b/paludis/repositories/e/qa/manifest.cc
@@ -18,7 +18,6 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <iostream>
#include "manifest.hh"
#include <paludis/qa.hh>
#include <paludis/spec_tree.hh>
diff --git a/paludis/repositories/e/vdb_merger.cc b/paludis/repositories/e/vdb_merger.cc
index 8cfbb54..95556cd 100644
--- a/paludis/repositories/e/vdb_merger.cc
+++ b/paludis/repositories/e/vdb_merger.cc
@@ -29,6 +29,7 @@
#include <paludis/util/strip.hh>
#include <paludis/util/options.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/output_manager.hh>
#include <paludis/hook.hh>
#include <paludis/package_id.hh>
#include <paludis/util/md5.hh>
@@ -36,7 +37,6 @@
#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
#include <fstream>
-#include <iostream>
#include <iomanip>
#include <list>
@@ -187,7 +187,7 @@ VDBMerger::on_error(bool is_check, const std::string & s)
make_check_fail();
if (is_check)
- std::cout << "." << std::endl << "!!! " << s << std::endl;
+ _imp->params.output_manager()->stdout_stream() << "." << std::endl << "!!! " << s << std::endl;
else
throw MergerError(s);
}
@@ -270,9 +270,9 @@ VDBMerger::merge()
bool
VDBMerger::check()
{
- std::cout << ">>> Checking whether we can merge to " << _imp->params.root() << " ";
+ _imp->params.output_manager()->stdout_stream() << ">>> Checking whether we can merge to " << _imp->params.root() << " ";
bool result(Merger::check());
- std::cout << std::endl;
+ _imp->params.output_manager()->stdout_stream() << std::endl;
return result;
}
@@ -282,7 +282,7 @@ VDBMerger::on_enter_dir(bool is_check, const FSEntry)
if (! is_check)
return;
- std::cout << "." << std::flush;
+ _imp->params.output_manager()->stdout_stream() << "." << std::flush;
}
void
@@ -320,7 +320,7 @@ VDBMerger::on_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
void
VDBMerger::display_override(const std::string & message) const
{
- std::cout << message << std::endl;
+ _imp->params.output_manager()->stdout_stream() << message << std::endl;
}
std::string
diff --git a/paludis/repositories/e/vdb_merger.hh b/paludis/repositories/e/vdb_merger.hh
index ab694b9..958d0bb 100644
--- a/paludis/repositories/e/vdb_merger.hh
+++ b/paludis/repositories/e/vdb_merger.hh
@@ -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
@@ -23,6 +23,7 @@
#include <paludis/merger.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/output_manager-fwd.hh>
namespace paludis
{
@@ -36,6 +37,7 @@ namespace paludis
struct environment;
struct image;
struct options;
+ struct output_manager;
struct package_id;
struct root;
}
@@ -57,6 +59,7 @@ namespace paludis
NamedValue<n::environment, Environment *> environment;
NamedValue<n::image, FSEntry> image;
NamedValue<n::options, MergerOptions> options;
+ NamedValue<n::output_manager, std::tr1::shared_ptr<OutputManager> > output_manager;
NamedValue<n::package_id, std::tr1::shared_ptr<const PackageID> > package_id;
NamedValue<n::root, FSEntry> root;
};
diff --git a/paludis/repositories/e/vdb_merger_TEST.cc b/paludis/repositories/e/vdb_merger_TEST.cc
index 01d2a82..5f129a0 100644
--- a/paludis/repositories/e/vdb_merger_TEST.cc
+++ b/paludis/repositories/e/vdb_merger_TEST.cc
@@ -22,6 +22,8 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/standard_output_manager.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <fstream>
@@ -83,6 +85,7 @@ namespace
value_for<n::environment>(&env),
value_for<n::image>(FSEntry::cwd() / "vdb_merger_TEST_dir" / what / "image"),
value_for<n::options>(MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs),
+ value_for<n::output_manager>(make_shared_ptr(new StandardOutputManager)),
value_for<n::package_id>(std::tr1::shared_ptr<PackageID>()),
value_for<n::root>(root_dir)
))
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index c6963b0..011802d 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -69,11 +69,11 @@
#include <paludis/util/create_iterator-impl.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/output_manager.hh>
#include <tr1/unordered_map>
#include <tr1/functional>
#include <fstream>
-#include <iostream>
#include <functional>
#include <algorithm>
#include <vector>
@@ -374,7 +374,8 @@ VDBRepositoryKeyReadError::VDBRepositoryKeyReadError(
void
VDBRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositoryID> & id,
- bool reinstalling, const std::string & merge_config_protect) const
+ bool reinstalling, const std::string & merge_config_protect,
+ const std::tr1::shared_ptr<OutputManager> & output_manager) const
{
Context context("When uninstalling '" + stringify(*id) + (reinstalling ? "' for a reinstall:" : "':"));
@@ -399,7 +400,7 @@ VDBRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositoryID>
{
if (can_skip_phase(id, *phase))
{
- std::cout << "--- No need to do anything for " << phase->equal_option("skipname") << " phase" << std::endl;
+ output_manager->stdout_stream() << "--- No need to do anything for " << phase->equal_option("skipname") << " phase" << std::endl;
continue;
}
@@ -425,8 +426,8 @@ VDBRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositoryID>
value_for<n::config_protect>(final_config_protect),
value_for<n::config_protect_mask>(config_protect_mask),
value_for<n::contents_file>(pkg_dir / "CONTENTS"),
-
value_for<n::environment>(_imp->params.environment()),
+ value_for<n::output_manager>(output_manager),
value_for<n::package_id>(id),
value_for<n::root>(installed_root_key()->value())
));
@@ -843,6 +844,7 @@ VDBRepository::merge(const MergeParams & m)
value_for<n::environment>(_imp->params.environment()),
value_for<n::image>(m.image_dir()),
value_for<n::options>(m.options()),
+ value_for<n::output_manager>(m.output_manager()),
value_for<n::package_id>(m.package_id()),
value_for<n::root>(installed_root_key()->value())
));
@@ -876,7 +878,7 @@ VDBRepository::merge(const MergeParams & m)
merger.merge();
if (is_replace)
- perform_uninstall(is_replace, true, config_protect);
+ perform_uninstall(is_replace, true, config_protect, m.output_manager());
if (std::tr1::static_pointer_cast<const ERepositoryID>(m.package_id())
->eapi()->supported()->ebuild_phases()->ebuild_new_upgrade_phase_order())
{
@@ -886,7 +888,7 @@ 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, "");
+ perform_uninstall(candidate, false, "", m.output_manager());
}
}
diff --git a/paludis/repositories/e/vdb_repository.hh b/paludis/repositories/e/vdb_repository.hh
index 20a1d10..01922fb 100644
--- a/paludis/repositories/e/vdb_repository.hh
+++ b/paludis/repositories/e/vdb_repository.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -120,7 +120,8 @@ 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;
+ bool reinstalling, const std::string & merge_config_protect,
+ const std::tr1::shared_ptr<OutputManager> &) const;
/* RepositoryProvidesInterface */
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index 7da42cb..6aa0b65 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -358,7 +358,8 @@ namespace test_cases
));
UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
- value_for<n::config_protect>("")
+ value_for<n::config_protect>(""),
+ value_for<n::output_manager>(make_shared_ptr(new StandardOutputManager))
));
InfoAction info_action;
@@ -475,7 +476,8 @@ namespace test_cases
));
UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
- value_for<n::config_protect>("")
+ value_for<n::config_protect>(""),
+ value_for<n::output_manager>(make_shared_ptr(new StandardOutputManager))
));
InfoAction info_action;
@@ -592,7 +594,8 @@ namespace test_cases
));
UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
- value_for<n::config_protect>("")
+ value_for<n::config_protect>(""),
+ value_for<n::output_manager>(make_shared_ptr(new StandardOutputManager))
));
{
@@ -989,7 +992,8 @@ namespace test_cases
));
UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
- value_for<n::config_protect>("")
+ value_for<n::config_protect>(""),
+ value_for<n::output_manager>(make_shared_ptr(new StandardOutputManager))
));
TEST_CHECK_EQUAL(read_file(provides_cache), "paludis-3\ninstalled\n");
@@ -1319,7 +1323,8 @@ namespace test_cases
));
UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
- value_for<n::config_protect>("")
+ value_for<n::config_protect>(""),
+ value_for<n::output_manager>(make_shared_ptr(new StandardOutputManager))
));
TEST_CHECK(vdb_repo->package_ids(QualifiedPackageName("cat/pkg"))->empty());
diff --git a/paludis/repositories/e/vdb_unmerger.cc b/paludis/repositories/e/vdb_unmerger.cc
index 9103dfe..cbadede 100644
--- a/paludis/repositories/e/vdb_unmerger.cc
+++ b/paludis/repositories/e/vdb_unmerger.cc
@@ -39,12 +39,12 @@ using namespace paludis;
#include <paludis/util/tokeniser.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/output_manager.hh>
#include <list>
#include <map>
#include <vector>
#include <fstream>
-#include <iostream>
namespace paludis
{
@@ -338,7 +338,7 @@ VDBUnmerger::check_dir(const FSEntry & f, const std::tr1::shared_ptr<ExtraInfo>
void
VDBUnmerger::display(const std::string & message) const
{
- std::cout << message << std::endl;
+ _imp->options.output_manager()->stdout_stream() << message << std::endl;
}
VDBUnmergerError::VDBUnmergerError(const std::string & s) throw () :
diff --git a/paludis/repositories/e/vdb_unmerger.hh b/paludis/repositories/e/vdb_unmerger.hh
index e02c6f3..d09aa97 100644
--- a/paludis/repositories/e/vdb_unmerger.hh
+++ b/paludis/repositories/e/vdb_unmerger.hh
@@ -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
* Copyright (c) 2007 Piotr Jaroszyński
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -36,6 +36,7 @@ namespace paludis
struct config_protect_mask;
struct contents_file;
struct environment;
+ struct output_manager;
struct package_id;
struct root;
}
@@ -53,6 +54,7 @@ namespace paludis
NamedValue<n::config_protect_mask, std::string> config_protect_mask;
NamedValue<n::contents_file, FSEntry> contents_file;
NamedValue<n::environment, Environment *> environment;
+ NamedValue<n::output_manager, std::tr1::shared_ptr<OutputManager> > output_manager;
NamedValue<n::package_id, std::tr1::shared_ptr<const PackageID> > package_id;
NamedValue<n::root, FSEntry> root;
};
diff --git a/paludis/repositories/e/vdb_unmerger_TEST.cc b/paludis/repositories/e/vdb_unmerger_TEST.cc
index ac6a19e..02f432b 100644
--- a/paludis/repositories/e/vdb_unmerger_TEST.cc
+++ b/paludis/repositories/e/vdb_unmerger_TEST.cc
@@ -21,6 +21,8 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/standard_output_manager.hh>
+#include <paludis/util/make_shared_ptr.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -72,6 +74,7 @@ namespace
value_for<n::config_protect_mask>("/protected_dir/unprotected_file /protected_dir/unprotected_dir"),
value_for<n::contents_file>("vdb_unmerger_TEST_dir/CONTENTS/" + what),
value_for<n::environment>(&env),
+ value_for<n::output_manager>(make_shared_ptr(new StandardOutputManager)),
value_for<n::package_id>(std::tr1::shared_ptr<PackageID>()),
value_for<n::root>(root_dir)
))
diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc
index a54f62b..2ccd92d 100644
--- a/paludis/repositories/unpackaged/installed_id.cc
+++ b/paludis/repositories/unpackaged/installed_id.cc
@@ -772,9 +772,9 @@ namespace
{
}
- void visit(UninstallAction &)
+ void visit(UninstallAction & a)
{
- id->uninstall(false);
+ id->uninstall(false, a.options.output_manager());
}
};
}
@@ -819,7 +819,7 @@ InstalledUnpackagedID::extra_hash_value() const
}
void
-InstalledUnpackagedID::uninstall(const bool replace) const
+InstalledUnpackagedID::uninstall(const bool replace, const std::tr1::shared_ptr<OutputManager> & output_manager) const
{
Context context("When uninstalling '" + stringify(*this) + "':");
@@ -849,6 +849,7 @@ InstalledUnpackagedID::uninstall(const bool replace) const
value_for<n::contents_file>(ver_dir / "contents"),
value_for<n::environment>(_imp->env),
value_for<n::ndbam>(_imp->ndbam),
+ value_for<n::output_manager>(output_manager),
value_for<n::package_id>(shared_from_this()),
value_for<n::root>(_imp->root)
));
diff --git a/paludis/repositories/unpackaged/installed_id.hh b/paludis/repositories/unpackaged/installed_id.hh
index a62bcdd..e84dd1b 100644
--- a/paludis/repositories/unpackaged/installed_id.hh
+++ b/paludis/repositories/unpackaged/installed_id.hh
@@ -25,6 +25,7 @@
#include <paludis/action-fwd.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/output_manager-fwd.hh>
#include <paludis/ndbam-fwd.hh>
#include <tr1/memory>
@@ -87,7 +88,7 @@ namespace paludis
virtual std::size_t extra_hash_value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- void uninstall(const bool replace) const;
+ void uninstall(const bool replace, const std::tr1::shared_ptr<OutputManager> & output_manager) const;
};
}
}
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 488ab85..9eceab1 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -364,6 +364,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
value_for<n::image>(m.image_dir()),
value_for<n::install_under>(install_under),
value_for<n::options>(MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs),
+ value_for<n::output_manager>(m.output_manager()),
value_for<n::package_id>(m.package_id()),
value_for<n::root>(installed_root_key()->value())
));
@@ -382,7 +383,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
if (if_overwritten_id)
{
- std::tr1::static_pointer_cast<const InstalledUnpackagedID>(if_overwritten_id)->uninstall(true);
+ std::tr1::static_pointer_cast<const InstalledUnpackagedID>(if_overwritten_id)->uninstall(true, m.output_manager());
}
}
diff --git a/paludis/repositories/unpackaged/installed_repository_TEST.cc b/paludis/repositories/unpackaged/installed_repository_TEST.cc
index ea4176c..102a56b 100644
--- a/paludis/repositories/unpackaged/installed_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/installed_repository_TEST.cc
@@ -264,7 +264,8 @@ namespace test_cases
const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::All())]->begin());
UninstallAction action(make_named_values<UninstallActionOptions>(
- value_for<n::config_protect>("")
+ value_for<n::config_protect>(""),
+ value_for<n::output_manager>(make_shared_ptr(new StandardOutputManager))
));
id->perform_action(action);
@@ -315,7 +316,8 @@ namespace test_cases
&env, UserPackageDepSpecOptions()), MatchPackageOptions()))]->begin());
UninstallAction action(make_named_values<UninstallActionOptions>(
- value_for<n::config_protect>("")
+ value_for<n::config_protect>(""),
+ value_for<n::output_manager>(make_shared_ptr(new StandardOutputManager))
));
id->perform_action(action);
@@ -556,7 +558,8 @@ namespace test_cases
}
UninstallAction action(make_named_values<UninstallActionOptions>(
- value_for<n::config_protect>("")
+ value_for<n::config_protect>(""),
+ value_for<n::output_manager>(make_shared_ptr(new StandardOutputManager))
));
(*env[selection::RequireExactlyOne(generator::Matches(
parse_user_package_dep_spec("cat/pkg4a",
@@ -598,7 +601,8 @@ namespace test_cases
}
UninstallAction action(make_named_values<UninstallActionOptions>(
- value_for<n::config_protect>("")
+ value_for<n::config_protect>(""),
+ value_for<n::output_manager>(make_shared_ptr(new StandardOutputManager))
));
(*env[selection::RequireExactlyOne(generator::Matches(
parse_user_package_dep_spec("cat/pkg4b",
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index 9ca31f0..31b7aa9 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -319,6 +319,7 @@ UnpackagedID::perform_action(Action & action) const
UnpackagedStripper stripper(make_named_values<UnpackagedStripperOptions>(
value_for<n::debug_dir>(fs_location_key()->value() / "usr" / libdir / "debug"),
value_for<n::image_dir>(fs_location_key()->value()),
+ value_for<n::output_manager>(install_action->options.output_manager()),
value_for<n::package_id>(shared_from_this()),
value_for<n::split>(split_choice && split_choice->enabled()),
value_for<n::strip>(strip_choice && strip_choice->enabled())
diff --git a/paludis/repositories/unpackaged/unpackaged_stripper.cc b/paludis/repositories/unpackaged/unpackaged_stripper.cc
index 29b89e3..7099741 100644
--- a/paludis/repositories/unpackaged/unpackaged_stripper.cc
+++ b/paludis/repositories/unpackaged/unpackaged_stripper.cc
@@ -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
@@ -21,7 +21,7 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/make_named_values.hh>
-#include <iostream>
+#include <paludis/util/output_manager.hh>
using namespace paludis;
using namespace paludis::unpackaged_repositories;
@@ -59,20 +59,20 @@ UnpackagedStripper::~UnpackagedStripper()
void
UnpackagedStripper::on_strip(const FSEntry & f)
{
- std::cout << "str " << f.strip_leading(_imp->options.image_dir()) << std::endl;
+ _imp->options.output_manager()->stdout_stream() << "str " << f.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
UnpackagedStripper::on_split(const FSEntry & f, const FSEntry & g)
{
- std::cout << "spl " << f.strip_leading(_imp->options.image_dir()) <<
+ _imp->options.output_manager()->stdout_stream() << "spl " << f.strip_leading(_imp->options.image_dir()) <<
" -> " << g.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
UnpackagedStripper::on_unknown(const FSEntry & f)
{
- std::cout << "--- " << f.strip_leading(_imp->options.image_dir()) << std::endl;
+ _imp->options.output_manager()->stdout_stream() << "--- " << f.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
@@ -88,7 +88,7 @@ UnpackagedStripper::on_leave_dir(const FSEntry &)
void
UnpackagedStripper::strip()
{
- std::cout << ">>> Stripping inside " << _imp->options.image_dir() << std::endl;
+ _imp->options.output_manager()->stdout_stream() << ">>> Stripping inside " << _imp->options.image_dir() << std::endl;
Stripper::strip();
}
diff --git a/paludis/repositories/unpackaged/unpackaged_stripper.hh b/paludis/repositories/unpackaged/unpackaged_stripper.hh
index 9d32c51..8f6917e 100644
--- a/paludis/repositories/unpackaged/unpackaged_stripper.hh
+++ b/paludis/repositories/unpackaged/unpackaged_stripper.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/stripper.hh>
#include <paludis/package_id-fwd.hh>
+#include <paludis/util/output_manager-fwd.hh>
#include <tr1/memory>
namespace paludis
@@ -30,6 +31,7 @@ namespace paludis
{
struct debug_dir;
struct image_dir;
+ struct output_manager;
struct package_id;
struct split;
struct strip;
@@ -41,6 +43,7 @@ namespace paludis
{
NamedValue<n::debug_dir, FSEntry> debug_dir;
NamedValue<n::image_dir, FSEntry> image_dir;
+ NamedValue<n::output_manager, std::tr1::shared_ptr<OutputManager> > output_manager;
NamedValue<n::package_id, std::tr1::shared_ptr<const PackageID> > package_id;
NamedValue<n::split, bool> split;
NamedValue<n::strip, bool> strip;
diff --git a/paludis/sohooks_TEST.cc b/paludis/sohooks_TEST.cc
index 7395a86..727698f 100644
--- a/paludis/sohooks_TEST.cc
+++ b/paludis/sohooks_TEST.cc
@@ -23,7 +23,6 @@
#include <paludis/util/graph-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/make_named_values.hh>
-#include <iostream>
#include <fstream>
using namespace paludis;
diff --git a/paludis/uninstall_task.cc b/paludis/uninstall_task.cc
index 0649730..ae45f93 100644
--- a/paludis/uninstall_task.cc
+++ b/paludis/uninstall_task.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2006, 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
@@ -35,6 +35,7 @@
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/options.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/standard_output_manager.hh>
#include <paludis/package_database.hh>
#include <paludis/hook.hh>
#include <paludis/dep_tag.hh>
@@ -359,7 +360,8 @@ UninstallTask::execute()
{
UninstallAction uninstall_action(
make_named_values<UninstallActionOptions>(
- value_for<n::config_protect>("")
+ value_for<n::config_protect>(""),
+ value_for<n::output_manager>(make_shared_ptr(new StandardOutputManager))
));
i->package_id()->perform_action(uninstall_action);
}
diff --git a/python/action.cc b/python/action.cc
index bd6aa3d..b725160 100644
--- a/python/action.cc
+++ b/python/action.cc
@@ -75,7 +75,8 @@ namespace
const std::string & c)
{
return new UninstallActionOptions(make_named_values<UninstallActionOptions>(
- value_for<n::config_protect>(c)
+ value_for<n::config_protect>(c),
+ value_for<n::output_manager>(make_shared_ptr(new StandardOutputManager))
));
}
diff --git a/ruby/action.cc b/ruby/action.cc
index 457d428..78bb1d4 100644
--- a/ruby/action.cc
+++ b/ruby/action.cc
@@ -601,7 +601,8 @@ namespace
}
ptr = new UninstallActionOptions(make_named_values<UninstallActionOptions>(
- value_for<n::config_protect>(v_config_protect)
+ value_for<n::config_protect>(v_config_protect),
+ value_for<n::output_manager>(make_shared_ptr(new StandardOutputManager))
));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<UninstallActionOptions>::free, ptr));