summaryrefslogtreecommitdiffstats
path: root/perl-install/install2.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-12-12 11:40:35 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-12-12 11:40:35 +0000
commit9b62a3001c09c69de94dee08756fc6fc0e97aba6 (patch)
tree6e4d93a30e379a12bc1ff77a28c39d6bc9fd32db /perl-install/install2.pm
parent2170e6234d981d174b5156bb31bd789b2e10a486 (diff)
downloaddrakx-backup-do-not-use-9b62a3001c09c69de94dee08756fc6fc0e97aba6.tar
drakx-backup-do-not-use-9b62a3001c09c69de94dee08756fc6fc0e97aba6.tar.gz
drakx-backup-do-not-use-9b62a3001c09c69de94dee08756fc6fc0e97aba6.tar.bz2
drakx-backup-do-not-use-9b62a3001c09c69de94dee08756fc6fc0e97aba6.tar.xz
drakx-backup-do-not-use-9b62a3001c09c69de94dee08756fc6fc0e97aba6.zip
- ensure /usr is formatted if / is
- remove /var/lib/rpm if /var is kept
Diffstat (limited to 'perl-install/install2.pm')
-rw-r--r--perl-install/install2.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index 304f4e75a..2ad1297b9 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -162,8 +162,21 @@ sub formatPartitions {
$o->{steps}{choosePackages}{done} = 0;
installStepsCall($o, $auto, 'choosePartitionsToFormat', $o->{fstab}) if !$o->{isUpgrade};
+ my $want_root_formated = fsedit::get_root($o->{fstab})->{toFormat};
+ if ($want_root_formated) {
+ foreach ('/usr') {
+ my $part = fsedit::mntpoint2part($_, $o->{fstab}) or next;
+ $part->{toFormat} or die _("You must also format %s", $_);
+ }
+ }
installStepsCall($o, $auto, 'formatMountPartitions', $o->{fstab}) if !$::testing;
+ if ($want_root_formated) {
+ #- we formatted /, ensure /var/lib/rpm is cleaned otherwise bad things can happen
+ #- (especially when /var is *not* formatted)
+ eval { rm_rf("$o->{prefix}/var/lib/rpm") };
+ }
+
mkdir "$o->{prefix}/$_", 0755 foreach
qw(dev etc etc/profile.d etc/rpm etc/sysconfig etc/sysconfig/console
etc/sysconfig/network-scripts etc/sysconfig/console/consolefonts