summaryrefslogtreecommitdiffstats
path: root/perl-install/fs
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2015-05-12 04:27:38 -0400
committerThierry Vignaud <thierry.vignaud@gmail.com>2015-05-18 04:45:07 +0200
commit97a7904701e5fe02af2c95c5eb0ffb83a7707b6d (patch)
treec80bc76f8bd0b808c21fd801816e186e0d97b763 /perl-install/fs
parentf0bd42c42d4aa7b39e4973b4b4bb4833c6ac75a5 (diff)
downloaddrakx-97a7904701e5fe02af2c95c5eb0ffb83a7707b6d.tar
drakx-97a7904701e5fe02af2c95c5eb0ffb83a7707b6d.tar.gz
drakx-97a7904701e5fe02af2c95c5eb0ffb83a7707b6d.tar.bz2
drakx-97a7904701e5fe02af2c95c5eb0ffb83a7707b6d.tar.xz
drakx-97a7904701e5fe02af2c95c5eb0ffb83a7707b6d.zip
(getNeededMinSpace) split it out
needed for mga#15257
Diffstat (limited to 'perl-install/fs')
-rw-r--r--perl-install/fs/any.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/perl-install/fs/any.pm b/perl-install/fs/any.pm
index 3021cd534..ce85c616a 100644
--- a/perl-install/fs/any.pm
+++ b/perl-install/fs/any.pm
@@ -93,8 +93,8 @@ sub prepare_minimal_root() {
eval { fs::mount::sys_kernel_debug($::prefix) };
}
-sub getAvailableSpace {
- my ($fstab, $o_skip_mounted) = @_;
+sub getNeededMinSpace {
+ my ($n) = @_;
#- make sure of this place to be available for installation, this could help a lot.
#- currently doing a very small install use 36Mb of postinstall-rpm, but installing
@@ -102,9 +102,15 @@ sub getAvailableSpace {
#- 65mb may be a good choice to avoid almost all problem of insuficient space left...
my $minAvailableSize = 65 * sqr(1024);
+ max(0.1 * $n, $minAvailableSize);
+}
+
+sub getAvailableSpace {
+ my ($fstab, $o_skip_mounted) = @_;
+
my $n = !$::testing && !$o_skip_mounted && getAvailableSpace_mounted($::prefix) ||
getAvailableSpace_raw($fstab) * 512 / 1.07;
- $n - max(0.1 * $n, $minAvailableSize);
+ $n - getNeededMinSpace($n);
}
sub getAvailableSpace_mounted {