summaryrefslogtreecommitdiff
path: root/Master/install-tl
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-07-04 14:36:13 +0000
committerNorbert Preining <preining@logic.at>2008-07-04 14:36:13 +0000
commitaa77db9bb6aac1e85d0449c3f6e282c9bea9a8fc (patch)
tree7e71ca1f8ca41656380d85182fe82944846cb5d4 /Master/install-tl
parente7b12a2a60643054e3baff9557f490c23adfd33d (diff)
install-tl: move various stuff to new sub do_cleanup, cleanup temp dir with downloaded .tar.lzma, fix a typo (JK)
git-svn-id: svn://tug.org/texlive/trunk@9239 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/install-tl')
-rwxr-xr-xMaster/install-tl88
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