From 16d7837cdcd2fd847e8876f6d7cd3373645d645a Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 22 Aug 2001 16:15:47 +0000 Subject: do init_db inside pkg_inside otherwise LOG is closed and rpmlib tries to write in it and ... --- perl-install/c/stuff.xs.pm | 1 - perl-install/install_steps.pm | 5 ----- perl-install/pkgs.pm | 8 ++++---- 3 files changed, 4 insertions(+), 10 deletions(-) (limited to 'perl-install') diff --git a/perl-install/c/stuff.xs.pm b/perl-install/c/stuff.xs.pm index a34824b1f..23d12a0ca 100644 --- a/perl-install/c/stuff.xs.pm +++ b/perl-install/c/stuff.xs.pm @@ -74,7 +74,6 @@ int rpmError_callback_data; void rpmError_callback(void) { if (rpmErrorCode() != RPMERR_UNLINK && rpmErrorCode() != RPMERR_RMDIR) { write(rpmError_callback_data, rpmErrorString(), strlen(rpmErrorString())); - write(rpmError_callback_data, "\n", 1); } } diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 44bea97e8..49e10280f 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -295,9 +295,6 @@ sub beforeInstallPackages { require network; network::add2hosts("$o->{prefix}/etc/hosts", "localhost.localdomain", "127.0.0.1"); - - require pkgs; - pkgs::init_db($o->{prefix}); } sub pkg_install { @@ -395,8 +392,6 @@ and look at the log file /tmp/ddebug.log Consoles 1,3,4,7 may also contain interesting information"; } - pkgs::done_db(); - #- why not? cuz weather is nice today :-) [pixel] common::sync(); common::sync(); diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 0bcd9d28a..5de1f29cb 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -812,7 +812,7 @@ sub init_db { my ($prefix) = @_; my $f = "$prefix/root/install.log"; - open(LOG, "> $f") ? log::l("opened $f") : log::l("Failed to open $f. No install log will be kept."); + 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); @@ -1241,9 +1241,7 @@ sub install($$$;$$) { log::l("pkgs::install the following: ", join(" ", keys %packages)); eval { fs::mount("/proc", "$prefix/proc", "proc", 0) } unless -e "$prefix/proc/cpuinfo"; - log::l("reading /usr/lib/rpm/rpmrc"); - c::rpmReadConfigFiles() or die "can't read rpm config files"; - log::l("\tdone"); + init_db($prefix); my $callbackOpen = sub { my $p = $packages{$_[0]}; @@ -1459,6 +1457,8 @@ sub install($$$;$$) { cleanHeaders($prefix); } while ($nb > 0 && !$pkgs::cancel_install); + done_db(); + cleanHeaders($prefix); loopback::save_boot($loop_boot); -- cgit v1.2.1