summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-06-01 11:22:14 +0000
committerNorbert Preining <preining@logic.at>2008-06-01 11:22:14 +0000
commita08cf669697366b342608b8f6f535f50201ddac4 (patch)
tree46079ba96dda442a76a1499e636cd1a0ec86e138
parentd72679b37000477e79293508f485c464fb006636 (diff)
tlmgrgui.pl: try to give a decent error message when Tk.pm cannot be found
git-svn-id: svn://tug.org/texlive/trunk@8449 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl40
1 files changed, 34 insertions, 6 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl
index 0b6648c3b11..29717fba3fb 100755
--- a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl
+++ b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl
@@ -28,12 +28,40 @@ use TeXLive::TLPDB;
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;
+
+
+#
+# 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";
+ } 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.
+";
+ }
+ exit 1;
+}
+
+# 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;
my $opt_location;
my $opt_debug = 0;