aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-08-17 13:07:37 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-08-17 13:07:37 +0000
commit01ae9f3a6e912d9b7802ef5f6ea35e41cf352dbf (patch)
tree02126fb04908b0870728409fe4f98de9cad8a437
parente0a697daf08d3d769a058b5ab0220a05fb1aa215 (diff)
downloadpaludis-01ae9f3a6e912d9b7802ef5f6ea35e41cf352dbf.tar.gz
paludis-01ae9f3a6e912d9b7802ef5f6ea35e41cf352dbf.tar.xz
Display virtual and real package total counts separately
-rw-r--r--src/paludis/install.cc125
1 files changed, 113 insertions, 12 deletions
diff --git a/src/paludis/install.cc b/src/paludis/install.cc
index d4632de..8bd812f 100644
--- a/src/paludis/install.cc
+++ b/src/paludis/install.cc
@@ -67,7 +67,10 @@ namespace
{
private:
int _current_count, _max_count, _new_count, _upgrade_count,
- _downgrade_count, _new_slot_count, _rebuild_count;
+ _downgrade_count, _new_slot_count, _rebuild_count,
+ _current_virtual_count, _max_virtual_count, _new_virtual_count,
+ _upgrade_virtual_count, _downgrade_virtual_count,
+ _new_slot_virtual_count, _rebuild_virtual_count;
std::set<DepTag::ConstPointer, DepTag::Comparator> _all_tags;
@@ -80,7 +83,14 @@ namespace
_upgrade_count(0),
_downgrade_count(0),
_new_slot_count(0),
- _rebuild_count(0)
+ _rebuild_count(0),
+ _current_virtual_count(0),
+ _max_virtual_count(0),
+ _new_virtual_count(0),
+ _upgrade_virtual_count(0),
+ _downgrade_virtual_count(0),
+ _new_slot_virtual_count(0),
+ _rebuild_virtual_count(0)
{
}
@@ -232,6 +242,11 @@ namespace
Log::get_instance()->message(ll_warning, lc_no_context,
"Max count doesn't add up. This is a bug!");
+ if (_max_virtual_count != _new_virtual_count + _upgrade_virtual_count +
+ _downgrade_virtual_count + _new_slot_virtual_count + _rebuild_virtual_count)
+ Log::get_instance()->message(ll_warning, lc_no_context,
+ "Max virtuals count doesn't add up. This is a bug!");
+
cout << endl << "Total: " << _max_count << (_max_count == 1 ? " package" : " packages");
if (_max_count)
{
@@ -272,6 +287,51 @@ namespace
}
cout << ")";
}
+
+ if (_max_virtual_count)
+ {
+ cout << " and " << _max_virtual_count << (_max_virtual_count == 1
+ ? " virtual" : " virtuals");
+ bool need_comma(false);
+ cout << " (";
+ if (_new_virtual_count)
+ {
+ cout << _new_virtual_count << " new";
+ need_comma = true;
+ }
+ if (_upgrade_virtual_count)
+ {
+ if (need_comma)
+ cout << ", ";
+ cout << _upgrade_virtual_count << (_upgrade_virtual_count == 1 ? " upgrade" : " upgrades");
+ need_comma = true;
+ }
+ if (_downgrade_virtual_count)
+ {
+ if (need_comma)
+ cout << ", ";
+ cout << _downgrade_virtual_count << (_downgrade_virtual_count == 1 ?
+ " downgrade" : " downgrades");
+ need_comma = true;
+ }
+ if (_new_slot_virtual_count)
+ {
+ if (need_comma)
+ cout << ", ";
+ cout << _new_slot_virtual_count << (_new_slot_virtual_count == 1 ?
+ " in new slot" : " in new slots");
+ need_comma = true;
+ }
+ if (_rebuild_virtual_count)
+ {
+ if (need_comma)
+ cout << ", ";
+ cout << _rebuild_virtual_count << (_rebuild_virtual_count == 1 ?
+ " rebuild" : " rebuilds");
+ need_comma = true;
+ }
+ cout << ")";
+ }
cout << endl << endl;
if (CommandLine::get_instance()->a_pretend.specified() && ! _all_tags.empty())
@@ -342,8 +402,16 @@ namespace
if (existing->empty())
{
cout << colour(cl_updatemode, " [N]");
- ++_new_count;
- ++_max_count;
+ if (d.metadata->get_virtual_interface())
+ {
+ ++_new_virtual_count;
+ ++_max_virtual_count;
+ }
+ else
+ {
+ ++_new_count;
+ ++_max_count;
+ }
}
else
{
@@ -354,28 +422,61 @@ namespace
if (existing->empty())
{
cout << colour(cl_updatemode, " [S]");
- ++_new_slot_count;
- ++_max_count;
+ if (d.metadata->get_virtual_interface())
+ {
+ ++_new_slot_virtual_count;
+ ++_max_virtual_count;
+ }
+ else
+ {
+ ++_new_slot_count;
+ ++_max_count;
+ }
}
else if (existing->last()->version < d.version)
{
cout << colour(cl_updatemode, " [U " + stringify(
existing->last()->version) + "]");
- ++_upgrade_count;
- ++_max_count;
+ if (d.metadata->get_virtual_interface())
+ {
+ ++_upgrade_virtual_count;
+ ++_max_virtual_count;
+ }
+ else
+ {
+ ++_upgrade_count;
+ ++_max_count;
+ }
}
else if (existing->last()->version > d.version)
{
cout << colour(cl_updatemode, " [D " + stringify(
existing->last()->version) + "]");
- ++_downgrade_count;
- ++_max_count;
+ if (d.metadata->get_virtual_interface())
+ {
+ ++_downgrade_virtual_count;
+ ++_max_virtual_count;
+ }
+ else
+ {
+ ++_downgrade_count;
+ ++_max_count;
+ }
+
}
else
{
cout << colour(cl_updatemode, " [R]");
- ++_rebuild_count;
- ++_max_count;
+ if (d.metadata->get_virtual_interface())
+ {
+ ++_rebuild_virtual_count;
+ ++_max_virtual_count;
+ }
+ else
+ {
+ ++_rebuild_count;
+ ++_max_count;
+ }
}
}