aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-16 20:09:47 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-16 20:09:47 +0000
commit97bf1531eb576ab0dace6947da0ffbde1e4ec0f1 (patch)
treef602384e6f5e0cbf7a9b6ee6fb04fbd3ec80c4e0
parent919d8bb5890d4aab898dc9c6f29015eeacc3d195 (diff)
downloadpaludis-97bf1531eb576ab0dace6947da0ffbde1e4ec0f1.tar.gz
paludis-97bf1531eb576ab0dace6947da0ffbde1e4ec0f1.tar.xz
Experimental resume command support
-rw-r--r--paludis/tasks/install_task.cc19
-rw-r--r--paludis/tasks/install_task.hh10
-rw-r--r--src/paludis/install.cc11
3 files changed, 40 insertions, 0 deletions
diff --git a/paludis/tasks/install_task.cc b/paludis/tasks/install_task.cc
index 0b24a0f..b788d0f 100644
--- a/paludis/tasks/install_task.cc
+++ b/paludis/tasks/install_task.cc
@@ -33,6 +33,7 @@ namespace paludis
{
Environment * const env;
DepList dep_list;
+ DepList::Iterator current_dep_list_entry;
InstallOptions install_options;
std::list<std::string> raw_targets;
@@ -47,6 +48,7 @@ namespace paludis
Implementation<InstallTask>(Environment * const e) :
env(e),
dep_list(e),
+ current_dep_list_entry(dep_list.begin()),
install_options(false, false),
targets(new AllDepAtom),
pretend(false),
@@ -231,7 +233,10 @@ InstallTask::execute()
/* display our task list */
for (DepList::Iterator dep(_imp->dep_list.begin()), dep_end(_imp->dep_list.end()) ;
dep != dep_end ; ++dep)
+ {
+ _imp->current_dep_list_entry = dep;
on_display_merge_list_entry(*dep);
+ }
/* we're done displaying our task list */
on_display_merge_list_post();
@@ -261,6 +266,8 @@ InstallTask::execute()
for (DepList::Iterator dep(_imp->dep_list.begin()), dep_end(_imp->dep_list.end()) ;
dep != dep_end ; ++dep)
{
+ _imp->current_dep_list_entry = dep;
+
std::string cpvr(stringify(dep->name) + "-" +
stringify(dep->version) + "::" +
stringify(dep->repository));
@@ -402,3 +409,15 @@ InstallTask::execute()
}
}
+const DepList &
+InstallTask::dep_list() const
+{
+ return _imp->dep_list;
+}
+
+DepList::Iterator
+InstallTask::current_dep_list_entry() const
+{
+ return _imp->current_dep_list_entry;
+}
+
diff --git a/paludis/tasks/install_task.hh b/paludis/tasks/install_task.hh
index a818645..9d7c90f 100644
--- a/paludis/tasks/install_task.hh
+++ b/paludis/tasks/install_task.hh
@@ -132,6 +132,16 @@ namespace paludis
* Run the task.
*/
void execute();
+
+ /**
+ * Fetch our deplist.
+ */
+ const DepList & dep_list() const;
+
+ /**
+ * Fetch our current deplist entry.
+ */
+ DepList::Iterator current_dep_list_entry() const;
};
}
diff --git a/src/paludis/install.cc b/src/paludis/install.cc
index 5c8dd3b..4013077 100644
--- a/src/paludis/install.cc
+++ b/src/paludis/install.cc
@@ -566,6 +566,17 @@ do_install()
cerr << "Install error:" << endl;
cerr << " * " << e.backtrace("\n * ");
cerr << e.message() << endl;
+ cerr << endl;
+ if (task.current_dep_list_entry() != task.dep_list().end())
+ {
+ cerr << "Resume command: " << DefaultEnvironment::get_instance()->paludis_command() <<
+ " --install --preserve-world --dl-drop-all --dl-no-recursive-deps";
+ for (DepList::Iterator i(task.current_dep_list_entry()), i_end(task.dep_list().end()) ;
+ i != i_end ; ++i)
+ cerr << " =" << i->name << "-" << i->version << "::" << i->repository;
+ cerr << endl;
+ }
+ cerr << endl;
return_code |= 1;
}