aboutsummaryrefslogtreecommitdiff
path: root/paludis/environments/paludis/world.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-11 09:53:50 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-11 09:53:50 +0100
commitf7b0e96673665c71c518601ee257822163a47452 (patch)
treeaa08a0bfd317863465d740839ebabe8d8cc1e0e0 /paludis/environments/paludis/world.cc
parentf43ee8ee592a57d79f5f9eff75ac58fe7b223199 (diff)
downloadpaludis-f7b0e96673665c71c518601ee257822163a47452.tar.gz
paludis-f7b0e96673665c71c518601ee257822163a47452.tar.xz
Return whether world was changed.
Diffstat (limited to 'paludis/environments/paludis/world.cc')
-rw-r--r--paludis/environments/paludis/world.cc26
1 files changed, 14 insertions, 12 deletions
diff --git a/paludis/environments/paludis/world.cc b/paludis/environments/paludis/world.cc
index 02e1841e2..db580f031 100644
--- a/paludis/environments/paludis/world.cc
+++ b/paludis/environments/paludis/world.cc
@@ -59,31 +59,31 @@ World::~World()
{
}
-void
+bool
World::add_to_world(const SetName & s) const
{
- _add_string_to_world(stringify(s));
+ return _add_string_to_world(stringify(s));
}
-void
+bool
World::add_to_world(const QualifiedPackageName & q) const
{
- _add_string_to_world(stringify(q));
+ return _add_string_to_world(stringify(q));
}
-void
+bool
World::remove_from_world(const SetName & s) const
{
- _remove_string_from_world(stringify(s));
+ return _remove_string_from_world(stringify(s));
}
-void
+bool
World::remove_from_world(const QualifiedPackageName & q) const
{
- _remove_string_from_world(stringify(q));
+ return _remove_string_from_world(stringify(q));
}
-void
+bool
World::_add_string_to_world(const std::string & n) const
{
using namespace std::tr1::placeholders;
@@ -94,7 +94,7 @@ World::_add_string_to_world(const std::string & n) const
<< "Not adding '" << n << "' to world because "
"no world file has been configured. If you have recently upgraded from <paludis-0.26.0_alpha13, consult "
"the FAQ Upgrades section.";
- return;
+ return false;
}
Lock l(_imp->mutex);
@@ -111,7 +111,7 @@ World::_add_string_to_world(const std::string & n) const
{
Log::get_instance()->message("paludis_environment.world.cannot_create", ll_warning, lc_no_context)
<< "Cannot create world file '" << *_imp->maybe_world_file << "': '" << e.message() << "' (" << e.what() << ")";
- return;
+ return false;
}
}
@@ -123,8 +123,10 @@ World::_add_string_to_world(const std::string & n) const
n::tag() = std::tr1::shared_ptr<DepTag>(),
n::type() = sft_simple
));
- world.add(n);
+ bool result(world.add(n));
world.rewrite();
+
+ return result;
}
bool