aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-11 21:29:16 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-11 21:29:16 +0000
commit0338bfc39a4a1c9d04cb5077d65edd8019785c50 (patch)
tree264362c69a05ba8deb21bd0996eabb1164ec7073
parent5b88d3a5f606f15259e3c14b0ac416df43d4f0df (diff)
downloadpaludis-0338bfc39a4a1c9d04cb5077d65edd8019785c50.tar.gz
paludis-0338bfc39a4a1c9d04cb5077d65edd8019785c50.tar.xz
Don't try to reinstall everything in system with --install system. Only update things that need updating.
-rw-r--r--paludis/dep_list.cc10
-rw-r--r--paludis/dep_list.hh5
-rw-r--r--src/install.cc8
3 files changed, 20 insertions, 3 deletions
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index bb116c3..5b68b1d 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -109,6 +109,7 @@ namespace paludis
bool drop_self_circular;
bool drop_all;
bool ignore_installed;
+ bool reinstall;
///}
///\name Stack
@@ -129,6 +130,7 @@ namespace paludis
drop_self_circular(false),
drop_all(false),
ignore_installed(false),
+ reinstall(true),
stack_depth(0),
max_stack_depth(100)
{
@@ -366,7 +368,7 @@ DepList::visit(const PackageDepAtom * const p)
/* if we're already installed, only include us if we're a better version or
* if we're a top level target */
/// \todo SLOTs?
- if ((! _imp->ignore_installed) && (0 != _imp->current_package))
+ if ((! _imp->ignore_installed) && ((0 != _imp->current_package) || (! _imp->reinstall)))
if (! installed->empty())
if (e->get<pde_version>() <= installed->last()->get<pde_version>())
continue;
@@ -690,3 +692,9 @@ DepList::visit(const PlainTextDepAtom * const t)
throw InternalError(PALUDIS_HERE, "Got unexpected PlainTextDepAtom '" + t->text() + "'");
}
+void
+DepList::set_reinstall(const bool value)
+{
+ _imp->reinstall = value;
+}
+
diff --git a/paludis/dep_list.hh b/paludis/dep_list.hh
index 864c2ef..48ef770 100644
--- a/paludis/dep_list.hh
+++ b/paludis/dep_list.hh
@@ -312,6 +312,11 @@ namespace paludis
* Behaviour: set the maximum stack depth.
*/
void set_max_stack_depth(const int value);
+
+ /**
+ * Behaviour: set whether we reinstall first level deps.
+ */
+ void set_reinstall(const bool value);
};
}
diff --git a/src/install.cc b/src/install.cc
index 128d805..fc4af0d 100644
--- a/src/install.cc
+++ b/src/install.cc
@@ -44,6 +44,8 @@ do_install()
p::CompositeDepAtom::Pointer targets(new p::AllDepAtom);
+ p::DepList dep_list(env);
+
try
{
CommandLine::ParametersIterator q(CommandLine::get_instance()->begin_parameters()),
@@ -79,6 +81,9 @@ do_install()
if (had_set_targets && had_pkg_targets)
throw DoHelp("You should not specify set and package targets at the same time.");
+
+ if (had_set_targets)
+ dep_list.set_reinstall(false);
}
catch (const p::AmbiguousPackageNameError & e)
{
@@ -93,7 +98,6 @@ do_install()
return 1;
}
- p::DepList dep_list(env);
dep_list.set_drop_self_circular(CommandLine::get_instance()->a_dl_drop_self_circular.specified());
dep_list.set_drop_circular(CommandLine::get_instance()->a_dl_drop_circular.specified());
dep_list.set_drop_all(CommandLine::get_instance()->a_dl_drop_all.specified());
@@ -241,7 +245,7 @@ do_install()
bool need_comma(false);
p::MaskReasons m(env->mask_reasons(*pp));
- for (int mm = 0 ; mm < m.size() ; ++mm)
+ for (unsigned mm = 0 ; mm < m.size() ; ++mm)
if (m[mm])
{
if (need_comma)