diff options
author | Norbert Preining <preining@logic.at> | 2009-02-03 12:56:24 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2009-02-03 12:56:24 +0000 |
commit | f0f383b043500d3449eed46c1ee1fd8dced513d7 (patch) | |
tree | e45c5ca94769b2996e6109f2c379f6c983402301 /Master/install-tl | |
parent | fcc121fbd794ac2f5dcec86ca94ddc5e0dea17ee (diff) |
rework install logic so that we can switch over to the GUI from wizard
without all those warnings about redefined subs
git-svn-id: svn://tug.org/texlive/trunk@12062 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/install-tl')
-rwxr-xr-x | Master/install-tl | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/Master/install-tl b/Master/install-tl index fa6116a6620..319eb5a3d7c 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -99,6 +99,14 @@ use strict; # $install{$packagename} == 1 if it should be installed my %install; +# +# the different modules have to assign a code blob to this global variable +# which starts the installation. +# Example: In install-menu-text.pl there is +# $::run_menu = \&run_menu_text; +# +$::run_menu = sub { die "no UI defined." ; }; + # the default scheme to be installed my $default_scheme='scheme-full'; @@ -399,8 +407,8 @@ if ($opt_profile eq "") { # here we could load different menu systems. Currently several things # are "our" so that the menu implementation can use it. The $tlpdb, the # %var, and all the @collection* - # install-menu-*.pl should implement a function run_menu() and should - # change ONLY stuff in %vars + # install-menu-*.pl have to assign a code ref to $::run_menu which is + # run, and should change ONLY stuff in %vars # The allowed keys in %vars should be specified somewhere ... # the menu implementation should return # MENU_INSTALL do the installation @@ -428,7 +436,8 @@ if ($opt_profile eq "") { tlwarn("Using text mode installer.\n"); require("installer/install-menu-text.pl"); } - my $ret = run_menu(@runargs); + + my $ret = &{$::run_menu}(@runargs); if ($ret == $MENU_QUIT) { do_cleanup(); MISSING flushlog(); @@ -1455,6 +1464,23 @@ sub do_portable { } } +# +# some helper fucntion +sub select_collections { + my $varref = shift; + foreach (@_) { + $varref->{$_} = 1; + } +} + +sub deselect_collections { + my $varref = shift; + foreach (@_) { + $varref->{$_} = 0; + } +} + + __END__ =head1 NAME |