diff options
author | Norbert Preining <preining@logic.at> | 2008-01-14 14:30:19 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-01-14 14:30:19 +0000 |
commit | e1c94789177b5a9dc0885aaac29a3b0d0277d8bb (patch) | |
tree | 03b7e20bc467e93d423fe689b28f8d3755a7af79 /Master | |
parent | 589f4c6057ba0e65f646bedb05d7a0510795475e (diff) |
make "Cancel" actually work as a cancel, instead of what it was before,
namely a wrongly named and incomplete "Return" ;-)
git-svn-id: svn://tug.org/texlive/trunk@6227 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/install-tl.pl | 16 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/install-menu-perltk.pl | 36 |
2 files changed, 33 insertions, 19 deletions
diff --git a/Master/install-tl.pl b/Master/install-tl.pl index 47e35dd7a41..92b1d91888b 100755 --- a/Master/install-tl.pl +++ b/Master/install-tl.pl @@ -320,11 +320,17 @@ sub do_installation { sub dump_vars { my $filename=shift; - open VARS, ">$filename"; + my $fh; + if (ref($filename)) { + $fh = $filename; + } else { + open VARS, ">$filename"; + $fh = \*VARS; + } foreach my $key (keys %vars) { - print VARS "$key $vars{$key}\n"; + print $fh "$key $vars{$key}\n"; } - close VARS; + close VARS if (!ref($filename)); tllog($::LOG_DEBUG, "\n%vars dumped to '$filename'.\n"); } @@ -402,6 +408,10 @@ sub calc_depends { # First look for packages in the selected scheme. my $scheme=$tlpdb->get_package($vars{'selected_scheme'}); + if (!defined($scheme)) { + dump_vars(\*STDOUT); + die ("Scheme $vars{'selected_scheme'} not defined!\n"); + } for my $scheme_content ($scheme->depends) { $install{"$scheme_content"}=1 unless ($scheme_content=~/^collection-/); diff --git a/Master/tlpkg/TeXLive/install-menu-perltk.pl b/Master/tlpkg/TeXLive/install-menu-perltk.pl index fd1b1882190..cc1d059b1b1 100644 --- a/Master/tlpkg/TeXLive/install-menu-perltk.pl +++ b/Master/tlpkg/TeXLive/install-menu-perltk.pl @@ -208,15 +208,16 @@ sub menu_select_standard_collections { my $fd = $sw->Frame; my $f1 = $fb->Frame; my $f2 = $fb->Frame; + my %lvars = %vars; $sw->Label(-text => 'Select the collections to be installed')->pack; my $halfcol = $#collections_std / 2; my $i = 0; foreach my $coll (sort @collections_std) { my $tlpobj = $tlpdb->get_package("$coll"); if ($i < $halfcol) { - $f1->Checkbutton(-variable => \$vars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w'); + $f1->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w'); } else { - $f2->Checkbutton(-variable => \$vars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w'); + $f2->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w'); } $i++; } @@ -225,12 +226,12 @@ sub menu_select_standard_collections { $fb->pack; $fd->pack(-expand => 'x'); $fd->Button(-text => "Select all", - -command => sub { select_collections(@collections_std) })->pack(-side => 'left'); + -command => sub { select_collections(\%lvars, @collections_std) })->pack(-side => 'left'); $fd->Button(-text => "Deselect all", - -command => sub { deselect_collections(@collections_std) })->pack(-side => 'right'); + -command => sub { deselect_collections(\%lvars, @collections_std) })->pack(-side => 'right'); $fc->pack(-expand => 'x'); $fc->Button(-text => "Return", - -command => sub { callback_select_collection() ; $sw->destroy })->pack(-side => 'left'); + -command => sub { %vars = %lvars; callback_select_collection() ; $sw->destroy })->pack(-side => 'left'); $fc->Button(-text => "Cancel", -command => sub { $sw->destroy })->pack(-side => 'right'); } @@ -250,21 +251,22 @@ sub menu_select_lang_collections { my $f1langLb = $f1langL->Frame; $f1langLb->pack(-side => 'right'); my $langh = $#collections_lang / 2; my $i = 0; + my %lvars = %vars; foreach my $coll (sort @collections_lang) { my $tlpobj = $tlpdb->get_package("$coll"); if ($i < $langh) { - $f1langLa->Checkbutton(-variable => \$vars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w'); + $f1langLa->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w'); } else { - $f1langLb->Checkbutton(-variable => \$vars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w'); + $f1langLb->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w'); } $i++; } my $f1langB = $f1lang->Frame; $f1langB->pack(-expand => 'x'); $f1langB->Button(-text => "Select all", - -command => sub { select_collections(@collections_lang) })->pack(-side => 'left'); + -command => sub { select_collections(\%lvars, @collections_lang) })->pack(-side => 'left'); $f1langB->Button(-text => "Deselect all", - -command => sub { deselect_collections(@collections_lang) })->pack(-side => 'right'); + -command => sub { deselect_collections(\%lvars, @collections_lang) })->pack(-side => 'right'); my $f1docT = $f1doc->Frame; $f1docT->pack; my $f1docL = $f1doc->Frame; $f1docL->pack; @@ -276,21 +278,21 @@ sub menu_select_lang_collections { foreach my $coll (sort @collections_lang_doc) { my $tlpobj = $tlpdb->get_package("$coll"); if ($i < $doch) { - $f1docLa->Checkbutton(-variable => \$vars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w'); + $f1docLa->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w'); } else { - $f1docLb->Checkbutton(-variable => \$vars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w'); + $f1docLb->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w'); } $i++; } my $f1docB = $f1doc->Frame; $f1docB->pack(-expand => 'x'); $f1docB->Button(-text => "Select all", - -command => sub { select_collections(@collections_lang_doc) })->pack(-side => 'left'); + -command => sub { select_collections(\%lvars, @collections_lang_doc) })->pack(-side => 'left'); $f1docB->Button(-text => "Deselect all", - -command => sub { deselect_collections(@collections_lang_doc) })->pack(-side => 'right'); + -command => sub { deselect_collections(\%lvars, @collections_lang_doc) })->pack(-side => 'right'); my $f2 = $sw->Frame; $f2->pack(-expand => 'x'); $f2->Button(-text => "Return", - -command => sub { callback_select_collection() ; $sw->destroy })->pack(-side => 'left'); + -command => sub { %vars = %lvars; callback_select_collection() ; $sw->destroy })->pack(-side => 'left'); $f2->Button(-text => "Cancel", -command => sub { $sw->destroy })->pack(-side => 'right'); } @@ -488,14 +490,16 @@ sub dump_vars_stdout { } sub select_collections { + my $varref = shift; foreach (@_) { - $vars{$_} = 1; + $varref->{$_} = 1; } } sub deselect_collections { + my $varref = shift; foreach (@_) { - $vars{$_} = 0; + $varref->{$_} = 0; } } |