diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-01-21 14:26:03 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-01-21 14:26:03 +0000 |
commit | 0b4644099d860d3ffa10a422dbcab59f44a069b8 (patch) | |
tree | b1f6ebc9afea3960b1674af5d08cca5baa4131cf | |
parent | d0f5941381bee8d2aa88940c958f2fff77efbe74 (diff) | |
download | drakx-0b4644099d860d3ffa10a422dbcab59f44a069b8.tar drakx-0b4644099d860d3ffa10a422dbcab59f44a069b8.tar.gz drakx-0b4644099d860d3ffa10a422dbcab59f44a069b8.tar.bz2 drakx-0b4644099d860d3ffa10a422dbcab59f44a069b8.tar.xz drakx-0b4644099d860d3ffa10a422dbcab59f44a069b8.zip |
- rename Xconfig::main::is_valid() to Xconfig::main::check_valid() and return the cause of the error
- ensure an empty config file doesn't make it display "Your Xorg configuration file is broken..."
-rw-r--r-- | perl-install/Xconfig/main.pm | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/perl-install/Xconfig/main.pm b/perl-install/Xconfig/main.pm index e53ce0caa..f3fa7047b 100644 --- a/perl-install/Xconfig/main.pm +++ b/perl-install/Xconfig/main.pm @@ -158,10 +158,12 @@ sub configure_chooser { sub configure_everything_or_configure_chooser { my ($in, $options, $auto, $o_keyboard, $o_mouse) = @_; - my $raw_X = eval { Xconfig::xfree->read }; - if (!$raw_X || !is_valid($raw_X)) { - log::l("ERROR: bad X config file $@"); + my $raw_X = eval { Xconfig::xfree->read }; + my $err = $@ && formatError($@); + $err ||= check_valid($raw_X) if $raw_X && @$raw_X; #- that's ok if config is empty + if ($err) { + log::l("ERROR: bad X config file (error: $err)"); $in->ask_okcancel('', N("Your Xorg configuration file is broken, we will ignore it.")) or return; $raw_X = []; @@ -215,15 +217,15 @@ sub export_to_install_X { $::o->{X}{Xinerama} = 1 if $X->{card}{Xinerama}; } -sub is_valid { +sub check_valid { my ($raw_X) = @_; my %sections = map { - my @l = $raw_X->get_Sections($_) or return; + my @l = $raw_X->get_Sections($_) or return "missing section $_"; $_ => \@l; } qw(Files InputDevice Monitor Device Screen ServerLayout); - $sections{Files}[0]{FontPath}; + $sections{Files}[0]{FontPath} or return "missing FontPath"; } #- most usefull XFree86-4.0.1 server options. Default values is the first ones. |