From 26aa4a913080d42300efc8ae7d9fdc31ba32f060 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sat, 17 Sep 2011 10:32:08 +0000 Subject: (_get_now_orphans_raw_msg) split it out of get_now_orphans_msg() (needed for next commit) --- urpm/orphans.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'urpm') diff --git a/urpm/orphans.pm b/urpm/orphans.pm index f2363bc2..6109b967 100644 --- a/urpm/orphans.pm +++ b/urpm/orphans.pm @@ -431,15 +431,23 @@ sub get_orphans { my ($req, $unreq) = _installed_req_and_unreq($urpm); _all_unrequested_orphans($req, $unreq); } -sub get_now_orphans_msg { + +sub _get_now_orphans_raw_msg { my ($urpm) = @_; my $orphans = get_orphans($urpm); my @orphans = map { scalar $_->fullname } @$orphans or return ''; + (scalar(@orphans), add_leading_spaces(join("\n", sort @orphans))); +} + +sub get_now_orphans_msg { + my ($urpm) = @_; + + my ($count, $list) = _get_now_orphans_raw_msg($urpm); P("The following package:\n%s\nis now orphaned, if you wish to remove it, you can use \"urpme --auto-orphans\"", "The following packages:\n%s\nare now orphaned, if you wish to remove them, you can use \"urpme --auto-orphans\"", - scalar(@orphans), add_leading_spaces(join("\n", sort @orphans))) . "\n"; + $count, $list) . "\n"; } -- cgit v1.2.1