aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/unpackaged
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 /paludis/repositories/unpackaged
parent7baffcaec4696b62b10ca39cd22d59cc87b20ad6 (diff)
downloadpaludis-fc4695c629f9cf2b5727d32b451cbfa081f97836.tar.gz
paludis-fc4695c629f9cf2b5727d32b451cbfa081f97836.tar.xz
Use output manager
Diffstat (limited to 'paludis/repositories/unpackaged')
-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
7 files changed, 27 insertions, 16 deletions
diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc
index a54f62be9..2ccd92d54 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 a62bcddc9..e84dd1b6a 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 488ab85c0..9eceab163 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 ea4176cb7..102a56bef 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 9ca31f090..31b7aa9dd 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 29b89e388..709974169 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 9d32c5168..8f6917e81 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;