summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/XFdrake
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone/XFdrake')
-rwxr-xr-xperl-install/standalone/XFdrake60
1 files changed, 31 insertions, 29 deletions
diff --git a/perl-install/standalone/XFdrake b/perl-install/standalone/XFdrake
index 072f770a1..46c5b6f63 100755
--- a/perl-install/standalone/XFdrake
+++ b/perl-install/standalone/XFdrake
@@ -17,41 +17,43 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-use lib qw(/usr/lib/libDrakX);
+use lib qw(/usr/lib/libDrakX .);
-use interactive;
+use common qw(:file);
use Xconfigurator;
use Xconfig;
-use c;
local $_ = join '', @ARGV;
-/-h/ and die "usage: XFdrake [--xf3] [--beginner] [--expert] [--auto] [--noauto] [--skiptest] [--testing]\n";
-
-my $i = {};
+/-h/ and die "usage: XFdrake [--beginner] [--expert] [--auto] [--noauto] [--skiptest] [--testing]\n";
+$::beginner = /--beginner/;
+$::expert = /--expert/;
+$::auto = /--auto/;
+$::noauto = /--noauto/;
+$::skiptest = /--skiptest/;
+$::testing = /--testing/;
$::isStandalone = 1;
-$::force_xf3 = /-xf3/;
-$::beginner = /-beginner/;
-$::expert = /-expert/;
-$::auto = /-auto/;
-$::noauto = /-noauto/;
-$::testing = /-testing/;
-$i->{skiptest} = /-skiptest/;
-
-my $f = "/usr/X11R6/lib/X11/Cards";
--e $f or system("urpmi --auto XFree86 XFree86-75dpi-fonts");
--e $f or die "install XFree86 first!\n";
-
-my $in = vnew interactive('su');
-
-`pidof xfs` > 0 or system("/etc/rc.d/init.d/xfs start");
-
-system("mount /proc 2>/dev/null"); # ensure /proc is mounted for pci probing
-
-Xconfig::getinfoFromXF86Config($i) if $0 =~ Xdrakres;
-Xconfig::getinfo($i);
-
-Xconfigurator::main('', $i, $in, 0, -e "/etc/pcmcia", sub { system("urpmi --auto XFree86-$_[0]") });
-$in->exit(0);
+my $hasX = do { `xtest`; $? == 0 };
+
+my $in; if ($hasX) {
+ require 'interactive_gtk.pm';
+ $in = interactive_gtk->new;
+} else {
+ *log::l = undef;
+ *log::l = sub {};
+ require 'interactive_newt.pm';
+ $in = interactive_newt->new;
+}
+
+Xconfigurator::main('', Xconfig::getinfo(), $in,
+# sub {
+# use install_any;
+# print "Here\n";
+# my ($X) = glob_("/mnt/disk/XFree86-$_[0]-*") or die "$_[0]'s X server rpm not found";
+# pkgs::install('', [ { name => $_[0], file => $X } ], 1, 0);
+# }
+);
+
+exec 'true' if $hasX; #- workaround for perl-GTK