summaryrefslogtreecommitdiff
path: root/Master/install-tl
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-11-10 18:28:22 +0000
committerKarl Berry <karl@freefriends.org>2008-11-10 18:28:22 +0000
commit4f5a64111aac6352005b501bfcb7d58a7bbfcc62 (patch)
treebf8e25bd9f9a743e4d33042c63e059d0af27fc71 /Master/install-tl
parentda3527b7bcea093a495e0d7c9bf73cc46bf181b5 (diff)
when portable, avoid creating texmf-config before asking; make portable code a separate do_portable subroutine
git-svn-id: svn://tug.org/texlive/trunk@11245 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/install-tl')
-rwxr-xr-xMaster/install-tl115
1 files changed, 65 insertions, 50 deletions
diff --git a/Master/install-tl b/Master/install-tl
index 497e8cd1e39..f845b5331ac 100755
--- a/Master/install-tl
+++ b/Master/install-tl
@@ -281,60 +281,12 @@ my $finished = 0;
my $system_tmpdir=get_system_tmpdir();
my $media;
-# a couple of special uses of install-tl:
-
+# special uses of install-tl:
if ($opt_print_arch) {
print platform()."\n";
exit 0;
} elsif ($opt_portable) {
- $::opt_verbosity = -1;
- $::_platform_ = platform();
- $location = getenv('TEXDIR');
- die "Don't use --portable directly; use tl-portable instead\n"
- unless $location;
- $vars{'TEXDIR'} = $location;
- if (not -d $vars{'TEXDIR'}.'/bin/'.$::_platform_) { # shouldn't happen
- print "Platform ".$::_platform_." not supported\n";
- exit 1;
- }
- # set_platforms_supported();
- # set_texlive_default_dirs();
- $vars{'TEXDIRW'} = getenv('TEXDIRW');
- $vars{'TEXMFSYSVAR'} = getenv('TEXMFSYSVAR');
- $vars{'TEXMFSYSCONFIG'} = getenv('TEXMFSYSCONFIG');
- $vars{'TEXMFLOCAL'} = getenv('TEXMFLOCAL');
- $vars{'TEXMFHOME'} = getenv('TEXMFHOME');
- $vars{'TEXMFVAR'} = getenv('TEXMFVAR');
- $vars{'TEXMFCONFIG'} = getenv('TEXMFCONFIG');
- # initialize_collections();
- # set_install_platform();
- $vars{'this_platform'} = platform();
- # do_installation();
- # prepare_installation();
- if (win32()) {
- non_admin();
- my $winpath = "$vars{'TEXDIR'}/bin/win32";
- # register_script_type(".texlua", "%TEXBINDIR%/texlua.exe");
- # update_assocs();
- }
- mkdirhier "$vars{'TEXMFCONFIG'}";
- mkdirhier "$vars{'TEXMFSYSCONFIG'}";
- if (not -d "$vars{'TEXMFSYSVAR'}" ) {
- print "About to generate some files... Press <enter>";
- <STDIN>;
- load_tlpdb();
- $localtlpdb = $tlpdb;
- $texlive_release = $tlpdb->config_release;
- make_var_skeleton "$vars{'TEXMFSYSVAR'}";
- #$localtlpdb=new TeXLive::TLPDB;
- #$localtlpdb->root("$vars{'TEXDIR'}");
- # the usual argument for pregenerating all formats doesn't apply
- $vars{'option_fmt'} = 0;
- do_postinst_stuff();
- }
- close($::LOGFILE) if defined($::LOGFILE);
- print TeXLive::TLUtils::welcome;
- exit 0;
+ &do_portable ();
}
@@ -1457,6 +1409,69 @@ sub do_cleanup
}
}
+
+# portable option, invoked from tl-portable script.
+#
+sub do_portable {
+ $::opt_verbosity = -1;
+ $::_platform_ = platform();
+ $location = getenv('TEXDIR');
+ die "$0: Don't use --portable directly; use tl-portable instead\n"
+ unless $location;
+ $vars{'TEXDIR'} = $location;
+ if (not -d $vars{'TEXDIR'}.'/bin/'.$::_platform_) { # shouldn't happen
+ die "$0: Platform ".$::_platform_." not supported.";
+ }
+ # set_platforms_supported();
+ # set_texlive_default_dirs();
+ $vars{'TEXDIRW'} = getenv('TEXDIRW');
+ $vars{'TEXMFSYSVAR'} = getenv('TEXMFSYSVAR');
+ $vars{'TEXMFSYSCONFIG'} = getenv('TEXMFSYSCONFIG');
+ $vars{'TEXMFLOCAL'} = getenv('TEXMFLOCAL');
+ $vars{'TEXMFHOME'} = getenv('TEXMFHOME');
+ $vars{'TEXMFVAR'} = getenv('TEXMFVAR');
+ $vars{'TEXMFCONFIG'} = getenv('TEXMFCONFIG');
+ if (win32()) {
+ non_admin();
+ my $winpath = "$vars{'TEXDIR'}/bin/win32";
+ }
+
+ our $PORTABLE_PROMPT_DONE = 0; # used in subroutine below
+ if (! -d "$vars{'TEXMFCONFIG'}" ) {
+ portable_prompt ();
+ mkdirhier "$vars{'TEXMFCONFIG'}";
+ }
+ if (! -d "$vars{'TEXMFSYSCONFIG'}" ) {
+ portable_prompt ();
+ mkdirhier "$vars{'TEXMFSYSCONFIG'}";
+ }
+ if (! -d "$vars{'TEXMFSYSVAR'}" ) {
+ portable_prompt ();
+ load_tlpdb();
+ $localtlpdb = $tlpdb;
+ $texlive_release = $tlpdb->config_release;
+ make_var_skeleton "$vars{'TEXMFSYSVAR'}";
+ # the usual option for pregenerating all formats doesn't apply
+ $vars{'option_fmt'} = 0;
+ do_postinst_stuff();
+ }
+
+ close($::LOGFILE) if defined($::LOGFILE);
+ print TeXLive::TLUtils::welcome;
+ exit 0;
+
+
+ # Give the user a chance to bail before changing anything.
+ # (Nested subroutine.)
+ sub portable_prompt
+ {
+ return if $PORTABLE_PROMPT_DONE;
+ $PORTABLE_PROMPT_DONE = 1;
+ print "About to generate some files, press Enter to continue:";
+ <STDIN>;
+ }
+}
+
__END__
=head1 NAME