summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-03-05 17:04:47 +0000
committerFrancois Pons <fpons@mandriva.com>2002-03-05 17:04:47 +0000
commit27bd7dbc989acdc6456b4a0b94d0fde5db138610 (patch)
tree09b24aeb182dae4c2bd802bce0974fa719c69a08 /perl-install/install_steps.pm
parentfaf8d9bf045649c0155eee71cafd362bd5ec1fcf (diff)
downloaddrakx-27bd7dbc989acdc6456b4a0b94d0fde5db138610.tar
drakx-27bd7dbc989acdc6456b4a0b94d0fde5db138610.tar.gz
drakx-27bd7dbc989acdc6456b4a0b94d0fde5db138610.tar.bz2
drakx-27bd7dbc989acdc6456b4a0b94d0fde5db138610.tar.xz
drakx-27bd7dbc989acdc6456b4a0b94d0fde5db138610.zip
added auto restore of some files (/etc/profile) needed by upgrade (from .rpmnew).
Diffstat (limited to 'perl-install/install_steps.pm')
-rw-r--r--perl-install/install_steps.pm15
1 files changed, 14 insertions, 1 deletions
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 3864f8a06..e132b8f8c 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -2,7 +2,7 @@ package install_steps; # $Id$
use diagnostics;
use strict;
-use vars qw(@filesToSaveForUpgrade @ISA);
+use vars qw(@filesToSaveForUpgrade @filesNewerToUseAfterUpgrade @ISA);
#-######################################################################################
#- misc imports
@@ -26,6 +26,9 @@ use fs;
/etc/ld.so.conf /etc/fstab /etc/hosts /etc/conf.modules /etc/modules.conf
);
+@filesNewerToUseAfterUpgrade = qw(
+/etc/profile
+);
#-######################################################################################
#- OO Stuff
@@ -287,6 +290,9 @@ sub beforeInstallPackages {
eval { cp_af("$o->{prefix}/$_", "$o->{prefix}/$_.mdkgisave") };
}
}
+ foreach (@filesNewerToUseAfterUpgrade) {
+ unlink "$o->{prefix}/$_.rpmnew";
+ }
}
#- some packages need such files for proper installation.
@@ -491,6 +497,13 @@ GridHeight=70
renamef("$o->{prefix}/$_.mdkgisave", "$o->{prefix}/$_.mdkgiorig")
if -e "$o->{prefix}$_.mdkgisave";
}
+
+ foreach (@filesNewerToUseAfterUpgrade) {
+ if (-e "$o->{prefix}/$_.rpmnew" && -e "$o->{prefix}/$_") {
+ renamef("$o->{prefix}/$_", "$o->{prefix}/$_.mdkgiorig");
+ renamef("$o->{prefix}/$_.rpmnew", "$o->{prefix}/$_");
+ }
+ }
}
if ($o->{blank} || $o->{updatemodules}) {