diff options
Diffstat (limited to 'perl-install/interactive.pm')
-rw-r--r-- | perl-install/interactive.pm | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index 8754970c6..7121689f0 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -57,23 +57,23 @@ sub vnew { my ($type, $su) = @_; $su = $su eq "su"; require c; - if ($ENV{DISPLAY} && c::Xtest($ENV{DISPLAY})) { + if ($ENV{DISPLAY} && system('/usr/X11R6/bin/xtest', '') == 0) { if ($su) { $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}"; $> and exec "kdesu", "-c", "$0 @ARGV"; } - require interactive_gtk; - interactive_gtk->new; - } else { - if ($su && $>) { - die "you must be root to run this program"; - } - require 'log.pm'; - undef *log::l; - *log::l = sub {}; # otherwise, it will bother us :( - require interactive_newt; - interactive_newt->new; + eval { require interactive_gtk }; + !$@ and return interactive_gtk->new; + } + + if ($su && $>) { + die "you must be root to run this program"; } + require 'log.pm'; + undef *log::l; + *log::l = sub {}; # otherwise, it will bother us :( + require interactive_newt; + interactive_newt->new; } sub enter_console {} |