diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-08-04 00:29:32 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-08-04 00:29:32 +0000 |
commit | a3d551a6468bd1799197187d185689e3ac9cb4db (patch) | |
tree | 4e07ef60416129b6bd1b514536346c33c922791b /perl-install/install_any.pm | |
parent | 299573a7ecaf76b17411611dabd08c822f9b6f53 (diff) | |
download | drakx-backup-do-not-use-a3d551a6468bd1799197187d185689e3ac9cb4db.tar drakx-backup-do-not-use-a3d551a6468bd1799197187d185689e3ac9cb4db.tar.gz drakx-backup-do-not-use-a3d551a6468bd1799197187d185689e3ac9cb4db.tar.bz2 drakx-backup-do-not-use-a3d551a6468bd1799197187d185689e3ac9cb4db.tar.xz drakx-backup-do-not-use-a3d551a6468bd1799197187d185689e3ac9cb4db.zip |
no_comment
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r-- | perl-install/install_any.pm | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 1f9782140..3fd665cd4 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -235,17 +235,16 @@ sub getAvailableSpace { #- 50mb may be a good choice to avoid almost all problem of insuficient space left... my $minAvailableSize = 50 * sqr(1024); - int ((getAvailableSpace_mounted($o->{prefix}) || getAvailableSpace_raw($o->{fstab}) * 512 / 1.07) - $minAvailableSize); + int ((!$::testing && + getAvailableSpace_mounted($o->{prefix}) || + getAvailableSpace_raw($o->{fstab}) * 512 / 1.07) - $minAvailableSize); } sub getAvailableSpace_mounted { my ($prefix) = @_; - my $buf = ' ' x 20000; my $dir = -d "$prefix/usr" ? "$prefix/usr" : "$prefix"; - syscall_('statfs', $dir, $buf) or return; - my (undef, $blocksize, $size, undef, $free, undef) = unpack "L2L4", $buf; - log::l("space free on $dir is $free blocks of $blocksize bytes"); - $free * $blocksize || 1; + my ($free, undef) = common::df($dir) or return; + $free || 1; } sub getAvailableSpace_raw { my ($fstab) = @_; @@ -254,7 +253,7 @@ sub getAvailableSpace_raw { do { $_->{mntpoint} eq '/' and return $_->{size} } foreach @$fstab; if ($::testing) { - my $nb = 650; + my $nb = 450; log::l("taking ${nb}MB for testing"); return $nb << 11; } |