diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2001-09-08 17:35:55 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2001-09-08 17:35:55 +0000 |
commit | 4eab2ce13d7e815057b8f0377a65cc43ba63c03c (patch) | |
tree | 0598a9a4c77799a26cbee88533d5f33465a4bb77 /perl-install | |
parent | 58b5e5e749d03e268b421179fa4741e7563de798 (diff) | |
download | drakx-4eab2ce13d7e815057b8f0377a65cc43ba63c03c.tar drakx-4eab2ce13d7e815057b8f0377a65cc43ba63c03c.tar.gz drakx-4eab2ce13d7e815057b8f0377a65cc43ba63c03c.tar.bz2 drakx-4eab2ce13d7e815057b8f0377a65cc43ba63c03c.tar.xz drakx-4eab2ce13d7e815057b8f0377a65cc43ba63c03c.zip |
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
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/modules.pm | 6 |
1 files 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"; } |