summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>1999-12-07 18:14:34 +0000
committerFrancois Pons <fpons@mandriva.com>1999-12-07 18:14:34 +0000
commit8c45c7d481e611752c996d4f543cf3a9f25b165a (patch)
tree09bf1a7b75d06be04a723a419b5ce487adceef99 /perl-install/install_steps.pm
parent27e6b80900b2b3a724e95be3192faecc60954427 (diff)
downloaddrakx-8c45c7d481e611752c996d4f543cf3a9f25b165a.tar
drakx-8c45c7d481e611752c996d4f543cf3a9f25b165a.tar.gz
drakx-8c45c7d481e611752c996d4f543cf3a9f25b165a.tar.bz2
drakx-8c45c7d481e611752c996d4f543cf3a9f25b165a.tar.xz
drakx-8c45c7d481e611752c996d4f543cf3a9f25b165a.zip
*** empty log message ***
Diffstat (limited to 'perl-install/install_steps.pm')
-rw-r--r--perl-install/install_steps.pm36
1 files changed, 32 insertions, 4 deletions
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index f3d5787e7..c1e1784e9 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -189,9 +189,39 @@ sub beforeInstallPackages {
pkgs::init_db($o->{prefix}, $o->{isUpgrade});
}
+sub beforeRemoveOtherPackages($) {
+ my ($prefix) = @_;
+
+ #- hack to save some files that may be removed during installation of other packages.
+ do {
+ unlink "$prefix/$_.mdkgisave"; rename "$prefix/$_", "$prefix/$_.mdkgisave";
+ } foreach qw(/etc/passwd);
+}
+
+sub afterRemoveOtherPackages($) {
+ my ($prefix) = @_;
+
+ #- hack to restore what have been saved before removing other packages.
+ do {
+ unlink "$prefix/$_"; rename "$prefix/$_.mdkgisave", "$prefix/$_";
+ } foreach qw(/etc/passwd);
+}
+
sub installPackages($$) {
my ($o, $packages) = @_;
+ if (@{$o->{toRemove} || []}) {
+ my @mdkgisave = qw( /etc/passwd );
+
+ #- hack to ensure proper upgrade of packages from other distribution,
+ #- as release number are not mandrake based. this causes save of very
+ #- important files (not all) and restore them after.
+ #- it is not enough to dop only that.
+ do { unlink "$o->{prefix}/$_.mdkgisave"; rename "$o->{prefix}/$_", "$o->{prefix}/$_.mdkgisave"; } foreach @mdkgisave;
+ pkgs::remove($o->{prefix}, $o->{toRemove});
+ do { unlink "$o->{prefix}/$_"; rename "$o->{prefix}/$_.mdkgisave", "$o->{prefix}/$_"; } foreach @mdkgisave;
+ }
+
#- hack to ensure proper ordering for installation of packages.
my @firstToInstall = qw(setup basesystem sed);
my %firstInstalled;
@@ -204,7 +234,7 @@ sub installPackages($$) {
}
push @toInstall, grep { $_->{base} && $_->{selected} && !$_->{installed} && !$firstInstalled{$_->{name}} } values %$packages;
push @toInstall, grep { !$_->{base} && $_->{selected} && !$_->{installed} && !$firstInstalled{$_->{name}} } values %$packages;
- pkgs::install($o->{prefix}, \@toInstall);
+ pkgs::install($o->{prefix}, $o->{isUpgrade}, \@toInstall);
}
sub afterInstallPackages($) {
@@ -330,9 +360,7 @@ sub installCrypto {
}
}
}
- foreach (values %$packages) {
- }
- pkgs::install($o->{prefix}, [ values %$packages ]);
+ pkgs::install($o->{prefix}, $o->{isUpgrade}, [ values %$packages ]);
}
#------------------------------------------------------------------------------