diff options
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/install-tl | 88 |
1 files changed, 50 insertions, 38 deletions
diff --git a/Master/install-tl b/Master/install-tl index a0c215e2c6a..af309276759 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -46,7 +46,7 @@ use Getopt::Long qw(:config no_autoabbrev); use TeXLive::TLUtils qw(initialize_installer media platform platform_desc which getenv win32 unix program_exists info log debug tlwarn ddebug - get_system_tmpdir member process_logging_options + get_system_tmpdir member process_logging_options rmtree mkdirhier make_var_skeleton make_local_skeleton install_package copy install_packages dirname setup_programs welcome welcome_paths); use TeXLive::TLPOBJ; @@ -381,7 +381,7 @@ if ($opt_profile eq "") { } my $ret = run_menu(); if ($ret == $MENU_QUIT) { - # do_cleanup(); MISSING + do_cleanup(); MISSING flushlog(); exit(1); } @@ -411,42 +411,7 @@ if (!$finished) { do_installation(); } -# now open the log file and write out the log lines -# try to open a log file -if (open(LOGF,">$vars{'TEXDIRW'}/install-tl.log")) { - $::LOGFILE = \*LOGF; - foreach my $line(@::LOGLINES) { - print $::LOGFILE "$line"; - } -} else { - warn("Cannot create log file $vars{'TEXDIRW'}/install-tl.log: $!\nNot writing out log lines!\n"); -} - -# dump various things to the log file -if (defined($::LOGFILE)) { - print $::LOGFILE "\nDump of vars:\n"; - foreach my $key (keys %vars) { - print $::LOGFILE "$key $vars{$key}\n"; - } - create_profile($::LOGFILE); -} - -dump_vars("$system_tmpdir/texlive.vars"); - -# write the profile out -if ($vars{'from_dvd'}) { - create_profile("$vars{'TEXDIRW'}/texlive.profile"); - debug("Profile written to $vars{'TEXDIRW'}/texlive.profile\n"); -} else { - create_profile("$vars{'TEXDIR'}/$InfraLocation/texlive.profile"); - debug("Profile written to $vars{'TEXDIR'}/$InfraLocation/texlive.profile\n"); -} -# Close log file if present -close($::LOGFILE) if defined($::LOGFILE); - -#print "Don't forget to set TEXMFSYSVAR to ".$vars{'TEXMFSYSVAR'}."!!!\n" -print "Don't forget to set TEXMFCNF to\n ". $vars{'TEXMFSYSVAR'}."/web2c !!!\n" - if ($vars{'from_dvd'} and !win32()); +do_cleanup(); exit(0); @@ -1213,6 +1178,53 @@ sub check_on_lang_collection_installed { return 0; } +sub do_cleanup +{ + # now open the log file and write out the log lines + # try to open a log file + if (open(LOGF,">$vars{'TEXDIRW'}/install-tl.log")) { + $::LOGFILE = \*LOGF; + foreach my $line(@::LOGLINES) { + print $::LOGFILE "$line"; + } + } else { + warn("Cannot create log file $vars{'TEXDIRW'}/install-tl.log: $!\nNot writing out log lines!\n"); + } + + # remove temporary files from TEXDIR/temp + if ((media() eq "CD") or (media() eq "NET")) { + debug("Remove temporary downloaded containers!\n"); + rmtree("$vars{'TEXDIRW'}/temp") if (-d "$vars{'TEXDIRW'}/temp"); + } + + # dump various things to the log file + if (defined($::LOGFILE)) { + print $::LOGFILE "\nDump of vars:\n"; + foreach my $key (keys %vars) { + print $::LOGFILE "$key $vars{$key}\n"; + } + create_profile($::LOGFILE); + } + + # should not be needed any more + #dump_vars("$system_tmpdir/texlive.vars"); + + # write the profile out + if ($vars{'from_dvd'}) { + create_profile("$vars{'TEXDIRW'}/texlive.profile"); + debug("Profile written to $vars{'TEXDIRW'}/texlive.profile\n"); + } else { + create_profile("$vars{'TEXDIR'}/$InfraLocation/texlive.profile"); + debug("Profile written to $vars{'TEXDIR'}/$InfraLocation/texlive.profile\n"); + } + # Close log file if present + close($::LOGFILE) if defined($::LOGFILE); + + #print "Don't forget to set TEXMFSYSVAR to ".$vars{'TEXMFSYSVAR'}."!!!\n" + print "Don't forget to set TEXMFCNF to\n ". $vars{'TEXMFSYSVAR'}."/web2c !!!\n" + if ($vars{'from_dvd'} and !win32()); +} + __END__ =head1 NAME |