diff options
Diffstat (limited to 'Master/install-tl')
-rwxr-xr-x | Master/install-tl | 66 |
1 files changed, 57 insertions, 9 deletions
diff --git a/Master/install-tl b/Master/install-tl index cb2b39f7f0f..ad3b51045ac 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -444,9 +444,32 @@ if ($opt_profile eq "") { require("installer/install-menu-text.pl"); } + # before we start the installation we check for the existence of + # a previous installation, and in case we ship inform the UI + { + my $tlmgrwhich = which("tlmgr"); + if ($tlmgrwhich) { + my $dn = dirname($tlmgrwhich); + $dn = abs_path("$dn/../.."); + printf "dn=$dn\n"; + my $tlpdboldpath = "$dn/$TeXLive::TLConfig::InfraLocation/$TeXLive::TLConfig::DatabaseName"; + if (-r $tlpdboldpath) { + # we found an old installation, so read that one in and save + # the list installed collections into an array. + print "tlpdboldpath = $tlpdboldpath\n"; + my $oldtlpdb=TeXLive::TLPDB->new(root => $dn); + if ($oldtlpdb) { + print "found old installation\n"; + my @colls = $oldtlpdb->collections; + push @runargs, "-old-installation-collections", \@colls; + } + } + } + } + my $ret = &{$::run_menu}(@runargs); if ($ret == $MENU_QUIT) { - do_cleanup(); MISSING + do_cleanup(); flushlog(); exit(1); } @@ -492,7 +515,7 @@ exit(0); sub do_installation { if (win32()) { debug("Switching to non-admin mode due to explict user request!\n"); - non_admin() if !$vars{'option_w32_admin'}; + non_admin() if !$vars{'option_w32_multi_user'}; } # do the actual installation my $h; @@ -938,12 +961,16 @@ sub calc_depends { # First look for packages in the selected scheme. my $scheme=$tlpdb->get_package($vars{'selected_scheme'}); if (!defined($scheme)) { - die ("Scheme $vars{'selected_scheme'} not defined, vars:\n"); - dump_vars(\*STDOUT); - } - - for my $scheme_content ($scheme->depends) { - $install{"$scheme_content"}=1 unless ($scheme_content=~/^collection-/); + if ($vars{'selected_scheme'}) { + # something is written in the selected scheme but not defined, that + # is strange, so warn and die + die ("Scheme $vars{'selected_scheme'} not defined, vars:\n"); + dump_vars(\*STDOUT); + } + } else { + for my $scheme_content ($scheme->depends) { + $install{"$scheme_content"}=1 unless ($scheme_content=~/^collection-/); + } } # Now look for collections in the %vars hash. These are not @@ -1058,7 +1085,7 @@ sub load_tlpdb { $vars{'option_sysint'} = 1 if win32(); $vars{'option_path'} = $tlpdb->option_path; $vars{'option_path'} = 1 if win32(); - $vars{'option_w32_admin'} = $tlpdb->option_w32_admin; + $vars{'option_w32_multi_user'} = $tlpdb->option_w32_multi_user; $vars{'sys_bin'} = $tlpdb->option_sys_bin; $vars{'sys_man'} = $tlpdb->option_sys_man; $vars{'sys_info'} = $tlpdb->option_sys_info; @@ -1278,6 +1305,27 @@ sub save_options_into_tlpdb { $localtlpdb->save() unless $vars{'from_dvd'}; } +# +# select a group of collection, maybe from an old isntallation +# +sub select_collections_from_list { + $vars{'selected_scheme'} = ""; + $vars{'n_collections_selected'}=0; + # remove the selection of all collections + foreach my $entry (keys %vars) { + if ($entry=~/^(collection-.*)/) { + $vars{"$1"}=0; + } + } + for my $c (@_) { + my $tlpobj = $tlpdb->get_package($c); + if ($tlpobj) { + $vars{$c} = 1; + ++$vars{'n_collections_selected'}; + } + } +} + # do everything to select a scheme # sub select_scheme { |