summaryrefslogtreecommitdiffstats
path: root/urpm/orphans.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2011-09-17 10:32:08 +0000
committerThierry Vignaud <tv@mageia.org>2011-09-17 10:32:08 +0000
commit26aa4a913080d42300efc8ae7d9fdc31ba32f060 (patch)
treed859fc42c73586286293068b94fd96a43ae32543 /urpm/orphans.pm
parentff635338fe2414f1f79590f48b1fe7124f534c39 (diff)
downloadurpmi-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)
Diffstat (limited to 'urpm/orphans.pm')
-rw-r--r--urpm/orphans.pm12
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";
}