diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-02-22 13:13:22 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-02-22 13:13:22 +0000 |
commit | 02081920cdd5d13ab0a8baedd20ebff70dba6343 (patch) | |
tree | e8e9c8aca525c8692b7f95d3353c48d3e323292b | |
parent | 0685a763fd5ac6d18ff61540597108342d609324 (diff) | |
download | drakx-backup-do-not-use-02081920cdd5d13ab0a8baedd20ebff70dba6343.tar drakx-backup-do-not-use-02081920cdd5d13ab0a8baedd20ebff70dba6343.tar.gz drakx-backup-do-not-use-02081920cdd5d13ab0a8baedd20ebff70dba6343.tar.bz2 drakx-backup-do-not-use-02081920cdd5d13ab0a8baedd20ebff70dba6343.tar.xz drakx-backup-do-not-use-02081920cdd5d13ab0a8baedd20ebff70dba6343.zip |
Verify free space on disk for copying rpms
-rw-r--r-- | perl-install/install_steps_gtk.pm | 12 | ||||
-rw-r--r-- | perl-install/pkgs.pm | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm index 4c54164fa..36842d559 100644 --- a/perl-install/install_steps_gtk.pm +++ b/perl-install/install_steps_gtk.pm @@ -659,11 +659,17 @@ sub deselectFoundMedia { } my @selection = (1) x @hdlist2; my $copy_rpms_on_disk = 0; + my $ask_copy_rpms_on_disk = $o->{method} !~ /-iso$/; #- check available size for copying rpms from infos in hdlists file - if ($totalsize >= 0) { - # TODO my $availvar = install_any::getAvailableSpace_mounted('/var'); + if ($ask_copy_rpms_on_disk && $totalsize >= 0) { + my (undef, $availvar) = install_any::getAvailableSpace_mounted('/var'); + $availvar /= 1024; #- Mo + log::l("rpms totalsize=$totalsize"); + $ask_copy_rpms_on_disk = $totalsize > $availvar * 0.6; } - if ($o->{method} !~ /-iso$/) { + if ($ask_copy_rpms_on_disk) { + #- don't be afraid, cleanup old RPMs if upgrade + rm_rf("$::prefix/var/ftp/pub/Mandrakelinux") if $o->{isUpgrade}; my $w = ugtk2->new(""); $i = -1; $w->sync; diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 3a421368b..4c100789a 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -424,7 +424,7 @@ sub psUsingHdlists { $o_hdlistsprefix ? ($is_ftp ? "media/media_info/$hdlist" : "$o_hdlistsprefix/media/media_info/$hdlist") : undef, ]; if ($size) { - ($mediumsize{$hdlist}) = $size =~ /(\d+)/; + ($mediumsize{$hdlist}) = $size =~ /(\d+)/; #- XXX assume Mo } else { $mediumsize{$hdlist} = 0; } |