aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Stephen P. Bennett <spb@exherbo.org> 2006-03-25 23:36:38 +0000
committerAvatar Stephen P. Bennett <spb@exherbo.org> 2006-03-25 23:36:38 +0000
commit6354722b8d87a2c63ae40be0f9eb2b3ac6d8f0c8 (patch)
treefe5144289273e68ffba0ab62d73b7aa98012b164
parenta59d7525d94a461d57fb84139af41e417def2268 (diff)
downloadpaludis-6354722b8d87a2c63ae40be0f9eb2b3ac6d8f0c8.tar.gz
paludis-6354722b8d87a2c63ae40be0f9eb2b3ac6d8f0c8.tar.xz
xterm titles. look at the shiny.
-rw-r--r--src/colour.hh9
-rw-r--r--src/install.cc11
2 files changed, 18 insertions, 2 deletions
diff --git a/src/colour.hh b/src/colour.hh
index f6beb41..6595a87 100644
--- a/src/colour.hh
+++ b/src/colour.hh
@@ -56,4 +56,13 @@ std::string colour(Colour colour, const T_ & s)
+ "\033[0;0m";
}
+template <typename T_>
+std::string xterm_title(const T_ & s)
+{
+ if (CommandLine::get_instance()->a_no_color.specified() || ! use_colour())
+ return "";
+ else
+ return "\x1b]2;" + paludis::stringify(s) + "\x07";
+}
+
#endif
diff --git a/src/install.cc b/src/install.cc
index 051b6df..6dd5f92 100644
--- a/src/install.cc
+++ b/src/install.cc
@@ -121,12 +121,19 @@ do_install()
if (CommandLine::get_instance()->a_pretend.specified())
return return_code;
+ int current_count = 0, max_count = std::distance(dep_list.begin(), dep_list.end());
+
for (p::DepList::Iterator dep(dep_list.begin()), dep_end(dep_list.end()) ;
dep != dep_end ; ++dep)
{
+ std::string cpv = p::stringify(dep->get<p::dle_name>()) + "-" + p::stringify(dep->get<p::dle_version>());
+
cout << endl << colour(cl_heading,
- "Installing " + p::stringify(dep->get<p::dle_name>()) + "-"
- + p::stringify(dep->get<p::dle_version>())) << endl << endl;
+ "Installing " + cpv) << endl << endl;
+
+ // TODO: some way to reset this properly would be nice.
+ cerr << xterm_title("(" + p::stringify(++current_count) + " of " + p::stringify(max_count) + ") Installing " + cpv);
+
env->package_database()->fetch_repository(dep->get<p::dle_repository>())->
install(dep->get<p::dle_name>(), dep->get<p::dle_version>());