summaryrefslogtreecommitdiff
path: root/Master/install-tl.pl
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-01-11 14:24:28 +0000
committerNorbert Preining <preining@logic.at>2008-01-11 14:24:28 +0000
commit9c54e8bc4d6f2f8de6f27abf3e68b37bc7e7496f (patch)
tree035285edbacb8963e996b16fbe56ef4d6a2be5f0 /Master/install-tl.pl
parent3b241dfaadf61ffa635153d6a029260b82afac17 (diff)
status bar with updates, select/deselect all buttons, terminal dialog
windows git-svn-id: svn://tug.org/texlive/trunk@6191 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/install-tl.pl')
-rwxr-xr-xMaster/install-tl.pl49
1 files changed, 38 insertions, 11 deletions
diff --git a/Master/install-tl.pl b/Master/install-tl.pl
index 7c69aed78ab..07c82d3def0 100755
--- a/Master/install-tl.pl
+++ b/Master/install-tl.pl
@@ -179,6 +179,13 @@ if ("$opt_url" ne "") {
our $tlpdb;
my $localtlpdb;
+# $finished == 1 if the menu call already did the installation
+my $finished = 0;
+@::start_install_hook = ();
+@::end_install_hook = ();
+@::start_postinst_hook = ();
+@::start_install_hook = ();
+
my $system_tmpdir=get_system_tmpdir();
tllog($::LOG_NORMAL, "Platform: ", platform, " => \'", platform_desc(platform), "\'\n");
@@ -216,6 +223,7 @@ if ($opt_profile eq "") {
our $MENU_INSTALL = 0;
our $MENU_ABORT = 1;
our $MENU_QUIT = 2;
+ our $MENU_ALREADYDONE = 3;
if ($opt_gui) {
# try to load Tk.pm, but don't die if it doesn't work
eval { require Tk; };
@@ -244,23 +252,25 @@ if ($opt_profile eq "") {
dump_vars("$system_tmpdir/texlive.vars");
exit(2);
}
- if ($ret != $MENU_INSTALL) {
+ if ($ret == $MENU_ALREADYDONE) {
+ tllog($::LOG_DEBUG, "run_menu has already done the work ... cleaning up!\n");
+ $finished = 1;
+ }
+ if (!$finished && ($ret != $MENU_INSTALL)) {
tllog($::LOG_NORMAL, "Unknown return value of run_menu: $ret\n");
exit(3);
}
} else {
read_profile("$opt_profile");
}
-# do the actual installation
-calc_depends();
-prepare_installation();
-do_install_packages();
-if (win32()) {
- do_win_registry_magic();
+
+if (!$finished) {
+ # do the actual installation
+ do_installation();
}
-do_postinst_stuff();
dump_vars("$system_tmpdir/texlive.vars");
+
# if we installed from a profile we don't need to write it out
if (-r "$vars{'TEXDIR'}/$InfraLocation/texlive.profile") {
tllog($::LOG_NORMAL, "Not overwriting already present profile in $vars{'TEXDIR'}/$InfraLocation/texlive.profile\n");
@@ -268,15 +278,12 @@ if (-r "$vars{'TEXDIR'}/$InfraLocation/texlive.profile") {
create_profile("$vars{'TEXDIR'}/$InfraLocation/texlive.profile");
tllog($::LOG_DEBUG, "Profile written to $vars{'TEXDIR'}/$InfraLocation/texlive.profile\n");
}
-
-
# Close log file if present
close($::LOGFILE) if defined($::LOGFILE);
exit(0);
-
###################################################################
#
# FROM HERE ON ONLY SUBROUTINES
@@ -284,6 +291,26 @@ exit(0);
#
###################################################################
+sub do_installation {
+ # do the actual installation
+ foreach my $h (@::start_install_hook) {
+ &$h();
+ }
+ calc_depends();
+ prepare_installation();
+ do_install_packages();
+ if (win32()) {
+ do_win_registry_magic();
+ }
+ foreach my $h (@::start_postinst_hook) {
+ &$h();
+ }
+ do_postinst_stuff();
+ foreach my $h (@::end_install_hook) {
+ &$h();
+ }
+}
+
sub dump_vars {
my $filename=shift;
open VARS, ">$filename";