diff options
author | Thierry Vignaud <tv@mageia.org> | 2011-09-17 10:32:08 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2011-09-17 10:32:08 +0000 |
commit | 26aa4a913080d42300efc8ae7d9fdc31ba32f060 (patch) | |
tree | d859fc42c73586286293068b94fd96a43ae32543 | |
parent | ff635338fe2414f1f79590f48b1fe7124f534c39 (diff) | |
download | urpmi-26aa4a913080d42300efc8ae7d9fdc31ba32f060.tar urpmi-26aa4a913080d42300efc8ae7d9fdc31ba32f060.tar.gz urpmi-26aa4a913080d42300efc8ae7d9fdc31ba32f060.tar.bz2 urpmi-26aa4a913080d42300efc8ae7d9fdc31ba32f060.tar.xz urpmi-26aa4a913080d42300efc8ae7d9fdc31ba32f060.zip |
(_get_now_orphans_raw_msg) split it out of get_now_orphans_msg()
(needed for next commit)
-rw-r--r-- | urpm/orphans.pm | 12 |
1 files changed, 10 insertions, 2 deletions
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"; } |