diff options
author | Francois Pons <fpons@mandriva.com> | 2002-07-15 17:55:14 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2002-07-15 17:55:14 +0000 |
commit | 7c4437b8f45b8be90d8909433a93c29558c443e7 (patch) | |
tree | bbb1f466b714d2bd2fd62e8b417429678f12ccd3 | |
parent | 13ac5c963e1715979ef7b1a055e947def5135873 (diff) | |
download | drakx-backup-do-not-use-7c4437b8f45b8be90d8909433a93c29558c443e7.tar drakx-backup-do-not-use-7c4437b8f45b8be90d8909433a93c29558c443e7.tar.gz drakx-backup-do-not-use-7c4437b8f45b8be90d8909433a93c29558c443e7.tar.bz2 drakx-backup-do-not-use-7c4437b8f45b8be90d8909433a93c29558c443e7.tar.xz drakx-backup-do-not-use-7c4437b8f45b8be90d8909433a93c29558c443e7.zip |
code re-organisation (a little).
-rw-r--r-- | perl-install/install_steps.pm | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 6d2ee0030..779177478 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -245,14 +245,14 @@ sub formatMountPartitions { #------------------------------------------------------------------------------ sub setPackages { - my ($o) = @_; - install_any::setPackages($o); - pkgs::selectPackagesAlreadyInstalled($o->{packages}, $o->{prefix}) - if !$o->{isUpgrade} && (-r "$o->{prefix}/var/lib/rpm/packages.rpm" || -r "$o->{prefix}/var/lib/rpm/Packages"); -} -sub selectPackagesToUpgrade { - my ($o) = @_; - pkgs::selectPackagesToUpgrade($o->{packages}, $o->{prefix}, $o->{base}, $o->{toRemove}, $o->{toSave}); + my ($o, $rebuild_needed) = @_; + + install_any::setPackages($o, $rebuild_needed); + if ($rebuild_needed) { + pkgs::selectPackagesToUpgrade($o->{packages}, $o->{prefix}, $o->{base}, $o->{toRemove}, $o->{toSave}); + } else { + pkgs::selectPackagesAlreadyInstalled($o->{packages}, $o->{prefix}); + } } sub choosePackages { @@ -313,6 +313,7 @@ sub pkg_install { if ($::testing) { log::l("selecting package \"$_\"") foreach @l; } else { + $o->{packages}{rpmdb} ||= pkgs::rpmDbOpen($o->{prefix}); pkgs::selectPackage($o->{packages}, pkgs::packageByName($o->{packages}, $_) || die "$_ rpm not found") foreach @l; } my @toInstall = pkgs::packagesToInstall($o->{packages}); @@ -327,6 +328,7 @@ sub pkg_install { sub pkg_install_if_requires_satisfied { my ($o, @l) = @_; require pkgs; + $o->{packages}{rpmdb} ||= pkgs::rpmDbOpen($o->{prefix}); foreach (@l) { my %newSelection; my $pkg = pkgs::packageByName($o->{packages}, $_) || die "$_ rpm not found"; @@ -344,6 +346,9 @@ sub installPackages($$) { #- complete REWORK, TODO and TOCHECK! my ($o) = @_; my $packages = $o->{packages}; + #- this method is always called, go here to close still opened rpm db. + delete $packages->{rpmdb}; + if (@{$o->{toRemove} || []}) { #- hack to ensure proper upgrade of packages from other distribution, #- as release number are not mandrake based. this causes save of @@ -489,7 +494,7 @@ GridHeight=70 #- and rename saved files to .mdkgiorig. if ($o->{isUpgrade}) { my $pkg = pkgs::packageByName($o->{packages}, 'rpm'); - $pkg && ($pkg->flag_selected || $pkg->flag_installed) && $pkg->compare(">= 4.0") and pkgs::clean_old_rpm_db($o->{prefix}); + $pkg && ($pkg->flag_selected || $pkg->flag_installed) && $pkg->compare(">= 4.0") and pkgs::cleanOldRpmDb($o->{prefix}); log::l("moving previous desktop files that have been updated to Trash of each user"); install_any::kdemove_desktop_file($o->{prefix}); |