diff options
author | Norbert Preining <preining@logic.at> | 2008-06-03 07:43:47 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-06-03 07:43:47 +0000 |
commit | e65e28eb72c20bb0b14d6e03ea8d9200ababfb9d (patch) | |
tree | 8d07fadec6e5652cf90aaebdc4da1b488e0a7f4a /Master | |
parent | 619be632f4c865548cbd164e7fdcb001f00e8ff4 (diff) |
tlmgrgui: clean up after the splitting
git-svn-id: svn://tug.org/texlive/trunk@8512 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui-real.pl | 43 | ||||
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl | 40 |
2 files changed, 45 insertions, 38 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui-real.pl b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui-real.pl index ab36a86d13e..2b4838e15d1 100755 --- a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui-real.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui-real.pl @@ -29,6 +29,14 @@ use TeXLive::TLConfig; use TeXLive::TLUtils qw(setup_programs platform_desc win32); use Getopt::Long qw(:config no_autoabbrev require_order); +use Tk; +use Tk::Dialog; +use Tk::NoteBook; +use Tk::BrowseEntry; +use Tk::ROText; +use Tk::Balloon; + + # # translation facility, not fully functional by now @@ -182,41 +190,6 @@ if (defined($LANG) && (-r "$Master/texmf/scripts/texlive/tlmgrgui/lang/$LANG")) } } -# -# ok we try to load Tk and break and give a decent message if it does not -# work: -# -#use Tk; -eval { require Tk; }; -if ($@) { - # that didn't work out, give some usefull error message and stop - if (win32()) { - printf STDERR "Cannot load Tk, that should not happen as we ship it! -How did you start tlmgrgui??\n(Error message: $@)\n"; - } else { - printf STDERR " -Cannot load Tk, thus the GUI cannot be started! -The Perl/Tk module is not shipped with the TeX Live installation. -You have to install it to get tlmgr GUI running. -(Error message: $@) -"; - } - exit 1; -} -use Tk; - -# now require the others ... -#use Tk::Dialog; -#use Tk::NoteBook; -#use Tk::BrowseEntry; -#use Tk::ROText; -#use Tk::Balloon; -require Tk::Dialog; -require Tk::NoteBook; -require Tk::BrowseEntry; -require Tk::ROText; -require Tk::Balloon; - our @update_function_list; our $debugmode = 0; diff --git a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl index 1e8ec23a549..50151226ac7 100755 --- a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl @@ -1,4 +1,22 @@ - +#!/usr/bin/env perl +# Copyright 2008 Tomasz Luczak, Norbert Preining +# +# GUI for tlmgr +# +# This wrapper is a strange thing: If we do +# require Tk; +# we get errors when calling Tk::DoOneEvent(Tk::Event::DONT_WAIT): +# Tk::Error: Usage [$object->]DoOneEvent([flags]) got 'Tk::Event::DONT_WAIT' +# If I do +# use Tk; +# it goes away, but we cannot catch errors there. +# Also, doing +# BEGIN { require Tk; } +# does work, but has the same problems. +# +# Now, the strange thing is that if I use a wrapper and require the real +# script the error goes away. Dont ask me why .... +# $^W = 1; use strict; @@ -9,9 +27,25 @@ BEGIN { unshift (@INC, "$Master/tlpkg", "$Master/texmf/scripts/texlive/tlmgrgui"); } - eval { require Tk; }; +if ($@) { + # that didn't work out, give some usefull error message and stop + if ($^O=~/^MSWin(32|64)$/i) { + printf STDERR "Cannot load Tk, that should not happen as we ship it! +How did you start tlmgrgui??\n(Error message: $@)\n"; + } else { + printf STDERR " +Cannot load Tk, thus the GUI cannot be started! +The Perl/Tk module is not shipped with the TeX Live installation. +You have to install it to get tlmgr GUI running. +(Error message: $@) +"; + } + exit 1; +} require("tlmgrgui-real.pl"); -print "Starting tlmgrgui ...\n"; +# should not be reached ... +# +exit 0; |