diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-03-31 13:30:24 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-03-31 13:30:24 +0000 |
commit | a18dcc6a1374f46fbb621683daa3956572bcc1aa (patch) | |
tree | 1aab12c13b51067748ee7fc06a87f137bebc8ee6 | |
parent | 08799daa089f24812a4aaaa9208fca8abe823f3a (diff) | |
download | rpmdrake-a18dcc6a1374f46fbb621683daa3956572bcc1aa.tar rpmdrake-a18dcc6a1374f46fbb621683daa3956572bcc1aa.tar.gz rpmdrake-a18dcc6a1374f46fbb621683daa3956572bcc1aa.tar.bz2 rpmdrake-a18dcc6a1374f46fbb621683daa3956572bcc1aa.tar.xz rpmdrake-a18dcc6a1374f46fbb621683daa3956572bcc1aa.zip |
(readconf) prevent crash by ignoring undefined values (crash hapenned
if config file set empty values for some variables (eg: after old
gurpmi.addmedia garbaged it)) (#39511)
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | rpmdrake.pm | 3 |
2 files changed, 5 insertions, 0 deletions
@@ -1,5 +1,7 @@ - rpmdrake: o do not crash if package is unknow (#39608) + o do not crash if config file set empty values for some variables + (eg: after old buggy gurpmi.addmedia garbaged it) (#39511) - gurpmi.addmedia: o handle --mirrorlist (Anssi) diff --git a/rpmdrake.pm b/rpmdrake.pm index 4e2a3482..da4a8570 100644 --- a/rpmdrake.pm +++ b/rpmdrake.pm @@ -169,6 +169,9 @@ sub readconf() { ${$config{$_}{var}} = $config{$_}{default} foreach keys %config; foreach my $l (cat_($configfile)) { $l =~ /^\Q$_\E (.*)/ and ${$config{$_}{var}} = [ split ' ', $1 ] foreach keys %config; + foreach (keys %config) { + $l =~ /^\Q$_\E (.*)/ and $1 and ${$config{$_}{var}} = [ split ' ', $1 ]; + } } # special cases: $::rpmdrake_options{'no-confirmation'} = $no_confirmation->[0] if !defined $::rpmdrake_options{'no-confirmation'}; |