From ace7bea78b504511acf83bf9b8ce5b1249611797 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 6 Feb 2008 14:02:31 +0000 Subject: (format_size) split it out of perform_installation() (needed for next commit) --- Rpmdrake/formatting.pm | 9 ++++++++- Rpmdrake/pkg.pm | 5 +---- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'Rpmdrake') diff --git a/Rpmdrake/formatting.pm b/Rpmdrake/formatting.pm index 39453fb1..51ac8935 100644 --- a/Rpmdrake/formatting.pm +++ b/Rpmdrake/formatting.pm @@ -33,7 +33,7 @@ use ugtk2 qw(escape_text_for_TextView_markup_format); use Exporter; our @ISA = qw(Exporter); -our @EXPORT = qw(format_field format_header format_name_n_summary localtime2changelog my_fullname pkg2medium rpm_description split_fullname urpm_name); +our @EXPORT = qw(format_field format_header format_name_n_summary format_size localtime2changelog my_fullname pkg2medium rpm_description split_fullname urpm_name); sub rpm_description { @@ -97,4 +97,11 @@ sub format_field { '' . escape_text_for_TextView_markup_format($str) . ''; } +sub format_size { + my ($size) = @_; + $size >= 0 ? + N("%s of additional disk space will be used.", formatXiB($size)) : + N("%s of disk space will be freed.", formatXiB(-$size)); + } + 1; diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index b94a438d..7eb3ec23 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -592,10 +592,7 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-( N("The following package has to be removed for others to be upgraded:") : N("The following packages have to be removed for others to be upgraded:")), $r), if_($to_install, $to_install)) : $to_install), - ($size >= 0 ? - N("%s of additional disk space will be used.", formatXiB($size)) : - N("%s of disk space will be freed.", formatXiB(-$size)) - ), + format_size($size), N("Is it ok to continue?")), scroll => 1, yesno => 1) or return 1; -- cgit v1.2.1