From 4eab2ce13d7e815057b8f0377a65cc43ba63c03c Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Sat, 8 Sep 2001 17:35:55 +0000 Subject: fix write_conf regarding /etc/modules so that (1) it doesn't flush it when it didn't decide to put any modules in it (to leave user's modules) (2) it doesn't remove the last line (3) it uses stronger regexp'es for substitution to not remove modules that have names made of other modules names subsets --- perl-install/modules.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/perl-install/modules.pm b/perl-install/modules.pm index 2d03a93af..b81d29f82 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -693,12 +693,12 @@ sub write_conf { my @l = (); push @l, 'ide-floppy' if detect_devices::ide_zips(); push @l, 'bttv' if grep { $_->{driver} eq 'bttv' } detect_devices::probeall(); - my $l = join '|', @l; + my $l = join '|', map { '^\s*'.$_.'\s*$' } @l; log::l("to put in modules ", join(", ", @l)); substInFile { - $_ = '' if /$l/; - $_ = join '', map { "$_\n" } @l if eof; + $_ = '' if $l && /$l/; + $_ .= join '', map { "$_\n" } @l if eof; } "$prefix/etc/modules"; } -- cgit v1.2.1