diff options
author | Francois Pons <fpons@mandriva.com> | 2003-08-13 13:14:15 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2003-08-13 13:14:15 +0000 |
commit | 476dc6df1ee1c7a981c3339f9ecd4ceafffd3244 (patch) | |
tree | 556158f182d9cf9eb93be4727ba7ce5537a29eee /perl-install/pkgs.pm | |
parent | d46f15a1bfcdeb55ce1bb069b6f0babe866f2827 (diff) | |
download | drakx-476dc6df1ee1c7a981c3339f9ecd4ceafffd3244.tar drakx-476dc6df1ee1c7a981c3339f9ecd4ceafffd3244.tar.gz drakx-476dc6df1ee1c7a981c3339f9ecd4ceafffd3244.tar.bz2 drakx-476dc6df1ee1c7a981c3339f9ecd4ceafffd3244.tar.xz drakx-476dc6df1ee1c7a981c3339f9ecd4ceafffd3244.zip |
added log for checking deselection (check deadlock unless gtk are doing them).
workaround for rpmdb problems of opening Conflictname and Triggername files.
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r-- | perl-install/pkgs.pm | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 6d8d74c03..8b51d24e4 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -275,12 +275,16 @@ sub unselectPackage($$;$) { $pkg->flag_selected or return; my $state = $packages->{state} ||= {}; + log::l("removing selection on package ".$pkg->fullname); my @l = $packages->disable_selected($packages->{rpmdb}, $state, $pkg); + log::l(" removed selection on package ".$pkg->fullname. "gives ".join(',', map { scalar $_->fullname } @l)); if ($o_otherOnly) { foreach (@l) { $o_otherOnly->{$_->id} = undef; } + log::l(" reselecting removed selection..."); $packages->resolve_requested($packages->{rpmdb}, $state, $o_otherOnly, callback_choices => \&packageCallbackChoices); + log::l(" done"); } 1; } @@ -762,6 +766,25 @@ sub rpmDbOpen { $db; } +sub rpmDbOpenForInstall { + my ($prefix) = @_; + + #- there is a bug in rpm 4.2 where all operations for accessing rpmdb files are not + #- always done using prefix, we need to setup a symlink in /var/lib/rpm for that ... + unless (-e "/var/lib/rpm") { + #- check if at some time a /var/lib directory has been made. + if (-d "/var/lib") { + symlinkf "$prefix/var/lib/rpm", "/var/lib/rpm"; + } else { + symlinkf "$prefix/var/lib", "/var/lib"; + } + } + + my $db = URPM::DB::open($prefix, 1); + $db and log::l("opened rpmdb for writing in $prefix"); + $db; +} + sub cleanOldRpmDb { my ($prefix) = @_; my $failed; @@ -986,7 +1009,7 @@ sub install($$$;$$) { print OUTPUT "inst:$id:start:0:$size_typical\ninst:$id:progress:0:$size_typical\nclose:$id\n"; } } else { eval { - my $db = URPM::DB::open($prefix, 1) or die "error opening RPM database: ", c::rpmErrorString(); + my $db = rpmDbOpenForInstall($prefix) or die "error opening RPM database: ", c::rpmErrorString(); my $trans = $db->create_transaction($prefix); if ($retry_pkg) { log::l("opened rpm database for retry transaction of 1 package only"); @@ -1116,7 +1139,7 @@ sub remove { return if $::g_auto_install || !@{$toRemove || []}; delete $packages->{rpmdb}; #- make sure rpmdb is closed before. - my $db = URPM::DB::open($prefix, 1) or die "error opening RPM database: ", c::rpmErrorString(); + my $db = rpmDbOpenForInstall($prefix) or die "error opening RPM database: ", c::rpmErrorString(); my $trans = $db->create_transaction($prefix); foreach my $p (@$toRemove) { |