aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-13 21:31:55 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-13 21:31:55 +0000
commit64a8c1bd5e095ecca189654173410f571737753c (patch)
treec7e1486c027b201247bc499a16cb87db682bd5e4
parent7877f458e1d72ce41217b57cc4a80e14eec4f0b8 (diff)
downloadpaludis-64a8c1bd5e095ecca189654173410f571737753c.tar.gz
paludis-64a8c1bd5e095ecca189654173410f571737753c.tar.xz
Support --preserve-world
-rw-r--r--src/command_line.cc1
-rw-r--r--src/command_line.hh3
-rw-r--r--src/install.cc3
-rw-r--r--src/uninstall.cc2
4 files changed, 8 insertions, 1 deletions
diff --git a/src/command_line.cc b/src/command_line.cc
index 7235c88..4ef9388 100644
--- a/src/command_line.cc
+++ b/src/command_line.cc
@@ -55,6 +55,7 @@ CommandLine::CommandLine() :
install_args(this, "Install, Uninstall options"),
a_pretend(&install_args, "pretend", 'p', "Pretend only"),
+ a_preserve_world(&install_args, "preserve-world", '1', "Don't modify the world file"),
dl_args(this, "DepList behaviour (use with caution)"),
a_dl_rdepend_post(&dl_args, "dl-rdepend-post", '\0', "Treat RDEPEND like PDEPEND",
diff --git a/src/command_line.hh b/src/command_line.hh
index f0a748e..4ae643b 100644
--- a/src/command_line.hh
+++ b/src/command_line.hh
@@ -137,6 +137,9 @@ class CommandLine :
/// --pretend
paludis::args::SwitchArg a_pretend;
+ /// --preserve-world
+ paludis::args::SwitchArg a_preserve_world;
+
/// }
/// \name DepList behaviour arguments
diff --git a/src/install.cc b/src/install.cc
index a3e3deb..1045708 100644
--- a/src/install.cc
+++ b/src/install.cc
@@ -85,7 +85,8 @@ do_install()
if (had_set_targets)
dep_list.set_reinstall(false);
else if (! CommandLine::get_instance()->a_pretend.specified())
- env->add_appropriate_to_world(targets);
+ if (! CommandLine::get_instance()->a_preserve_world.specified())
+ env->add_appropriate_to_world(targets);
}
catch (const p::AmbiguousPackageNameError & e)
{
diff --git a/src/uninstall.cc b/src/uninstall.cc
index b64f270..affc83a 100644
--- a/src/uninstall.cc
+++ b/src/uninstall.cc
@@ -97,11 +97,13 @@ do_uninstall()
if (CommandLine::get_instance()->a_pretend.specified())
return return_code;
+ if (! CommandLine::get_instance()->a_preserve_world.specified())
{
p::AllDepAtom::Pointer all(new p::AllDepAtom);
for (std::list<p::PackageDepAtom::Pointer>::const_iterator t(targets.begin()),
t_end(targets.end()) ; t != t_end ; ++t)
all->add_child(*t);
+
env->remove_appropriate_from_world(all);
}