summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/install_steps_gtk.pm12
-rw-r--r--perl-install/pkgs.pm2
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;
}