From 0cb8d381782f76286862f0e83b0d8f27485e2cc9 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 31 Jan 2009 00:52:07 +0000 Subject: use -gui [[=]plugin] instead of -ui git-svn-id: svn://tug.org/texlive/trunk@12023 c570f23f-e606-0410-a88d-b1316a301751 --- Master/install-tl | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'Master') diff --git a/Master/install-tl b/Master/install-tl index 54a5443caf2..f9dfe4f1752 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -138,8 +138,7 @@ our %vars=( # 'n_' means 'number of'. # option handling my $opt_from_dvd = ""; -my $opt_gui = 0; -my $opt_ui = "text"; # default UI +my $opt_gui = (win32() ? "perltk" : "text"); my $opt_help = 0; my $opt_location = ""; my $opt_no_gui = 0; @@ -151,7 +150,6 @@ my $opt_profile = ""; my $opt_scheme = ""; my $opt_version = 0; -$opt_gui = 1 if (win32); # default language for GUI installer $::lang = "en"; @@ -177,8 +175,7 @@ process_logging_options(); GetOptions( "fancyselector" => \$::alternative_selector, "from_dvd" => \$opt_from_dvd, - "gui" => \$opt_gui, - "ui=s" => \$opt_ui, + "gui:s" => \$opt_gui, "lang=s" => \$::opt_lang, "location|url=s" => \$opt_location, "no-cls", # $::opt_no_cls in install-menu-text-pl @@ -192,6 +189,11 @@ GetOptions( "version" => \$opt_version, "help|?" => \$opt_help) or pod2usage(1); +if ($opt_gui eq "") { + # the --gui option was given with an empty argument, set it to perltk + $opt_gui = "perltk"; +} + if (win32()) { pod2usage(-exitstatus => 0, -verbose => 2, @@ -217,7 +219,7 @@ if ($opt_version) { if ($#ARGV >= 0) { # we still have arguments left, should only be gui, otherwise die if ($ARGV[0] =~ m/^gui$/i) { - $opt_gui = 1; + $opt_gui = "perltk"; } else { die "$0: Extra arguments `@ARGV'; try --help if you need it.\n"; } @@ -269,7 +271,7 @@ if ($opt_print_arch) { # check as soon as possible for GUI functionality to give people a chance # tp interrupt. -if ($opt_gui && !$opt_no_gui && ($opt_profile eq "")) { +if (($opt_gui ne "text") && !$opt_no_gui && ($opt_profile eq "")) { # try to load Tk.pm, but don't die if it doesn't work eval { require Tk; }; if ($@) { @@ -279,7 +281,7 @@ if ($opt_gui && !$opt_no_gui && ($opt_profile eq "")) { tlwarn("Error message from loading Tk:\n"); tlwarn(" $@\n"); tlwarn("Continuing in text mode...\n"); - $opt_gui = 0; + $opt_gui = "text"; } eval { my $foo = Tk::MainWindow->new; $foo->destroy; }; if ($@) { @@ -290,9 +292,9 @@ if ($opt_gui && !$opt_no_gui && ($opt_profile eq "")) { tlwarn("Error message from creating MainWindow:\n"); tlwarn(" $@\n"); tlwarn("Continuing in text mode...\n"); - $opt_gui = 0; + $opt_gui = "text"; } - if (!$opt_gui) { + if ($opt_gui eq "text") { # we switched from GUI to non-GUI mode, tell the user and wait a bit tlwarn("\nSwitching to text mode installer, if you want to cancel, do it now.\n"); tlwarn("Waiting for 3 second\n"); @@ -408,11 +410,11 @@ if ($opt_profile eq "") { our $MENU_ABORT = 1; our $MENU_QUIT = 2; our $MENU_ALREADYDONE = 3; - $opt_ui = "perltk" if ($opt_gui && !$opt_no_gui); - if (-r "tlpkg/installer/install-menu-${opt_ui}.pl") { - require("installer/install-menu-${opt_ui}.pl"); + $opt_gui = "text" if ($opt_no_gui); + if (-r "tlpkg/installer/install-menu-${opt_gui}.pl") { + require("installer/install-menu-${opt_gui}.pl"); } else { - tlwarn("UI plugin $opt_ui not found,\n"); + tlwarn("UI plugin $opt_gui not found,\n"); tlwarn("Using text mode installer.\n"); require("installer/install-menu-text.pl"); } -- cgit v1.2.3