summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2015-06-16 06:52:26 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2016-02-09 00:30:57 +0100
commitfe1fff1dc82d008a6b811513a1809f379ea5a0b9 (patch)
treea0b1f10313f45c00e06e69729deb03636b909cba
parent06477745e1edf6eee081d4bd409c4ce8ed75042c (diff)
downloaddrakx-fe1fff1dc82d008a6b811513a1809f379ea5a0b9.tar
drakx-fe1fff1dc82d008a6b811513a1809f379ea5a0b9.tar.gz
drakx-fe1fff1dc82d008a6b811513a1809f379ea5a0b9.tar.bz2
drakx-fe1fff1dc82d008a6b811513a1809f379ea5a0b9.tar.xz
drakx-fe1fff1dc82d008a6b811513a1809f379ea5a0b9.zip
better understandable percentage (mga#16116)
as a side note, this is friendler to translators (instead of joining two strings...)
-rw-r--r--perl-install/diskdrake/interactive.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index f13659ac1..f772c0f8b 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -1395,8 +1395,11 @@ sub format_part_info {
$info .= N("Type: ") . (fs::type::part2type_name($part) || $part->{fs_type}) . ($::expert ? sprintf " (0x%x)", $part->{pt_type} : '') . "\n";
}
$info .= N("Start: sector %s\n", $part->{start}) if $::expert && !isSpecial($part) && !isLVM($hd);
- $info .= N("Size: %s", formatXiB($part->{size}, 512));
- $info .= sprintf " (%s%%)", int 100 * $part->{size} / $hd->{totalsectors} if $hd->{totalsectors};
+ if ($hd->{totalsectors}) {
+ $info .= N("Size: %s (%s%% of disk)", formatXiB($part->{size}, 512), int 100 * $part->{size} / $hd->{totalsectors});
+ } else {
+ $info .= N("Size: %s", formatXiB($part->{size}, 512));
+ }
$info .= N(", %s sectors", $part->{size}) if $::expert;
$info .= "\n";
$info .= N("Cylinder %d to %d\n", $part->{start} / $hd->cylinder_size, ($part->{start} + $part->{size} - 1) / $hd->cylinder_size) if ($::expert || isEmpty($part)) && !isSpecial($part) && !isLVM($hd) && $hd->cylinder_size;