diff options
author | Francois Pons <fpons@mandriva.com> | 1999-11-19 11:38:45 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 1999-11-19 11:38:45 +0000 |
commit | bfe37c13141bc718a42c0d8b8c3bbff03bfc5ff2 (patch) | |
tree | d485b3c253e2a1b2cc3c32b6243eb426f695d3ea /perl-install/pkgs.pm | |
parent | a672385d6e1ae6b19e7181aaa5767e31f7e669ef (diff) | |
download | drakx-backup-do-not-use-bfe37c13141bc718a42c0d8b8c3bbff03bfc5ff2.tar drakx-backup-do-not-use-bfe37c13141bc718a42c0d8b8c3bbff03bfc5ff2.tar.gz drakx-backup-do-not-use-bfe37c13141bc718a42c0d8b8c3bbff03bfc5ff2.tar.bz2 drakx-backup-do-not-use-bfe37c13141bc718a42c0d8b8c3bbff03bfc5ff2.tar.xz drakx-backup-do-not-use-bfe37c13141bc718a42c0d8b8c3bbff03bfc5ff2.zip |
*** empty log message ***
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r-- | perl-install/pkgs.pm | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 0c56f6a11..ac8717f42 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -454,6 +454,12 @@ sub selectPackagesToUpgrade($$$) { log::l("done selecting packages to upgrade"); } +sub installCallback { + my $msg = shift; + + log::l($msg .": ". join(',', @_)); +} + sub install($$) { my ($prefix, $toInstall) = @_; my %packages; @@ -476,7 +482,6 @@ sub install($$) { c::headerGetEntry(getHeader($p), 'arch'); $packages{$p->{name}} = $p; c::rpmtransAddPackage($trans, getHeader($p), $p->{name}, $p->{name} !~ /kernel/); #- TODO: replace `named kernel' by `provides kernel' -# c::rpmtransAddPackage($trans, getHeader($p), $p->{file}, 1); #- TODO: replace `named kernel' by `provides kernel' $nb++; $total += $p->{size}; } @@ -491,12 +496,6 @@ sub install($$) { eval { fs::mount("/proc", "$prefix/proc", "proc", 0) }; - #- if someone try to change the function log::ld or the parameters used, - #- DON TRY THAT unless you have modified accordingly install_steps_gtk. - #- because log::ld is catched, furthermore do not translate the messages used. - log::l("starting installation: ", $nb, " packages, ", $total, " bytes"); - log::ld("starting installation: ", $nb, " packages, ", $total, " bytes"); - my $callbackOpen = sub { my $f = (my $p = $packages{$_[0]})->{file}; print LOG "$f\n"; @@ -504,11 +503,16 @@ sub install($$) { $fd ? fileno $fd : -1; }; my $callbackClose = sub { $packages{$_[0]}{installed} = 1; }; - my $callbackStart = sub { log::ld("starting installing package ", $_[0]) }; - my $callbackProgress = sub { log::ld("progressing installation ", $_[0], "/", $_[1]) }; + my $callbackMessage = \&pkgs::installCallback; +# my $callbackStart = sub { log::ld("starting installing package ", $_[0]) }; +# my $callbackProgress = sub { log::ld("progressing installation ", $_[0], "/", $_[1]) }; + + #- do not modify/translate the message used with installCallback since + #- these are keys during progressing installation, or change in other + #- place (install_steps_gtk.pm,...). + &$callbackMessage("Starting installation", $nb, $total); - if (my @probs = c::rpmRunTransactions($trans, $callbackOpen, $callbackClose, - $callbackStart, $callbackProgress, 0)) { + if (my @probs = c::rpmRunTransactions($trans, $callbackOpen, $callbackClose, $callbackMessage, 0)) { my %parts; @probs = reverse grep { if (s/(installing package) .* (needs (?:.*) on the (.*) filesystem)/$1 $2/) { |