From f26011903cf11a33656c023a2367d643ed09d88b Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 11 Aug 2002 18:25:48 +0000 Subject: =?UTF-8?q?(prepare=5Fwrite=5Ffstab):=20no=20need=20to=20read=20th?= =?UTF-8?q?e=20fstab=20once=20again=20before=20writing=20since=20reading?= =?UTF-8?q?=20takes=20care=20of=20everything,=20including=20unknown=20entr?= =?UTF-8?q?ies=20(which=20go=20to=20{special}).=20This=20fixes=20a=20bug?= =?UTF-8?q?=20when=20removing=20existing=20partition=20with=20associated?= =?UTF-8?q?=20mount=20point.=20It=20used=20to=20keep=20the=20entry=20in=20?= =?UTF-8?q?fstab,=20which=20is=20wrong=20(as=20reported=20by=20andr=C3=A9?= =?UTF-8?q?=20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- perl-install/fs.pm | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'perl-install/fs.pm') diff --git a/perl-install/fs.pm b/perl-install/fs.pm index 63e03f542..4ebf33f37 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -196,17 +196,7 @@ sub prepare_write_fstab { my ($all_hds, $prefix, $keep_smb_credentials) = @_; $prefix ||= ''; - my @l1 = (fsedit::get_really_all_fstab($all_hds), @{$all_hds->{special}}); - my @l2 = read_fstab($prefix, "/etc/fstab", 'all_options'); - - { - #- remove entries from @l2 that are given by @l1 - #- this is needed to allow to unset a mount point - my %new; - $new{$_->{device}} = 1 foreach @l1; - delete $new{none}; #- special case for device "none" which can be _mounted_ more than once - @l2 = grep { !$new{$_->{device}} } @l2; - } + my @l_in = (fsedit::get_really_all_fstab($all_hds), @{$all_hds->{special}}); my %new; my @smb_credentials; @@ -270,7 +260,7 @@ sub prepare_write_fstab { } else { () } - } grep { $_->{device} && ($_->{mntpoint} || $_->{real_mntpoint}) && $_->{type} } (@l1, @l2); + } grep { $_->{device} && ($_->{mntpoint} || $_->{real_mntpoint}) && $_->{type} } @l_in; join('', map { $_->[1] } sort { $a->[0] cmp $b->[0] } @l), \@smb_credentials; } -- cgit v1.2.1