From 30471ac7a60c358578d6fc63d1ebce22baa0912c Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 7 Feb 2012 21:22:14 +0000 Subject: (format_filesize) introduce it --- Rpmdrake/formatting.pm | 6 ++++++ Rpmdrake/pkg.pm | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'Rpmdrake') diff --git a/Rpmdrake/formatting.pm b/Rpmdrake/formatting.pm index 2bdfc67a..6a617778 100644 --- a/Rpmdrake/formatting.pm +++ b/Rpmdrake/formatting.pm @@ -43,6 +43,7 @@ our @EXPORT = qw( format_list format_name_n_summary format_size + format_filesize format_update_field my_fullname pkg2medium @@ -167,6 +168,11 @@ sub format_size { N("%s of disk space will be freed.", formatXiB(-$size)); } +sub format_filesize { + my ($filesize) = @_; + $filesize ? N("%s of packages will be retrieved.", formatXiB($filesize)) : (); +} + sub format_list { join("\n", map { s/^(\s)/ $1/mg; "- $_" } sort { uc($a) cmp uc($b) } @_) } 1; diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index 0739c417..40e96d61 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -695,8 +695,7 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-( : N("The following packages have to be removed for others to be upgraded:")), $r), if_($to_install, $to_install)) : $to_install), format_size($size), - $filesize ? N("%s of packages will be retrieved.", formatXiB($filesize)) - : (), + format_filesize($filesize), N("Is it ok to continue?")), scroll => 1, yesno => 1) or return 1; -- cgit v1.2.1