diff options
author | Norbert Preining <preining@logic.at> | 2009-05-12 15:53:11 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2009-05-12 15:53:11 +0000 |
commit | 7e5585bcd4f8ba119cad8f0a7e13b6a7a610776f (patch) | |
tree | c48db3cea0e4511d09d0e7b7fdf7ef7a04f68f6e /Master/tlpkg/installer/install-menu-text.pl | |
parent | c84165218f94bc15a1441e91a421f4d070bc5eb7 (diff) |
Move most of the stuff from tlpkg, tlmgr from branch to trunk
git-svn-id: svn://tug.org/texlive/trunk@13054 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/installer/install-menu-text.pl')
-rwxr-xr-x | Master/tlpkg/installer/install-menu-text.pl | 142 |
1 files changed, 101 insertions, 41 deletions
diff --git a/Master/tlpkg/installer/install-menu-text.pl b/Master/tlpkg/installer/install-menu-text.pl index 87c99474789..f87a0924fb1 100755 --- a/Master/tlpkg/installer/install-menu-text.pl +++ b/Master/tlpkg/installer/install-menu-text.pl @@ -2,7 +2,8 @@ # $Id$ # install-menu-txt.pl # -# Copyright 2007, 2008 Reinhard Kotucha, Norbert Preining +# Copyright 2007, 2008 Reinhard Kotucha +# Copyright 2007, 2008, 2009 Norbert Preining # This file is licensed under the GNU General Public License version 2 # or any later version. # @@ -12,6 +13,7 @@ use vars qw(@::end_install_hook $::opt_no_cls); our %vars; our $tlpdb; +our $previoustlpdb; our @collections_std; our @collections_lang; our @collections_lang_doc; @@ -109,6 +111,25 @@ sub prompt { # The menu loop. A menu is a function. Its return value is a # reference to another menu or to itself. sub run_menu_text { + my (@args) = @_; + # the text mode installer does not take interest in any argument + # but the -old-installation-found + while (@args) { + my $f = shift @args; + if ($f eq "-old-installation-found") { + print "\nAn old installation of TeX Live has been found in ", + $previoustlpdb->root, "\n"; + print " +If you want the selection of collections and various options being taken +over press `y', otherwise anything else. + +Import settings from previous TeX Live installation: (y/n): "; + chomp(my $yn = <STDIN>); + if ($yn =~ m/^y$/i) { + import_settings_from_old_tlpdb(); + } + } + } my $menu=\&main_menu; while ($RETURN == $MENU_CONTINUE) { $menu=$menu->(); @@ -197,37 +218,28 @@ sub scheme_menu { menu_head 'Select a scheme:'; - foreach my $pkg ($tlpdb->list_packages) { - my $tlpobj = $tlpdb->{'tlps'}{$pkg}; - if ($tlpobj->category eq "Scheme") { - push @schemes, $pkg; - $vars{"$pkg"}=($vars{'selected_scheme'} eq $pkg)? 1:0; - } + foreach my $pkg ($tlpdb->schemes) { + push @schemes, $pkg; + $vars{"$pkg"}=($vars{'selected_scheme'} eq $pkg)? 1:0; } @schemes=sort @schemes; + push @schemes, "scheme-custom"; foreach my $scheme (@schemes) { $keyval{$keys[$index]}="$scheme"; - my $tlpobj = $tlpdb->get_package("$scheme"); - printf " %s %s %s\n", $keys[$index], button($vars{"$scheme"}), - $tlpobj->shortdesc; + if ($scheme ne "scheme-custom") { + my $tlpobj = $tlpdb->get_package("$scheme"); + printf " %s %s %s\n", $keys[$index], button($vars{"$scheme"}), + $tlpobj->shortdesc; + } else { + printf " %s %s custom selection of collections\n", + $keys[$index], button($vars{'selected_scheme'} eq "scheme-custom"); + } ++$index; } - foreach my $entry (keys %vars) { - if ($entry=~/^(collection-.*)/) { - $vars{"$1"}=0; - } - } + select_scheme($vars{'selected_scheme'}); - my $scheme_tlpobj = $tlpdb->get_package($vars{'selected_scheme'}); - if (defined ($scheme_tlpobj)) { - foreach my $dependent ($scheme_tlpobj->depends) { - if ($dependent=~/^(collection-.*)/) { - $vars{"$1"}=1; - } - } - } if ($vars{"binary_win32"}) { $vars{"collection-wintools"} = 1; } else { @@ -239,6 +251,7 @@ sub scheme_menu { if (defined $keyval{"$answer"}) { $vars{'selected_scheme'}=$keyval{"$answer"}; + select_scheme($vars{'selected_scheme'}); return $command{'self'}->(); } if (defined $command{"\u$answer"}) { @@ -368,13 +381,13 @@ sub language_menu { my $tlpobj = $tlpdb->get_package("$language"); $keyval{$lang_keys[$index]}="$language"; printf " %s %s %-33s", $lang_keys[$index], button($vars{"$language"}), - substr($tlpobj->shortdesc,0,33); + substr($tlpobj->shortdesc,0,33); if (defined $languages[$index+$lines]) { my $language=$languages[$index+$lines]; my $tlpobj = $tlpdb->get_package("$language"); $keyval{$lang_keys[$index+$lines]}="$language"; printf " %s %s %-32s\n", $lang_keys[$index+$lines], - button($vars{"$language"}), substr($tlpobj->shortdesc,0,32); + button($vars{"$language"}), substr($tlpobj->shortdesc,0,32); } else { print "\n"; } @@ -389,13 +402,13 @@ sub language_menu { my $tlpobj = $tlpdb->get_package("$lang_doc"); $keyval{$lang_doc_keys[$index]}="$lang_doc"; printf " %s %s %-33s", $lang_doc_keys[$index], button($vars{"$lang_doc"}), - substr($tlpobj->shortdesc,0,33); + substr($tlpobj->shortdesc,0,33); if (defined $lang_docs[$index+$lines]) { my $lang_doc=$lang_docs[$index+$lines]; my $tlpobj = $tlpdb->get_package("$lang_doc"); $keyval{$lang_doc_keys[$index+$lines]}="$lang_doc"; printf " %s %s %-32s\n", $lang_doc_keys[$index+$lines], - button($vars{"$lang_doc"}), substr($tlpobj->shortdesc,0,32); + button($vars{"$lang_doc"}), substr($tlpobj->shortdesc,0,32); } else { print "\n"; } @@ -675,19 +688,22 @@ sub help_menu { sub options_menu { - my $b_symlinks=button($vars{'option_symlinks'}); + my $b_path=button($vars{'option_path'}); my $b_doc=button($vars{'option_doc'}); my $b_src=button($vars{'option_src'}); my $b_fmt=button($vars{'option_fmt'}); my $b_letter=button($vars{'option_letter'}); + my $b_deskint=button($vars{'option_desktop_integration'}); + my $b_fileassocs=button($vars{'option_file_assocs'}); + my $b_admin=button($vars{'option_w32_multi_user'}); my $sys_bin=$vars{'sys_bin'}; my $sys_man=$vars{'sys_man'}; my $sys_info=$vars{'sys_info'}; - my $t_sys_bin=($vars{'option_symlinks'})? $vars{'sys_bin'}:''; - my $t_sys_man=($vars{'option_symlinks'})? $vars{'sys_man'}:''; - my $t_sys_info=($vars{'option_symlinks'})? $vars{'sys_info'}:''; + my $t_sys_bin=($vars{'option_path'})? $vars{'sys_bin'}:''; + my $t_sys_man=($vars{'option_path'})? $vars{'sys_man'}:''; + my $t_sys_info=($vars{'option_path'})? $vars{'sys_info'}:''; my %command=( 'self' => \&options_menu, @@ -700,7 +716,7 @@ sub options_menu { print <<"EOF"; <P> use letter size instead of A4 by default: $b_letter - <F> create all format files: $b_fmt + <F> create format files: $b_fmt EOF ; if ($vars{'doc_splitting_supported'} and !$vars{'from_dvd'}) { @@ -709,14 +725,29 @@ EOF if ($vars{'src_splitting_supported'} and !$vars{'from_dvd'}) { print " <S> install font/macro source tree: $b_src\n"; } - if (unix() && !$vars{'from_dvd'}) { - print <<"EOF"; - <L> create symlinks in standard directories: $b_symlinks + if (!$vars{'from_dvd'}) { + if (unix()) { + print <<"EOF"; + <L> create symlinks in standard directories: $b_path binaries to: $t_sys_bin manpages to: $t_sys_man info to: $t_sys_info EOF ; + } else { + print <<"EOF"; + <L> adjust registry entry for path: $b_path +EOF +; + } + if (win32()) { + print " <M> install menu items, shortcuts, etc: $b_deskint\n"; + print " <N> update file associations: $b_fileassocs\n"; + if (admin()) { + # if we are admin we allow normal user installation, too + print " <U> make installation available to all users: $b_admin\n"; + } + } } other_options qw(R Q diskspace); my $answer = prompt 'Enter command'; @@ -726,8 +757,8 @@ EOF my $home = getenv('HOME'); $home = getenv('USERPROFILE') if (win32()); $home ||= '~'; - toggle 'option_symlinks'; - if ($vars{'option_symlinks'}) { + toggle 'option_path'; + if ($vars{'option_path'}) { print "New value for binary directory [$sys_bin]: "; chomp($answer=<STDIN>); $vars{'sys_bin'} = "$answer" if (length $answer); @@ -751,9 +782,28 @@ EOF } return $command{'self'}; } + } else { + if (("\u$answer" eq 'L') and !$vars{'from_dvd'}) { + my $home = getenv('HOME'); + $home = getenv('USERPROFILE') if (win32()); + $home ||= '~'; + toggle 'option_path'; + return $command{'self'}; + } } + if ("\u$answer" eq 'M') { + toggle 'option_desktop_integration'; + return $command{'self'}; + + } elsif ("\u$answer" eq 'N') { + toggle 'option_file_assocs'; + return $command{'self'}; + + } elsif ("\u$answer" eq 'U') { + toggle 'option_w32_multi_user'; + return $command{'self'}; - if ("\u$answer" eq 'P') { + } elsif ("\u$answer" eq 'P') { toggle 'option_letter'; return $command{'self'}; @@ -802,11 +852,14 @@ sub dvd_hd_toggle { sub main_menu { my $this_platform=platform_desc($vars{'this_platform'}); - my $b_symlinks=button($vars{'option_symlinks'}); + my $b_path=button($vars{'option_path'}); my $b_doc=button($vars{'option_doc'}); my $b_src=button($vars{'option_src'}); my $b_fmt=button($vars{'option_fmt'}); my $b_letter=button($vars{'option_letter'}); + my $b_deskint=button($vars{'option_desktop_integration'}); + my $b_fileassocs=button($vars{'option_file_assocs'}); + my $b_admin=button($vars{'option_w32_multi_user'}); my $warn_nobin; @@ -913,8 +966,15 @@ EOF if ($vars{'src_splitting_supported'}) { print " $b_src install macro/font source tree\n"; } - if (unix()) { - print " $b_symlinks create symlinks in standard directories\n"; + if (win32()) { + print " $b_path adjust search path\n"; + print " $b_deskint add menu items, shortcuts, etc.\n"; + print " $b_fileassocs update file associations\n"; + if (admin()) { + print " $b_admin make installation available to all users\n"; + } + } else { + print " $b_path create symlinks to standard directories\n"; } } |