aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Stephen P. Bennett <spb@exherbo.org> 2007-05-06 00:22:19 +0000
committerAvatar Stephen P. Bennett <spb@exherbo.org> 2007-05-06 00:22:19 +0000
commitb318ebdf21c53036f6a2170b4758b5eea22892bf (patch)
tree0dd7f60c8b861d424223c56c08a5896e08cffae7
parent01ea53fd4b6bfe88baef9a200d4756769fc6a1a9 (diff)
downloadpaludis-b318ebdf21c53036f6a2170b4758b5eea22892bf.tar.gz
paludis-b318ebdf21c53036f6a2170b4758b5eea22892bf.tar.xz
Set xterm titles to a meaningful failure message should the install process abort
-rw-r--r--paludis/tasks/install_task.cc2
-rw-r--r--paludis/tasks/install_task.hh3
-rw-r--r--src/output/console_install_task.cc16
-rw-r--r--src/output/console_install_task.hh3
4 files changed, 24 insertions, 0 deletions
diff --git a/paludis/tasks/install_task.cc b/paludis/tasks/install_task.cc
index 4643de0..cafce67 100644
--- a/paludis/tasks/install_task.cc
+++ b/paludis/tasks/install_task.cc
@@ -290,6 +290,7 @@ InstallTask::execute()
}
catch (const PackageInstallActionError & e)
{
+ on_install_fail(*dep);
int PALUDIS_ATTRIBUTE((unused)) dummy(perform_hook(Hook("install_fail")("TARGET", cpvr)("MESSAGE", e.message())));
throw;
}
@@ -387,6 +388,7 @@ InstallTask::execute()
}
catch (const PackageUninstallActionError & e)
{
+ on_clean_fail(*dep, *c);
int PALUDIS_ATTRIBUTE((unused)) dummy(perform_hook(Hook("clean_fail")("TARGET", stringify(*c))("MESSAGE", e.message())));
throw;
}
diff --git a/paludis/tasks/install_task.hh b/paludis/tasks/install_task.hh
index a64aa72..84639b7 100644
--- a/paludis/tasks/install_task.hh
+++ b/paludis/tasks/install_task.hh
@@ -108,6 +108,7 @@ namespace paludis
virtual void on_install_all_pre() = 0;
virtual void on_install_pre(const DepListEntry &) = 0;
virtual void on_install_post(const DepListEntry &) = 0;
+ virtual void on_install_fail(const DepListEntry &) = 0;
virtual void on_install_all_post() = 0;
virtual void on_no_clean_needed(const DepListEntry &) = 0;
@@ -117,6 +118,8 @@ namespace paludis
const PackageDatabaseEntry &) = 0;
virtual void on_clean_post(const DepListEntry &,
const PackageDatabaseEntry &) = 0;
+ virtual void on_clean_fail(const DepListEntry &,
+ const PackageDatabaseEntry &) = 0;
virtual void on_clean_all_post(const DepListEntry &,
const PackageDatabaseEntryCollection &) = 0;
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index 0171349..633f659 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -137,6 +137,14 @@ ConsoleInstallTask::on_clean_post(const DepListEntry &,
}
void
+ConsoleInstallTask::on_clean_fail(const DepListEntry &,
+ const PackageDatabaseEntry & c)
+{
+ output_xterm_title("(" + stringify(count<current_count>()) + " of "
+ + stringify(count<max_count>()) + ") Failed cleaning " + stringify(c));
+}
+
+void
ConsoleInstallTask::on_clean_all_post(const DepListEntry &,
const PackageDatabaseEntryCollection &)
{
@@ -301,8 +309,16 @@ ConsoleInstallTask::on_install_post(const DepListEntry &)
}
void
+ConsoleInstallTask::on_install_fail(const DepListEntry & d)
+{
+ output_xterm_title("(" + stringify(count<current_count>()) + "of "
+ + stringify(count<max_count>()) + ") Failed install of " + stringify(d.package));
+}
+
+void
ConsoleInstallTask::on_install_all_post()
{
+ output_xterm_title("Completed install");
}
void
diff --git a/src/output/console_install_task.hh b/src/output/console_install_task.hh
index e24d5c3..4f5bc36 100644
--- a/src/output/console_install_task.hh
+++ b/src/output/console_install_task.hh
@@ -144,6 +144,7 @@ namespace paludis
virtual void on_install_all_pre();
virtual void on_install_pre(const DepListEntry &);
virtual void on_install_post(const DepListEntry &);
+ virtual void on_install_fail(const DepListEntry &);
virtual void on_install_all_post();
virtual void on_no_clean_needed(const DepListEntry &);
@@ -153,6 +154,8 @@ namespace paludis
const PackageDatabaseEntry &);
virtual void on_clean_post(const DepListEntry &,
const PackageDatabaseEntry &);
+ virtual void on_clean_fail(const DepListEntry &,
+ const PackageDatabaseEntry &);
virtual void on_clean_all_post(const DepListEntry &,
const PackageDatabaseEntryCollection &);