summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-08-12 12:51:28 +0000
committerFrancois Pons <fpons@mandriva.com>2002-08-12 12:51:28 +0000
commit39353e64a9dab2b434b5a940f7a762e9fb382b73 (patch)
tree154ea89fe970d54c3abb3cab92a4d2a70edca99c /perl-install/install_steps.pm
parent6c2388db6ccf2414b06f6c2f315fcbf27c96e6f8 (diff)
downloaddrakx-39353e64a9dab2b434b5a940f7a762e9fb382b73.tar
drakx-39353e64a9dab2b434b5a940f7a762e9fb382b73.tar.gz
drakx-39353e64a9dab2b434b5a940f7a762e9fb382b73.tar.bz2
drakx-39353e64a9dab2b434b5a940f7a762e9fb382b73.tar.xz
drakx-39353e64a9dab2b434b5a940f7a762e9fb382b73.zip
allow removing packages on upgrade.
Diffstat (limited to 'perl-install/install_steps.pm')
-rw-r--r--perl-install/install_steps.pm27
1 files changed, 4 insertions, 23 deletions
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 4283e51a4..d1129efc1 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -253,7 +253,7 @@ sub setPackages {
install_any::setPackages($o, $rebuild_needed);
pkgs::selectPackagesAlreadyInstalled($o->{packages}, $o->{prefix});
- $rebuild_needed and pkgs::selectPackagesToUpgrade($o->{packages}, $o->{prefix}, $o->{base}, $o->{toRemove}, $o->{toSave});
+ $rebuild_needed and pkgs::selectPackagesToUpgrade($o->{packages}, $o->{prefix});
}
sub choosePackages {
@@ -353,28 +353,9 @@ sub installPackages($$) { #- complete REWORK, TODO and TOCHECK!
#- 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
- #- important files and restore them after.
- foreach (@{$o->{toSave} || []}) {
- if (-e "$o->{prefix}/$_") {
- eval { cp_af("$o->{prefix}/$_", "$o->{prefix}/$_.mdkgisave") };
- }
- }
- pkgs::remove($o->{prefix}, $o->{toRemove});
- foreach (@{$o->{toSave} || []}) {
- if (-e "$o->{prefix}/$_.mdkgisave") {
- renamef("$o->{prefix}/$_.mdkgisave", "$o->{prefix}/$_");
- }
- }
- $o->{toSave} = [];
-
- #- hack for compat-glibc to upgrade properly :-(
- if (pkgs::packageByName($packages, 'compat-glibc')->flag_selected &&
- !pkgs::packageByName($packages, 'compat-glibc')->flag_installed) {
- rename "$o->{prefix}/usr/i386-glibc20-linux", "$o->{prefix}/usr/i386-glibc20-linux.mdkgisave";
- }
+ if (%{$packages->{state}{ask_remove} || {}}) {
+ log::l("removing : ", join ', ', keys %{$packages->{state}{ask_remove}});
+ pkgs::remove($o->{prefix}, keys %{$packages->{state}{ask_remove}});
}
#- small transaction will be built based on this selection and depslist.