summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-11-28 17:47:31 +0000
committerNorbert Preining <preining@logic.at>2008-11-28 17:47:31 +0000
commit6118480a3d5062d2547040178162a3d9e5cf6c94 (patch)
tree0c1d148a1a338c0beacc3c2113f1aec756478077 /Master
parentc8c9fcdb443684e5fcde5385cc404e1fece80742 (diff)
more work on tlmgr2 with integrated gui, most things work now AFAIS
git-svn-id: svn://tug.org/texlive/trunk@11456 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr2.pl29
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgrgui/tlmgrgui2.pl121
2 files changed, 55 insertions, 95 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr2.pl b/Master/texmf/scripts/texlive/tlmgr2.pl
index 18553a59d7a..dc4d74e217b 100755
--- a/Master/texmf/scripts/texlive/tlmgr2.pl
+++ b/Master/texmf/scripts/texlive/tlmgr2.pl
@@ -26,8 +26,6 @@
# - (?) removal does not remove created format files from TEXMFSYSVAR
# - after install/update show the number of bytes transfered
# (email Rolf Niepraschk)
-# - merge tlmgrgui into tlmgr to reduce re-loading of tlpdb again and again
-# and reuse the install function
# - move the remove_package function into TLPDB.pm, so that the remove_package
# from TLPDB actually removes the files, too. Maybe some better names
# are necessary.
@@ -113,16 +111,25 @@ if (!defined($action) && $opt_gui) {
$action = "gui";
}
-if ($opt_version || (defined $action && $action eq "version")) {
- info("tlmgr revision $tlmgrrevision\n");
- info("tlmgr using installation: $Master\n");
- if (open (REL_TL, "$Master/release-texlive.txt")) {
- # print first and last lines, which have the TL version info.
- my @rel_tl = <REL_TL>;
- info($rel_tl[0]);
- info($rel_tl[$#rel_tl]);
- close (REL_TL);
+sub give_version {
+ if (!defined($::version_string)) {
+ $::version_string = "";
+ $::version_string .= "tlmgr revision $tlmgrrevision\n";
+ $::version_string .= "tlmgr using installation: $Master\n";
+ if (open (REL_TL, "$Master/release-texlive.txt")) {
+ # print first and last lines, which have the TL version info.
+ my @rel_tl = <REL_TL>;
+ $::version_string .= $rel_tl[0];
+ $::version_string .= $rel_tl[$#rel_tl];
+ close (REL_TL);
+ }
}
+ return $::version_string;
+}
+
+
+if ($opt_version || (defined $action && $action eq "version")) {
+ info( give_version() );
finish(0);
}
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui2.pl b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui2.pl
index 2fd0910b605..525f4fa95bc 100755
--- a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui2.pl
+++ b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui2.pl
@@ -1,18 +1,11 @@
#!/usr/bin/env perl
#
-# $Id: tlmgrgui-real.pl 10704 2008-09-23 20:24:57Z preining $
+# $Id: tlmgrgui2.pl 10704 2008-09-23 20:24:57Z preining $
#
# Copyright 2008 Tomasz Luczak, Norbert Preining
#
# GUI for tlmgr
#
-# TODO:
-# - (more complicated) make this script be require-able from tlmgr.pl
-# so that we don't have to do the $localtlpdb initialization
-# twice, *and* can take advantage of the action_* routines.
-# But OTOH then we will not have output into a windows, so I am not
-# sure that this would be the best option.
-#
our $Master;
@@ -112,6 +105,24 @@ $TRANS{'en'} = {
};
+sub update_status_window {
+ update_status(join(" ", @_));
+ $mw->update;
+}
+
+push @::info_hook, \&update_status_window;
+push @::warn_hook, \&update_status_window;
+push @::debug_hook, \&update_status_window;
+push @::ddebug_hook, \&update_status_window;
+push @::dddebug_hook, \&update_status_window;
+
+sub update_status {
+ my ($p) = @_;
+ $::progressw->insert("end", "$p\n");
+ $::progressw->see("end");
+}
+
+
#
# we keep the translations in different arrays since we MAY add the feature
# to switch language on the fly
@@ -176,46 +187,20 @@ if (defined($LANG) && (-r "$Master/texmf/scripts/texlive/tlmgrgui/lang/$LANG"))
our @update_function_list;
-our $debugmode = 0;
-$debugmode = 1 if ($::opt_verbosity > 0);
-
our $mw = MainWindow->new(-title => "tlmgr 2008");
$mw->withdraw;
-my $splash = $mw->Splashscreen;
-$splash->Label(-text => ___"loadtlpdbwait")->pack;
-$splash->Splash();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
-$splash->update();
+
+# create a progress bar window
+$::sww = $mw->Toplevel(-title => "log window",
+ -width => 400);
+$::sww->transient($mainwindow);
+#$::sww->grab();
+$::sww->Label(-text => "Log output")->pack;
+$::progressw = $::sww->Scrolled("ROText", -scrollbars => "e", -height => 16);
+$::progressw->pack(-expand => 1, -fill => "both");
+
+info(___("loadtlpdbwait") . "\n");
+
our $localtlpdb = TeXLive::TLPDB->new ("root" => "$Master");
die("cannot find tlpdb!") unless (defined($localtlpdb));
@@ -236,23 +221,6 @@ our @allpackages;
our $balloon = $mw->Balloon();
-push @::info_hook,
- sub {
- update_status(join(" ",@_));
- $mw->update;
- };
-push @::warn_hook,
- sub {
- update_status(join(" ",@_));
- $mw->update;
- };
-
-sub update_status {
- my ($p) = @_;
- $::progressw->insert("end", "$p\n");
- $::progressw->see("end");
-}
-
push @update_function_list, \&check_location_on_ctan;
push @update_function_list, \&init_install_media;
@@ -268,7 +236,7 @@ our $top = $mw->Frame;
our $quit = $top->Button(-text => ___"quit",
-command => sub { $mw->destroy; exit(0); });
-my $tlmgrrev = `tlmgr --version`;
+my $tlmgrrev = give_version();
chomp($tlmgrrev);
our $about = $top->Button(-text => ___"about",
-command => sub {
@@ -299,7 +267,7 @@ $balloon->attach(
$balloon->attach(
$top->Checkbutton(-text => ___"debug",
- -variable => \$debugmode)->pack(-side => 'left'),
+ -variable => \$::opt_verbosity)->pack(-side => 'left'),
-balloonmsg => ___"debugballoon");
# frame .back -borderwidth 2
@@ -367,19 +335,10 @@ if (defined($opt_screen)) {
$back->raise("$opt_screen");
}
-$splash->Destroy;
+info(___("completed") . "\n");
$mw->deiconify;
-# create a progress bar window
-$::sww = $mw->Toplevel(-title => "log window",
- -width => 400);
-$::sww->transient($mainwindow);
-#$::sww->grab();
-$::sww->Label(-text => "Log output")->pack;
-$::progressw = $::sww->Scrolled("ROText", -scrollbars => "e", -height => 16);
-$::progressw->pack(-expand => 1, -fill => "both");
-
Tk::MainLoop();
@@ -389,15 +348,9 @@ sub init_install_media {
if (defined($tlmediatlpdb) && ($tlmediatlpdb->root eq $newroot)) {
# nothing to be done
} else {
- my $iboo = $mw->Toplevel(-title => "Loading TLPDB");
- $iboo->transient($mw);
- $iboo->Label(-text => ___"loadremotetlpdbwait")->pack();
- for (my $i = 0; $i < 100; $i++) {
- Tk::DoOneEvent(Tk::Event::DONT_WAIT);
- }
- $iboo->grab();
+ info(___("loadremotetlpdbwait") . "\n");
$tlmediasrc = TeXLive::TLMedia->new($newroot);
- $iboo->destroy;
+ info(___("completed") . "\n");
if (!defined($tlmediasrc)) {
# something went badly wrong, maybe the newroot is wrong?
$mw->Dialog(-title => "warning",
@@ -422,7 +375,7 @@ sub set_text_win {
$w->see("0.0");
}
-sub run_program_show_output_old {
+sub run_program_show_output {
warn("tlmgr running old style way: @_");
my $td = $mw->Toplevel(-title => ___"tlmgr process");
$td->transient($mw);