summaryrefslogtreecommitdiffstats
path: root/perl-install/install_any.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-03-08 17:06:49 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-03-08 17:06:49 +0000
commit9f36e94ee065873b1b42637a6d332c39c9923451 (patch)
tree637144742025a595418e3e9fe2449913049e1508 /perl-install/install_any.pm
parent6ac8c807e66dd04165801a2c77d6afca0afdb509 (diff)
downloaddrakx-9f36e94ee065873b1b42637a6d332c39c9923451.tar
drakx-9f36e94ee065873b1b42637a6d332c39c9923451.tar.gz
drakx-9f36e94ee065873b1b42637a6d332c39c9923451.tar.bz2
drakx-9f36e94ee065873b1b42637a6d332c39c9923451.tar.xz
drakx-9f36e94ee065873b1b42637a6d332c39c9923451.zip
Disable progress bar when copying rpms from CDs. (The change CD dialog
clashes with it)
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r--perl-install/install_any.pm42
1 files changed, 23 insertions, 19 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 40b7b41de..5cf994aee 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -642,25 +642,29 @@ Please insert the Cd-Rom labelled \"%s\" in your drive and press Ok when done.",
};
my $total = $o->{mediumsize};
log::l("totalsize=$total");
- my $pid = fork();
- if (!$pid && defined $pid) { #- child
- my ($wait_w, $wait_message) = fs::format::wait_message($o); #- nb, this is only called when interactive
- $wait_message->(N("Copying in progress"));
- #- from commands.pm. TODO: factorize, possibly in MDK::Common.
- my $f; $f = sub {
- my ($e) = @_;
- my $s = (lstat($e))[12];
- $s += sum(map { &$f($_) } glob_("$e/*")) if !-l _ && -d _;
- $s;
- };
- while (1) {
- my $s = $f->("$o->{prefix}/var/ftp/pub/Mandrakelinux/media") / 1024;
- $wait_message->('', $s, $total);
- sleep 1;
- last if $s > $total - 100;
+ my $pid;
+ if (!method_allows_medium_change($o->{method}) || $o->{method} =~ /-iso$/) {
+ #- display the progress bar only for non-cdrom installation methods
+ $pid = fork();
+ if (!$pid && defined $pid) { #- child
+ my ($wait_w, $wait_message) = fs::format::wait_message($o); #- nb, this is only called when interactive
+ $wait_message->(N("Copying in progress"));
+ #- from commands.pm. TODO: factorize, possibly in MDK::Common.
+ my $f; $f = sub {
+ my ($e) = @_;
+ my $s = (lstat($e))[12];
+ $s += sum(map { &$f($_) } glob_("$e/*")) if !-l _ && -d _;
+ $s;
+ };
+ while (1) {
+ my $s = $f->("$o->{prefix}/var/ftp/pub/Mandrakelinux/media") / 1024;
+ $wait_message->('', $s, $total);
+ sleep 1;
+ last if $s > $total - 100;
+ }
+ undef $wait_w;
+ c::_exit(0);
}
- undef $wait_w;
- c::_exit(0);
}
foreach my $k (pkgs::allMediums($o->{packages})) {
my $m = $o->{packages}{mediums}{$k};
@@ -681,7 +685,7 @@ Please insert the Cd-Rom labelled \"%s\" in your drive and press Ok when done.",
$m->{method} = 'disk';
$m->{with_hdlist} = 'media_info/hdlist.cz'; #- for install_urpmi
}
- kill 15, $pid;
+ kill 15, $pid if defined $pid;
#- now the install will continue as 'disk'
$o->{method} = 'disk';
#- shoud be enough to fool errorOpeningFile