diff options
author | Norbert Preining <preining@logic.at> | 2008-01-09 13:15:53 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-01-09 13:15:53 +0000 |
commit | ee1a04809137d89731d5084db7296979dac6cb89 (patch) | |
tree | 8a266ff0ea31301ed3ee269b424e18d11526a9da /Master | |
parent | 4141e69a42b45f87439e90778a3d31ee7a3e2537 (diff) |
ok, working perl/tk installer
git-svn-id: svn://tug.org/texlive/trunk@6164 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/install-tl.pl | 9 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/install-menu-perltk.pl | 58 |
2 files changed, 53 insertions, 14 deletions
diff --git a/Master/install-tl.pl b/Master/install-tl.pl index 1abd7324962..3809f077c5f 100755 --- a/Master/install-tl.pl +++ b/Master/install-tl.pl @@ -96,12 +96,14 @@ my $opt_media = ""; my $opt_url = ""; my $opt_profile = ""; my $opt_no_cls=0; +my $opt_gui = 0; $::netarchive = "archive"; $::diskarchive = "archive"; GetOptions("media=s" => \$opt_media, "profile=s"=> \$opt_profile, "no-cls", + "gui", \$opt_gui, "netarchive=s" => \$::netarchive, "diskarchive=s" => \$::diskarchive, "url=s" => \$opt_url ) or die("No pod doc till now!"); @@ -171,8 +173,11 @@ if ($opt_profile eq "") { our $MENU_INSTALL = 0; our $MENU_ABORT = 1; our $MENU_QUIT = 2; - #require("TeXLive/install-menu-perltk.pl"); - require("TeXLive/install-menu-text.pl"); + if ($opt_gui) { + require("TeXLive/install-menu-perltk.pl"); + } else { + require("TeXLive/install-menu-text.pl"); + } my $ret = run_menu(); if ($ret == $MENU_QUIT) { # do_cleanup(); MISSING diff --git a/Master/tlpkg/TeXLive/install-menu-perltk.pl b/Master/tlpkg/TeXLive/install-menu-perltk.pl index 389c0eddc43..529d2c7a052 100644 --- a/Master/tlpkg/TeXLive/install-menu-perltk.pl +++ b/Master/tlpkg/TeXLive/install-menu-perltk.pl @@ -58,19 +58,23 @@ sub run_menu { )->pack; $collectionstext = $mw->Label(); $collectionstext->pack; - $mw->Button( - -text => "Directories' setup", - -command => sub { notimpl(); } - )->pack; - $texdirtext = $mw->Label(); - $texmflocaltext = $mw->Label(); - $texmfsysvartext = $mw->Label(); + #$mw->Button( + # -text => "Directories' setup", + # -command => sub { notimpl(); } + #)->pack; + $mw->Label(-text => "Directories' setup")->pack; + $texdirtext = $mw->Button( + -command => sub { menu_edit_vars_value("TEXDIR"); } ); + $texmflocaltext = $mw->Button( + -command => sub { menu_edit_vars_value("TEXMFLOCAL"); } ); + $texmfsysvartext = $mw->Button( + -command => sub { menu_edit_vars_value("TEXMFSYSVAR"); } ); $texdirtext->pack; $texmflocaltext->pack; $texmfsysvartext->pack; $mw->Button( - -text => 'Quit', - -command => sub { $return = $MENU_QUIT; $mw->destroy }, + -text => 'Go!', + -command => sub { $return = $MENU_INSTALL; $mw->destroy }, )->pack; $mw->Button( -text => 'Cancel', @@ -78,8 +82,7 @@ sub run_menu { )->pack; menu_update_texts(); Tk::MainLoop(); - print "return value = $return\n"; - return $MENU_ABORT; + return($return); } sub notimpl { @@ -88,7 +91,19 @@ sub notimpl { -command => [ $errorwin => 'destroy' ])->pack; } - +sub menu_edit_vars_value { + my $key = shift; + my $sw = $mw->Toplevel; + my $val = $vars{$key}; + $sw->Label(-text => "Enter path for $key:")->pack; + my $entry = $sw->Entry(-textvariable => $val, -width => 0); + $entry->pack; + $sw->Button(-text => "Ok", + -command => sub { $val = $entry->get; callback_edit_directories($key,$val) ; $sw->destroy })->pack; + $sw->Button(-text => "Cancel", + -command => sub { $sw->destroy })->pack; +} + sub menu_select_scheme { my $sw = $mw->Toplevel; my @schemes; @@ -212,6 +227,25 @@ sub callback_select_systems() { menu_update_texts(); } +sub callback_edit_directories { + my ($key,$val) = @_; + $vars{$key} = $val; + if ($vars{'TEXDIR'}=~/^(.*)\/$texlive_release$/) { + $vars{'TEXMFLOCAL'}="$1/texmf-local"; + $vars{'TEXMFSYSVAR'}="$1/$texlive_release/texmf-var"; + } elsif ($vars{'TEXDIR'}=~/^(.*)$/) { + $vars{'TEXMFLOCAL'}="$1/texmf-local"; + $vars{'TEXMFSYSVAR'}="$1/texmf-var"; + } + menu_update_texts(); +} + +sub callback_edit_var() { + my ($key,$val) = @_; + $vars{$key} = $val; + menu_update_texts(); +} + sub dump_vars_stdout { foreach my $k (keys %vars) { print "DEBUG: vars{$k} = $vars{$k}\n"; |