From 7461e6812b014dfdaad0f88f19e8fa49c6a32132 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 23 Feb 2001 13:06:49 +0000 Subject: (vnew): use /usr/X11R6/bin/xtest instead of c::Xtest --- perl-install/interactive.pm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'perl-install/interactive.pm') 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 {} -- cgit v1.2.1