diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-11-25 22:43:14 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-11-25 22:43:14 +0000 |
commit | daed6fab17f95fc91c9e32cca7f9081138e6d728 (patch) | |
tree | a5e141b8a985f970c0d9cc8b0307350bcd9c6f81 /perl-install | |
parent | 5a803de5077050d852ace2386ec7c70916bb933f (diff) | |
download | drakx-daed6fab17f95fc91c9e32cca7f9081138e6d728.tar drakx-daed6fab17f95fc91c9e32cca7f9081138e6d728.tar.gz drakx-daed6fab17f95fc91c9e32cca7f9081138e6d728.tar.bz2 drakx-daed6fab17f95fc91c9e32cca7f9081138e6d728.tar.xz drakx-daed6fab17f95fc91c9e32cca7f9081138e6d728.zip |
don't use filehandle *pkgs::LOG, use a my'ed $LOG
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/pkgs.pm | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 1bca0d103..51f757a31 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -725,18 +725,12 @@ sub openInstallLog { my ($prefix) = @_; my $f = "$prefix/root/drakx/install.log"; - open(LOG, ">> $f") ? log::l("opened $f") : log::l("Failed to open $f. No install log will be kept."); #-# - *LOG or *LOG = log::F() or *LOG = *STDERR; - CORE::select((CORE::select(LOG), $| = 1)[0]); - c::rpmErrorSetCallback(fileno LOG); + open(my $LOG, ">> $f") ? log::l("opened $f") : log::l("Failed to open $f. No install log will be kept."); #-# + CORE::select((CORE::select($LOG), $| = 1)[0]); + c::rpmErrorSetCallback(fileno $LOG); #- c::rpmSetVeryVerbose(); } -sub closeInstallLog { - log::l("closing install.log file"); - close LOG; -} - sub rpmDbOpen { my ($prefix, $rebuild_needed) = @_; @@ -917,7 +911,7 @@ sub install($$$;$$) { eval { fs::mount("/proc", "$prefix/proc", "proc", 0) } unless -e "$prefix/proc/cpuinfo"; URPM::read_config_files(); - openInstallLog($prefix); + my $LOG = openInstallLog($prefix); #- do not modify/translate the message used with installCallback since #- these are keys during progressing installation, or change in other @@ -995,7 +989,7 @@ sub install($$$;$$) { } $trans->order or die "error ordering package list: " . c::rpmErrorString(); - $trans->set_script_fd(fileno LOG); + $trans->set_script_fd(fileno $LOG); log::l("rpm transactions start"); my $fd; #- since we return the "fileno", perl doesn't know we're still using it, and so closes it, and :-( @@ -1004,7 +998,7 @@ sub install($$$;$$) { my $pkg = defined $id && $data->{depslist}[$id]; my $medium = packageMedium($packages, $pkg); my $f = $pkg && $pkg->filename; - print LOG "$f\n"; + print $LOG "$f\n"; $fd = install_any::getFile($f, $medium->{descr}); $fd ? fileno $fd : -1; }, callback_close => sub { @@ -1035,7 +1029,7 @@ sub install($$$;$$) { push @{$ppids{$1 || 1}}, $_; } my @killpid = difference2(\@allpids, [ @prev_pids, - difference2([ $$, hashtree2list(getppid, \%ppids) ], + difference2([ $$, hashtree2list(getppid(), \%ppids) ], [ hashtree2list($$, \%ppids) ]) ]); if (@killpid) { @@ -1097,7 +1091,8 @@ sub install($$$;$$) { cleanHeaders($prefix); } while $nb > 0 && !$pkgs::cancel_install; - closeInstallLog(); + log::l("closing install.log file"); + close $LOG; cleanHeaders($prefix); |