summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-01-09 15:07:42 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-01-09 15:07:42 +0000
commit6995ffdb764920825a83d46c4a84cb88d5b26e58 (patch)
tree849c21a1ee7438192b1d99216171478f3bdc80da /perl-install
parentb465f859e31006e9c6c0c5b38493d4570a7bb6c5 (diff)
downloaddrakx-6995ffdb764920825a83d46c4a84cb88d5b26e58.tar
drakx-6995ffdb764920825a83d46c4a84cb88d5b26e58.tar.gz
drakx-6995ffdb764920825a83d46c4a84cb88d5b26e58.tar.bz2
drakx-6995ffdb764920825a83d46c4a84cb88d5b26e58.tar.xz
drakx-6995ffdb764920825a83d46c4a84cb88d5b26e58.zip
allow giving {percent_size} instead of {size}
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/fsedit.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index ef632a9f7..4a30c9765 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -350,6 +350,15 @@ sub suggest_part {
grep { !$_->{hd} || $_->{hd} eq $part->{rootDevice} }
@$suggestions;
+ #- this allows specifying the size using a relative size.
+ #- one should rather use {ratio} instead
+ foreach (@local_suggestions) {
+ if ($_->{percent_size} && $_->{percent_size} =~ /(.+?)%?$/) {
+ $_->{size} = $1 / 100 * fs::get::part2hd($part, $all_hds)->{totalsectors};
+ log::l("in suggestion, setting size=$_->{size} for percent_size=$_->{percent_size}");
+ }
+ }
+
my ($best) =
grep { !$_->{maxsize} || $part->{size} <= $_->{maxsize} }
grep { $_->{size} <= ($part->{maxsize} || $part->{size}) }