From 9d5bc14f41bbd9219da5d024b1d6a164b51c8525 Mon Sep 17 00:00:00 2001 From: Siep Kroonenberg Date: Sun, 24 Apr 2011 15:44:14 +0000 Subject: Proposed updates TLWinGoo and install-tl now in place; old tlperl removed git-svn-id: svn://tug.org/texlive/trunk@22184 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/installer/install-menu-text.pl | 194 +++++++++++++++------------- 1 file changed, 102 insertions(+), 92 deletions(-) (limited to 'Master/tlpkg/installer/install-menu-text.pl') diff --git a/Master/tlpkg/installer/install-menu-text.pl b/Master/tlpkg/installer/install-menu-text.pl index 9807d0f6976..57325029979 100755 --- a/Master/tlpkg/installer/install-menu-text.pl +++ b/Master/tlpkg/installer/install-menu-text.pl @@ -73,11 +73,8 @@ sub other_options { 'Q' => 'quit' ); - if ($vars{'from_dvd'}) { - $opts{'I'}='start installation for running from DVD'; - } else { - $opts{'I'}='start installation to hard disk'; - } + $opts{'I'}=$vars{'portable'} ? 'start portable installation' : + 'start installation to hard disk'; print "\nActions:"; if ($options[$#options] eq 'diskspace') { @@ -86,7 +83,7 @@ sub other_options { print " (disk space required: $vars{'total_size'} MB)"; } print "\n"; - + for my $option (@options) { if (defined $opts{"$option"}) { printf " <%s> %s\n", $option, $opts{$option}; @@ -109,7 +106,7 @@ sub prompt { # reference to another menu or to itself. sub run_menu_text { my (@args) = @_; - # the text mode installer does not take interest in any argument + # the text mode installer does not take interest in any argument # but the -old-installation-found while (@args) { my $f = shift @args; @@ -229,7 +226,7 @@ sub scheme_menu { printf " %s %s %s\n", $keys[$index], button($vars{"$scheme"}), $tlpobj->shortdesc; } else { - printf " %s %s custom selection of collections\n", + printf " %s %s custom selection of collections\n", $keys[$index], button($vars{'selected_scheme'} eq "scheme-custom"); } ++$index; @@ -459,27 +456,28 @@ sub directories_menu 'Q' => \&quit ); - my $maindir = $vars{'from_dvd'} ? 'TEXDIRW' : 'TEXDIR'; - menu_head "Directories setup:"; - if (!TeXLive::TLUtils::texdir_check($vars{$maindir})) { + if (!TeXLive::TLUtils::texdir_check($vars{'TEXDIR'})) { print "!! The default location as given below can't be written to. !! Either change the destination directory using <1> or create it !! outside this script. "; } - if ($vars{'from_dvd'}) { - print <<"EOF"; - <1> TEXDIRW: $vars{'TEXDIRW'} - (root for configuration- and generated data) + my $texmfdir = $vars{'TEXDIR'} . + ($vars{'TEXDIR'} =~ /\/$/ ? 'texmf' : '/texmf'); + if (!$vars{'in_place'}) { + print <<"EOF"; + <1> TEXDIR: $vars{'TEXDIR'} + support tree: $texmfdir EOF } else { print <<"EOF"; - <1> TEXDIR: $vars{'TEXDIR'} - support tree: $vars{'TEXDIR'}/texmf + TEXDIR: $vars{'TEXDIR'} + support tree: $texmfdir EOF } - print <<"EOF"; + if (!$vars{'portable'}) { + print <<"EOF"; <2> TEXMFLOCAL: $vars{'TEXMFLOCAL'} <3> TEXMFSYSVAR: $vars{'TEXMFSYSVAR'} @@ -491,62 +489,66 @@ EOF EOF - if (win32) { - print " Note: ~ will expand to %USERPROFILE%\n"; - } else { - print " Note: ~ will expand to \$HOME (or to %USERPROFILE% on Windows)\n"; + if (win32) { + print " Note: ~ will expand to %USERPROFILE%\n"; + } else { + print " Note: ~ will expand to \$HOME (or to %USERPROFILE% on Windows)\n"; + } } other_options qw(R Q); my $answer = prompt 'Enter command'; - if ("\u$answer" eq '1') { - print "New value for $maindir [$vars{$maindir}]: "; + if ("\u$answer" eq '1' and !$vars{'in_place'}) { + print "New value for TEXDIR [$vars{'TEXDIR'}]: "; $answer = &input_dirname (); - $vars{$maindir} = $answer if $answer ne ""; - if ($vars{$maindir}=~/^(.*)\/$texlive_release$/) { - $vars{'TEXMFLOCAL'}="$1/texmf-local"; - $vars{'TEXMFSYSVAR'}="$1/$texlive_release/texmf-var"; - $vars{'TEXMFSYSCONFIG'}="$1/$texlive_release/texmf-config"; - } elsif ($vars{$maindir}=~/^(.*)$/) { - $vars{'TEXMFLOCAL'}="$1/texmf-local"; - $vars{'TEXMFSYSVAR'}="$1/texmf-var"; - $vars{'TEXMFSYSCONFIG'}="$1/texmf-config"; + $vars{'TEXDIR'} = $answer if $answer ne ""; + my $texdirnoslash; + if ($vars{'TEXDIR'}=~/^(.*)\/$texlive_release$/) { + $texdirnoslash = $1; + $vars{'TEXMFLOCAL'}="$texdirnoslash/texmf-local"; + $vars{'TEXMFSYSVAR'}="$texdirnoslash/$texlive_release/texmf-var"; + $vars{'TEXMFSYSCONFIG'}="$texdirnoslash/$texlive_release/texmf-config"; + } elsif ($vars{'TEXDIR'}=~/^(.*)$/) { + $texdirnoslash = $1; + $texdirnoslash =~ s!/$!!; + $vars{'TEXMFLOCAL'}="$texdirnoslash/texmf-local"; + $vars{'TEXMFSYSVAR'}="$texdirnoslash/texmf-var"; + $vars{'TEXMFSYSCONFIG'}="$texdirnoslash/texmf-config"; } - $vars{'TEXDIRW'} = $vars{'TEXDIR'} unless $vars{'from_dvd'}; return $command{'self'}; - } elsif ("\u$answer" eq '2') { + } elsif ("\u$answer" eq '2' and !$vars{'portable'}) { print "New value for TEXMFLOCAL [$vars{'TEXMFLOCAL'}]: "; $answer = &input_dirname (); $vars{'TEXMFLOCAL'} = $answer if $answer ne ""; return $command{'self'}; - } elsif ("\u$answer" eq '3') { + } elsif ("\u$answer" eq '3' and !$vars{'portable'}) { print "New value for TEXMFSYSVAR [$vars{'TEXMFSYSVAR'}]: "; $answer = &input_dirname (); $vars{'TEXMFSYSVAR'} = $answer if $answer ne ""; return $command{'self'}; - } elsif ("\u$answer" eq '4') { + } elsif ("\u$answer" eq '4' and !$vars{'portable'}) { print "New value for TEXMFSYSCONFIG [$vars{'TEXMFSYSCONFIG'}]: "; $answer = &input_dirname (); $vars{'TEXMFSYSCONFIG'} = $answer if $answer ne ""; return $command{'self'}; - } elsif ("\u$answer" eq '5') { + } elsif ("\u$answer" eq '5' and !$vars{'portable'}) { print "New value for TEXMFVAR [$vars{'TEXMFVAR'}]: "; $answer = &input_dirname ("noexpansion"); $vars{'TEXMFVAR'} = $answer if $answer ne ""; return $command{'self'}; - } elsif ("\u$answer" eq '6') { + } elsif ("\u$answer" eq '6' and !$vars{'portable'}) { print "New value for TEXMFCONFIG [$vars{'TEXMFCONFIG'}]: "; $answer = &input_dirname ("noexpansion"); $vars{'TEXMFCONFIG'} = $answer if $answer ne ""; return $command{'self'}; - } elsif ("\u$answer" eq '7') { + } elsif ("\u$answer" eq '7' and !$vars{'portable'}) { print "New value for TEXMFHOME [$vars{'TEXMFHOME'}]: "; $answer = &input_dirname ("noexpansion"); $vars{'TEXMFHOME'} = $answer if $answer ne ""; @@ -564,13 +566,13 @@ EOF # Helper function to read a directory name and clean it up. # Unless NO_EXPANSION is true, convert to absolute path. -# +# sub input_dirname { my $noexpansion = shift; chomp (my $answer = ); return "" if $answer eq ""; - + $answer =~ s!\\!/!g if win32(); # switch to forward slashes if (!$noexpansion) { @@ -579,7 +581,7 @@ sub input_dirname $home ||= '~'; $answer =~ s/^~/$home/; # $home expansion } - + if ($answer !~ m/^~/) { # relative paths are unlikely to work in texmf.cnf, et al., # and don't have any apparent practical use. Convert to absolute. @@ -744,13 +746,13 @@ sub options_menu { create format files: $b_fmt EOF ; - if ($vars{'doc_splitting_supported'} and !$vars{'from_dvd'}) { + if ($vars{'doc_splitting_supported'} and !$vars{'in_place'}) { print " install font/macro doc tree: $b_doc\n"; } - if ($vars{'src_splitting_supported'} and !$vars{'from_dvd'}) { + if ($vars{'src_splitting_supported'} and !$vars{'in_place'}) { print " install font/macro source tree: $b_src\n"; } - if (!$vars{'from_dvd'}) { + if (!$vars{'portable'}) { if (unix() || $::opt_all_options) { print <<"EOF"; create symlinks in standard directories: $b_path @@ -772,14 +774,18 @@ EOF # if we are admin we allow normal user installation, too print " make installation available to all users: $b_admin\n"; } - print " install TeXworks front end: $b_addoneditor\n"; } } + if (win32() || $::opt_all_options) { + print " install TeXworks front end: $b_addoneditor\n"; + } other_options qw(R Q diskspace); my $answer = prompt 'Enter command'; + # option_path + if (unix()) { - if (("\u$answer" eq 'L') and !$vars{'from_dvd'}) { + if (("\u$answer" eq 'L') and !$vars{'portable'}) { my $home = getenv('HOME'); $home = getenv('USERPROFILE') if (win32()); $home ||= '~'; @@ -809,7 +815,7 @@ EOF return $command{'self'}; } } else { - if (("\u$answer" eq 'L') and !$vars{'from_dvd'}) { + if (("\u$answer" eq 'L') and !$vars{'portable'}) { my $home = getenv('HOME'); $home = getenv('USERPROFILE') if (win32()); $home ||= '~'; @@ -817,12 +823,15 @@ EOF return $command{'self'}; } } + + # option_desktop_integration, option_file_assocs + if (win32() || $::opt_all_options) { - if ("\u$answer" eq 'M') { + if ("\u$answer" eq 'M' and !$vars{'portable'}) { toggle 'option_desktop_integration'; return $command{'self'}; - } elsif ("\u$answer" eq 'N') { + } elsif ("\u$answer" eq 'N' and !$vars{'portable'}) { print "New value for file_assocs:\n"; print " 0 -- don't tweak the file associations\n"; print " 1 -- only add new file associations, don't overwrite old ones\n"; @@ -834,12 +843,14 @@ EOF } return $command{'self'}; - } elsif ("\u$answer" eq 'U') { + } elsif ("\u$answer" eq 'U' and !$vars{'portable'}) { toggle 'option_w32_multi_user'; return $command{'self'}; } } + # other options + if ("\u$answer" eq 'P') { toggle 'option_letter'; return $command{'self'}; @@ -852,23 +863,24 @@ EOF toggle 'option_write18_restricted'; return $command{'self'}; - } elsif ("\u$answer" eq 'S' and !$vars{'from_dvd'}) { + } elsif ("\u$answer" eq 'S' and !$vars{'in_place'}) { toggle 'option_src'; return $command{'self'}; - } elsif ("\u$answer" eq 'D' and !$vars{'from_dvd'}) { + } elsif ("\u$answer" eq 'D' and !$vars{'in_place'}) { toggle 'option_doc'; return $command{'self'}; } elsif (defined $command{"\u$answer"}) { return $command{"\u$answer"}; - } elsif (("\u$answer" eq 'W') && ($::opt_all_options || win32())) { + } elsif (("\u$answer" eq 'W') && ($::opt_all_options || win32()) && + !$vars{'in_place'} ) { toggle 'collection-texworks'; return $command{'self'}; } else { - print "Unknown command: $answer\n\n"; + print "Unknown or unsupported command: $answer\n\n"; return $command{'self'}; } } @@ -883,15 +895,21 @@ sub do_install { $RETURN = $MENU_INSTALL; } -sub dvd_hd_toggle { - return if !member('local_uncompressed', @media_available); - if ($vars{'from_dvd'}) { # set up for hd install: - $vars{'from_dvd'} = 0; - $vars{'TEXDIR'} = $vars{'TEXDIRW'}; - } else { # set up for dvd install: - $vars{'from_dvd'} = 1; - $vars{'TEXDIR'} = abs_path($::installerdir); +sub toggle_portable { + if ($vars{'portable'}) { + $vars{'portable'} = 0; + $vars{'option_desktop_integration'} = 0; + $vars{'option_path'} = 0; + $vars{'option_file_assocs'} = 0; + $vars{'option_w32_multi_user'} = 0; + } else { + $vars{'portable'} = 1; + $vars{'option_desktop_integration'} = 1; + $vars{'option_path'} = 1; + $vars{'option_file_assocs'} = 1; + $vars{'option_w32_multi_user'} = 1; } + set_texlive_default_dirs(); # this sub tests for portable and in_place main_menu; } @@ -912,8 +930,6 @@ sub main_menu { $warn_nobin=set_install_platform; - my $maindir = $vars{'from_dvd'} ? 'TEXDIRW' : 'TEXDIR'; - $vars{'n_systems_selected'}=0; $vars{'n_collections_selected'}=0; foreach my $key (keys %vars) { @@ -933,9 +949,9 @@ sub main_menu { 'I' => \&do_install, 'O' => \&options_menu, 'Q' => \&quit, - 'V' => \&dvd_hd_toggle, + 'V' => \&toggle_portable, ); - if (!$vars{'from_dvd'}) { + if (!$vars{'in_place'}) { $command{'B'} = \&binary_menu if unix(); $command{'C'} = \&collection_menu; $command{'L'} = \&language_menu; @@ -949,12 +965,12 @@ sub main_menu { =======> Note: Letters/digits in indicate menu items <======= =======> for commands or configurable options <======= + Detected platform: $this_platform + $warn_nobin EOF - if (!$vars{'from_dvd'}) { + if (!$vars{'in_place'}) { print <<"EOF"; - Detected platform: $this_platform - $warn_nobin platforms: $vars{'n_systems_selected'} out of $vars{'n_systems_available'} installation scheme ($vars{'selected_scheme'}) @@ -969,23 +985,17 @@ EOF print " !! No language specific collection selected!\n"; print " !! If you only write American English documents that is fine!\n"; } - + } print <<"EOF"; directories: TEXDIR (the main TeX directory): EOF - } else { # $vars{'from_dvd'} - print <<"EOF"; - directories: - TEXDIRW (Writable root): -EOF - } - if (TeXLive::TLUtils::texdir_check($vars{$maindir})) { - print " $vars{$maindir}\n"; + if (TeXLive::TLUtils::texdir_check($vars{'TEXDIR'})) { + print " $vars{'TEXDIR'}\n"; } else { - print " !! default location: $vars{$maindir}\n"; + print " !! default location: $vars{'TEXDIR'}\n"; print " !! is not writable, please select a different one!\n"; } print <<"EOF"; @@ -1011,32 +1021,32 @@ print <<"EOF"; $b_fmt create all format files EOF - if (!$vars{'from_dvd'}) { + if (!$vars{'in_place'}) { if ($vars{'doc_splitting_supported'}) { print " $b_doc install macro/font doc tree\n"; } if ($vars{'src_splitting_supported'}) { print " $b_src install macro/font source tree\n"; } - if (win32()) { + } + if (win32()) { + if (!$vars{'portable'}) { print " $b_path adjust search path\n"; print " $b_deskint add menu items, shortcuts, etc.\n"; print " [$vars{'option_file_assocs'}] update file associations\n"; if (admin()) { print " $b_admin make installation available to all users\n"; } - print" $b_addoneditor install TeXworks front end\n"; - } else { - print " $b_path create symlinks to standard directories\n"; } + print " $b_addoneditor install TeXworks front end\n"; + print " $b_path create symlinks to standard directories\n" unless + ($vars{'portable'} || win32()); } - if (member('local_uncompressed', @media_available)) { - if ($vars{'from_dvd'}) { - print "\n set up for installing to hard disk\n"; - } else { - print "\n set up for running from DVD\n"; - } + if ($vars{'portable'}) { + print "\n set up for regular installation to hard disk\n"; + } else { + print "\n set up for portable installation\n"; } other_options qw(I H Q); -- cgit v1.2.3