summaryrefslogtreecommitdiffstats
path: root/perl-install/install_any.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-05-05 18:45:23 +0000
committerFrancois Pons <fpons@mandriva.com>2000-05-05 18:45:23 +0000
commit969bc065596476bce5cfed0bb7ffd263f48eb1d5 (patch)
tree8f890d39f7b1ccfa6dbeb8f7cc3281748ee30f46 /perl-install/install_any.pm
parent8255a2010a0698471fb35f42b1ebcad3462f153a (diff)
downloaddrakx-969bc065596476bce5cfed0bb7ffd263f48eb1d5.tar
drakx-969bc065596476bce5cfed0bb7ffd263f48eb1d5.tar.gz
drakx-969bc065596476bce5cfed0bb7ffd263f48eb1d5.tar.bz2
drakx-969bc065596476bce5cfed0bb7ffd263f48eb1d5.tar.xz
drakx-969bc065596476bce5cfed0bb7ffd263f48eb1d5.zip
*** empty log message ***
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r--perl-install/install_any.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index cff5446ab..22d5c1c2d 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -69,7 +69,6 @@ sub askChangeMedium($$) {
my ($method, $medium) = @_;
my $allow;
do {
- local $::no_theme_change = 1; #- avoid changing theme here!
eval { $allow = changeMedium($method, $medium) };
} while ($@); #- really it is not allowed to die in changeMedium!!! or install will cores with rpmlib!!!
$allow;
@@ -233,9 +232,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_raw($o->{fstab}) * 512 / 1.07 - $minAvailableSize;
+ int (getAvailableSpace_mounted($o->{prefix}) || getAvailableSpace_raw($o->{fstab})) * 512 / 1.07 - $minAvailableSize;
}
+sub getAvailableSpace_mounted {
+ my ($prefix) = @_;
+ my $buf = ' ' x 20000;
+ syscall_('statfs', "$prefix/usr", $buf) or return;
+ my (undef, $blocksize, $size, undef, $free, undef) = unpack "L2L4", $buf;
+ ($free || 1) * $blocksize / 512;
+}
sub getAvailableSpace_raw {
my ($fstab) = @_;