diff options
author | Norbert Preining <preining@logic.at> | 2011-04-27 22:45:29 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2011-04-27 22:45:29 +0000 |
commit | 65c27d338ee4c4e2a62ec75d486723cf33f3c7eb (patch) | |
tree | bbe02bfad30ca1769ceb928f670967493f117d0e /Master/texmf | |
parent | b82296f4b89901e7b41f2ea8da56222f72a19aa3 (diff) |
merge TLMedia functionality into TLPDB and get rid of TLMedia
git-svn-id: svn://tug.org/texlive/trunk@22226 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf')
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr.pl | 218 | ||||
-rw-r--r-- | Master/texmf/scripts/texlive/tlmgrgui.pl | 32 |
2 files changed, 117 insertions, 133 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 7fed579640c..9b8089c84f3 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -77,7 +77,6 @@ use Getopt::Long qw(:config no_autoabbrev permute); use strict; use TeXLive::TLConfig; -use TeXLive::TLMedia; use TeXLive::TLPDB; use TeXLive::TLPOBJ; use TeXLive::TLUtils; @@ -92,10 +91,8 @@ binmode(STDOUT, ":utf8"); binmode(STDERR, ":utf8"); our %config; # hash of config settings from config file -our $tlmediasrc; # media from which we install/update -our $tlmediatlpdb; +our $remotetlpdb; our $location; # location from which the new packages come -our $localtlmedia; # local installation which we are munging our $localtlpdb; # local installation which we are munging # flags for machine-readable form @@ -412,7 +409,6 @@ sub give_version { $::version_string .= "\nTLUtils: " . TeXLive::TLUtils->module_revision(); $::version_string .= "\nTLPOBJ: " . TeXLive::TLPOBJ->module_revision(); $::version_string .= "\nTLPDB: " . TeXLive::TLPDB->module_revision(); - $::version_string .= "\nTLMedia: " . TeXLive::TLMedia->module_revision(); $::version_string .= "\nTLPaper: " . TeXLive::TLPaper->module_revision(); $::version_string .= "\nTLWinGoo: " . TeXLive::TLWinGoo->module_revision(); $::version_string .= "\n"; @@ -830,7 +826,7 @@ sub action_remove { my $foo = 0; info ("remove $pkg\n"); if (!$opts{"dry-run"}) { - $foo = $localtlmedia->remove_package($pkg); + $foo = $localtlpdb->remove_package($pkg); logpackage("remove: $pkg"); } if ($foo) { @@ -851,7 +847,7 @@ sub action_remove { if (!defined($already_removed{$pkg})) { info ("remove $pkg\n"); if (!$opts{"dry-run"}) { - if ($localtlmedia->remove_package($pkg)) { + if ($localtlpdb->remove_package($pkg)) { # removal was successful logpackage("remove: $pkg"); $already_removed{$pkg} = 1; @@ -942,11 +938,11 @@ sub action_show { my $tlp = $localtlpdb->get_package($pkg); my $installed = 0; if (!$tlp) { - if (!$tlmediatlpdb) { + if (!$remotetlpdb) { init_tlmedia(); } - $tlp = $tlmediatlpdb->get_package($pkg); - $tlpdb = $tlmediatlpdb; + $tlp = $remotetlpdb->get_package($pkg); + $tlpdb = $remotetlpdb; } else { $installed = 1; } @@ -956,10 +952,10 @@ sub action_show { @colls = $localtlpdb->needed_by($pkg); if (!@colls) { # not referenced in the local tlpdb, so try the remote here, too - if (!$tlmediatlpdb) { + if (!$remotetlpdb) { init_tlmedia(); } - @colls = $tlmediatlpdb->needed_by($pkg); + @colls = $remotetlpdb->needed_by($pkg); } } # some packages might depend on other packages, so do not @@ -1101,7 +1097,7 @@ sub action_path { # - if non-admin # --> ignore opt_w32_multi_user and do user path adjustment if (!$opts{"w32mode"}) { - $winadminmode = $localtlmedia->tlpdb->option("w32_multi_user"); + $winadminmode = $localtlpdb->option("w32_multi_user"); if (!TeXLive::TLWinGoo::admin()) { if ($winadminmode) { tlwarn("The TLPDB specifies system wide path adjustments\nbut you don't have admin privileges.\nFor user path adjustment please use\n\t--w32mode user\n"); @@ -1139,29 +1135,29 @@ sub action_path { if ($what =~ m/^add$/i) { if (win32()) { TeXLive::TLUtils::w32_add_to_path( - $localtlmedia->location . "/bin/win32", + $localtlpdb->root . "/bin/win32", $winadminmode); TeXLive::TLWinGoo::broadcast_env(); } else { - TeXLive::TLUtils::add_symlinks($localtlmedia->tlpdb->root, - $localtlmedia->platform(), - $localtlmedia->tlpdb->option("sys_bin"), - $localtlmedia->tlpdb->option("sys_man"), - $localtlmedia->tlpdb->option("sys_info")); + TeXLive::TLUtils::add_symlinks($localtlpdb->root, + $localtlpdb->platform(), + $localtlpdb->option("sys_bin"), + $localtlpdb->option("sys_man"), + $localtlpdb->option("sys_info")); } } elsif ($what =~ m/^remove$/i) { if (win32()) { TeXLive::TLUtils::w32_remove_from_path( - $localtlmedia->location . "/bin/win32", + $localtlpdb->root . "/bin/win32", $winadminmode); TeXLive::TLWinGoo::broadcast_env(); } else { # remove symlinks - TeXLive::TLUtils::remove_symlinks($localtlmedia->tlpdb->root, - $localtlmedia->platform(), - $localtlmedia->tlpdb->option("sys_bin"), - $localtlmedia->tlpdb->option("sys_man"), - $localtlmedia->tlpdb->option("sys_info")); + TeXLive::TLUtils::remove_symlinks($localtlpdb->root, + $localtlpdb->platform(), + $localtlpdb->option("sys_bin"), + $localtlpdb->option("sys_man"), + $localtlpdb->option("sys_info")); } } else { # that should not happen @@ -1251,7 +1247,7 @@ sub action_search { init_local_db(); if ($opts{"global"}) { init_tlmedia(); - $tlpdb = $tlmediasrc->tlpdb; + $tlpdb = $remotetlpdb; } else { $tlpdb = $localtlpdb; } @@ -1409,8 +1405,8 @@ sub restore_one_package { tlwarn("Cannot read $restore_file, no action taken\n"); return; } - $localtlmedia->remove_package($pkg); - TeXLive::TLMedia->_install_package($restore_file , 0, [] ,$localtlpdb); + $localtlpdb->remove_package($pkg); + TeXLive::TLPDB->_install_package($restore_file , 0, [] ,$localtlpdb); logpackage("restore: $pkg ($rev)"); # now we have to read the .tlpobj file and add it to the DB my $tlpobj = TeXLive::TLPOBJ->new; @@ -1713,18 +1709,17 @@ sub write_w32_updater { my ($restart_tlmgr, $ref_files_to_be_removed, @w32_updated) = @_; my @infra_files_to_be_removed = @$ref_files_to_be_removed; # TODO do something with these files TODO - my $media = $tlmediasrc->media; - my $mediatlpdb = $tlmediasrc->tlpdb; + my $media = $remotetlpdb->media; # we have to download/copy also the src/doc files if necessary! - my $container_src_split = $mediatlpdb->config_src_container; - my $container_doc_split = $mediatlpdb->config_doc_container; + my $container_src_split = $remotetlpdb->config_src_container; + my $container_doc_split = $remotetlpdb->config_doc_container; # get options about src/doc splitting from $totlpdb # TT: should we use local options to decide about install of doc & src? my $opt_src = $localtlpdb->option("install_srcfiles"); my $opt_doc = $localtlpdb->option("install_docfiles"); my $root = $localtlpdb->root; my $temp = "$root/temp"; - my $repo = $mediatlpdb->root . "/$Archive"; + my $repo = $remotetlpdb->root . "/$Archive"; TeXLive::TLUtils::mkdirhier($temp); tlwarn("Backup option not implemented for infrastructure update.\n") if ($opts{"backup"}); if ($media eq 'local_uncompressed') { @@ -1734,7 +1729,7 @@ sub write_w32_updater { } my (@upd_tar, @upd_tlpobj, @upd_info, @rst_tar, @rst_tlpobj, @rst_info); foreach my $pkg (@w32_updated) { - my $mediatlp = $mediatlpdb->get_package($pkg); + my $mediatlp = $remotetlpdb->get_package($pkg); my $localtlp = $localtlpdb->get_package($pkg); my $oldrev = $localtlp->revision; my $newrev = $mediatlp->revision; @@ -1913,15 +1908,15 @@ sub auto_remove_install_force_packages { # my @all_schmscolls = (); for my $p ($localtlpdb->schemes) { - push (@all_schmscolls, $p) if defined($tlmediatlpdb->get_package($p)); + push (@all_schmscolls, $p) if defined($remotetlpdb->get_package($p)); } for my $p ($localtlpdb->collections) { - push (@all_schmscolls, $p) if defined($tlmediatlpdb->get_package($p)); + push (@all_schmscolls, $p) if defined($remotetlpdb->get_package($p)); } my @localexpansion_full = $localtlpdb->expand_dependencies($localtlpdb, @all_schmscolls); my @remoteexpansion_full = - $tlmediatlpdb->expand_dependencies($localtlpdb, @all_schmscolls); + $remotetlpdb->expand_dependencies($localtlpdb, @all_schmscolls); # compute new/remove/forcerm based on the full expansions for my $p (@remoteexpansion_full) { @@ -1942,7 +1937,7 @@ sub auto_remove_install_force_packages { # intersection, don't check A\B and B\A next if $newpkgs_full{$p}; next if $removals_full{$p}; - next if ($tlmediatlpdb->get_package($p)->category ne "Collection"); + next if ($remotetlpdb->get_package($p)->category ne "Collection"); my $tlp = $localtlpdb->get_package($p); if (!defined($tlp)) { if ($opts{"reinstall-forcibly-removed"}) { @@ -1956,7 +1951,7 @@ sub auto_remove_install_force_packages { # forcibly removed. Again, expand those against the remote tlpdb # and remove the expanded packages from the list of localexpansion. my @pkgs_from_forcerm_colls = - $tlmediatlpdb->expand_dependencies($localtlpdb, keys %forcermpkgs_full); + $remotetlpdb->expand_dependencies($localtlpdb, keys %forcermpkgs_full); # # the package in @pkgs_from_forcerm_colls would be auto-installed, so # check for that: @@ -2033,7 +2028,7 @@ sub auto_remove_install_force_packages { # tlmgr update --no-depends-at-all foo # will absolutely only update foo not even taking .ARCH into account # -# TLMedia->install_package INSTALLS ONLY ONE PACKAGE, no deps whatsoever +# TLPDB->install_package INSTALLS ONLY ONE PACKAGE, no deps whatsoever # anymore. That has all to be done by hand. # sub machine_line { @@ -2083,7 +2078,7 @@ sub action_update { # check for updates to tlmgr and die unless either --force or --list or --self # is given - my @critical = check_for_critical_updates($localtlpdb, $tlmediatlpdb); + my @critical = check_for_critical_updates($localtlpdb, $remotetlpdb); my $dry_run_cont = $opts{"dry-run"} && ($opts{"dry-run"} < 0); if ( !$dry_run_cont && !$opts{"self"} && @critical) { critical_updates_warning(); @@ -2185,11 +2180,11 @@ sub action_update { if (!($opts{"self"} && @critical) || ($opts{"self"} && $opts{"list"})) { # update all .ARCH dependencies, too, unless $opts{"no-depends-at-all"}: - @todo = $tlmediatlpdb->expand_dependencies("-only-arch", $localtlpdb, @todo) + @todo = $remotetlpdb->expand_dependencies("-only-arch", $localtlpdb, @todo) unless $opts{"no-depends-at-all"}; # # update general deps unless $opts{"no-depends"}: - @todo = $tlmediatlpdb->expand_dependencies("-no-collections",$localtlpdb,@todo) + @todo = $remotetlpdb->expand_dependencies("-no-collections",$localtlpdb,@todo) unless $opts{"no-depends"}; # # filter out critical packages @@ -2298,7 +2293,7 @@ sub action_update { next; } # install new packages - my $mediatlp = $tlmediatlpdb->get_package($pkg); + my $mediatlp = $remotetlpdb->get_package($pkg); if (!defined($mediatlp)) { tlwarn("\nShould not happen: $pkg not found in $location"); next; @@ -2308,7 +2303,7 @@ sub action_update { next; } my $rev = $tlp->revision; - my $mediatlp = $tlmediatlpdb->get_package($pkg); + my $mediatlp = $remotetlpdb->get_package($pkg); if (!defined($mediatlp)) { debug("$pkg cannot be found in $location\n"); next; @@ -2360,7 +2355,7 @@ sub action_update { # get something wrong back, namely the total size of all packages my %sizes; if (@alltodo) { - %sizes = %{$tlmediatlpdb->sizes_of_packages( + %sizes = %{$remotetlpdb->sizes_of_packages( $localtlpdb->option("install_srcfiles"), $localtlpdb->option("install_docfiles"), @alltodo)}; } else { @@ -2394,7 +2389,7 @@ sub action_update { } } for my $p (@updated, @new) { - my $pkg = $tlmediatlpdb->get_package($p); + my $pkg = $remotetlpdb->get_package($p); tlwarn("Should not happen: $p not found in $location\n") if (!$pkg); next; for my $f ($pkg->all_files) { @@ -2438,7 +2433,7 @@ sub action_update { info("not removing $p due to -no-auto-remove (removed on server)\n"); } else { &ddebug("removing package $p\n"); - my $pkg = $localtlmedia->tlpdb->get_package($p); + my $pkg = $localtlpdb->get_package($p); if (! $pkg) { # This happened when a collection was removed by the user, # and then renamed on the server, e.g., collection-langarab -> @@ -2476,7 +2471,7 @@ sub action_update { clear_old_backups($p, $opts{"backupdir"}, $autobackup); } } - $localtlmedia->remove_package($p); + $localtlpdb->remove_package($p); logpackage("remove: $p"); } $currnr++; @@ -2572,7 +2567,7 @@ sub action_update { my $unwind_package; my $remove_unwind_container = 0; my $rev = $tlp->revision; - my $mediatlp = $tlmediatlpdb->get_package($pkg); + my $mediatlp = $remotetlpdb->get_package($pkg); if (!defined($mediatlp)) { debug("$pkg cannot be found in $location\n"); next; @@ -2666,10 +2661,10 @@ sub action_update { if ($pkg =~ m/$CriticalPackagesRegexp/) { debug("Not removing critical package $pkg\n"); } else { - $localtlmedia->remove_package($pkg, + $localtlpdb->remove_package($pkg, "remove-warn-files" => \%do_warn_on_move); } - if ($tlmediasrc->install_package($pkg, $localtlpdb)) { + if ($remotetlpdb->install_package($pkg, $localtlpdb)) { # installation succeeded because we got a reference logpackage("update: $pkg ($rev -> $mediarev)"); unlink($unwind_package) if $remove_unwind_container; @@ -2713,8 +2708,8 @@ sub action_update { $remove_unwind_container = 1; $unwind_package = $newname; } - my $instret = TeXLive::TLMedia->_install_package("$unwind_package", 0, - [], $localtlpdb); + my $instret = TeXLive::TLPDB->_install_package("$unwind_package", 0, + [], $localtlpdb); if ($instret) { # now we have to include the tlpobj my $tlpobj = TeXLive::TLPOBJ->new; @@ -2740,7 +2735,7 @@ sub action_update { unless $::machinereadable; } else { # install new packages - my $mediatlp = $tlmediatlpdb->get_package($pkg); + my $mediatlp = $remotetlpdb->get_package($pkg); if (!defined($mediatlp)) { tlwarn("\nShould not happen: $pkg not found in $location"); next; @@ -2768,7 +2763,7 @@ sub action_update { $currnr++; $donesize += $sizes{$pkg}; next if ($opts{"dry-run"} || $opts{"list"}); - if ($tlmediasrc->install_package($pkg, $localtlpdb)) { + if ($remotetlpdb->install_package($pkg, $localtlpdb)) { # installation succeeded because we got a reference logpackage("auto-install new: $pkg ($mediarev)"); $nrupdated++; @@ -2797,11 +2792,11 @@ sub action_update { my $newtlp; if ($updated{$pkg}) { $oldtlp = $localtlpdb->get_package($pkg); - $newtlp = $tlmediatlpdb->get_package($pkg); + $newtlp = $remotetlpdb->get_package($pkg); } else { # update failed but we could introduce new files, that # should be removed now as a part of restoring backup - $oldtlp = $tlmediatlpdb->get_package($pkg); + $oldtlp = $remotetlpdb->get_package($pkg); $newtlp = $localtlpdb->get_package($pkg); } die ("That shouldn't happen: $pkg not found in tlpdb") if !defined($newtlp); @@ -2897,8 +2892,8 @@ sub action_update { if ($opts{"dry-run"} && !$opts{"list"} && $restart_tlmgr) { $opts{"self"} = 0; $opts{"dry-run"} = -1; - $localtlmedia = undef; - $tlmediatlpdb = undef; + $localtlpdb = undef; + $remotetlpdb = undef; info ("Restarting tlmgr to complete update ...\n"); action_update(); return; @@ -2908,7 +2903,7 @@ sub action_update { # warn if nothing is updated. if (!(@new || @updated)) { info("tlmgr: no updates available\n"); - if ($tlmediasrc->media ne "NET" + if ($remotetlpdb->media ne "NET" && !$opts{"dry-run"} && !$opts{"repository"} ) { @@ -2948,18 +2943,18 @@ sub action_update { # . it does not care for whether a package seems to be installed or # not (that is the --reinstall) # -# TLMedia->install_package does ONLY INSTALL ONE PACKAGE, no deps whatsoever +# TLPDB->install_package does ONLY INSTALL ONE PACKAGE, no deps whatsoever # anymore! That has all to be done by hand. # sub action_install { init_local_db(1); return if !check_on_writable(); - # initialize the TLMedia from $location + # initialize the TLPDB from $location $opts{"no-depends"} = 1 if $opts{"no-depends-at-all"}; init_tlmedia(); # check for updates to tlmgr itself, and die unless --force is given - if (check_for_critical_updates( $localtlpdb, $tlmediatlpdb)) { + if (check_for_critical_updates( $localtlpdb, $remotetlpdb)) { critical_updates_warning(); if ($opts{"force"}) { tlwarn("Continuing due to --force\n"); @@ -2978,13 +2973,13 @@ sub action_install { my @packs = @ARGV; # first expand the .ARCH dependencies unless $opts{"no-depends-at-all"} - @packs = $tlmediatlpdb->expand_dependencies("-only-arch", $localtlpdb, @ARGV) unless $opts{"no-depends-at-all"}; + @packs = $remotetlpdb->expand_dependencies("-only-arch", $localtlpdb, @ARGV) unless $opts{"no-depends-at-all"}; # now expand all others unless $opts{"no-depends"} # if $opts{"reinstall"} do not collection->collection dependencies if ($opts{"reinstall"}) { - @packs = $tlmediatlpdb->expand_dependencies("-no-collections", $localtlpdb, @packs) unless $opts{"no-depends"}; + @packs = $remotetlpdb->expand_dependencies("-no-collections", $localtlpdb, @packs) unless $opts{"no-depends"}; } else { - @packs = $tlmediatlpdb->expand_dependencies($localtlpdb, @packs) unless $opts{"no-depends"}; + @packs = $remotetlpdb->expand_dependencies($localtlpdb, @packs) unless $opts{"no-depends"}; } # # installation order of packages: @@ -3013,7 +3008,7 @@ sub action_install { my @todo; for my $pkg (@inst_packs, @inst_colls, @inst_schemes) { my $pkgrev = 0; - my $mediatlp = $tlmediatlpdb->get_package($pkg); + my $mediatlp = $remotetlpdb->get_package($pkg); if (!defined($mediatlp)) { tlwarn("package $pkg not present in package repository.\n"); next; @@ -3036,7 +3031,7 @@ sub action_install { return if (!@todo); my $currnr = 1; - my %sizes = %{$tlmediatlpdb->sizes_of_packages( + my %sizes = %{$remotetlpdb->sizes_of_packages( $localtlpdb->option("install_srcfiles"), $localtlpdb->option("install_docfiles"), @todo)}; defined($sizes{'__TOTAL__'}) || ($sizes{'__TOTAL__'} = 0); @@ -3067,7 +3062,7 @@ sub action_install { info("[$currnr/$totalnr, $estrem/$esttot] ${re}install: $pkg [${kb}k]\n"); } if (!$opts{"dry-run"}) { - $tlmediasrc->install_package($pkg, $localtlpdb); + $remotetlpdb->install_package($pkg, $localtlpdb); logpackage("${re}install: $pkg"); } $donesize += $sizes{$pkg}; @@ -3098,18 +3093,18 @@ sub action_list { } my $tlm; if ($opts{"only-installed"}) { - $tlm = $localtlmedia; + $tlm = $localtlpdb; } else { init_tlmedia(); - $tlm = $tlmediasrc; + $tlm = $remotetlpdb; } my @whattolist; if ($what =~ m/^collection/i) { - @whattolist = $tlm->tlpdb->collections; + @whattolist = $tlm->collections; } elsif ($what =~ m/^scheme/i) { - @whattolist = $tlm->tlpdb->schemes; + @whattolist = $tlm->schemes; } else { - @whattolist = $tlm->tlpdb->list_packages; + @whattolist = $tlm->list_packages; } foreach (@whattolist) { next if ($_ =~ m/^00texlive/); @@ -3118,7 +3113,7 @@ sub action_list { } else { print " "; } - my $foo = $tlm->tlpdb->get_package($_)->shortdesc; + my $foo = $tlm->get_package($_)->shortdesc; print "$_: ", defined($foo) ? $foo : "(shortdesc missing)" , "\n"; } return; @@ -3311,12 +3306,11 @@ sub action_platform { $what || ($what = "list"); if ($what =~ m/^list$/i) { # list the available platforms - # initialize the TLMedia from $location + # initialize the TLPDB from $location init_tlmedia(); - my $mediatlpdb = $tlmediasrc->tlpdb; my @already_installed_arch = $localtlpdb->available_architectures; print "Available platforms:\n"; - foreach my $a ($mediatlpdb->available_architectures) { + foreach my $a ($remotetlpdb->available_architectures) { if (member($a,@already_installed_arch)) { print "(i) $a\n"; } else { @@ -3329,9 +3323,8 @@ sub action_platform { } elsif ($what =~ m/^add$/i) { return if !check_on_writable(); init_tlmedia(); - my $mediatlpdb = $tlmediasrc->tlpdb; my @already_installed_arch = $localtlpdb->available_architectures; - my @available_arch = $mediatlpdb->available_architectures; + my @available_arch = $remotetlpdb->available_architectures; my @todoarchs; foreach my $a (@ARGV) { if (TeXLive::TLUtils::member($a, @already_installed_arch)) { @@ -3351,9 +3344,9 @@ sub action_platform { if ($dep =~ m/^(.*)\.ARCH$/) { # we have to install something foreach my $a (@todoarchs) { - if ($tlmediatlpdb->get_package("$pkg.$a")) { + if ($remotetlpdb->get_package("$pkg.$a")) { info("install: $pkg.$a\n"); - $tlmediasrc->install_package("$pkg.$a", $localtlpdb) + $remotetlpdb->install_package("$pkg.$a", $localtlpdb) if (!$opts{"dry-run"}); } } @@ -3364,7 +3357,7 @@ sub action_platform { # install the necessary w32 stuff for my $p (@extra_w32_packs) { info("install: $p\n"); - $tlmediasrc->install_package($p, $localtlpdb) if (!$opts{"dry-run"}); + $remotetlpdb->install_package($p, $localtlpdb) if (!$opts{"dry-run"}); } } # update the option("available_architectures") list of installed archs @@ -3378,7 +3371,7 @@ sub action_platform { return if !check_on_writable(); my @already_installed_arch = $localtlpdb->available_architectures; my @todoarchs; - my $currentarch = $localtlmedia->platform(); + my $currentarch = $localtlpdb->platform(); foreach my $a (@ARGV) { if (!TeXLive::TLUtils::member($a, @already_installed_arch)) { print "Platform $a not installed, use 'tlmgr platform list'!\n"; @@ -3404,7 +3397,7 @@ sub action_platform { foreach my $a (@todoarchs) { if ($localtlpdb->get_package("$pkg.$a")) { info("remove: $pkg.$a\n"); - $localtlmedia->remove_package("$pkg.$a") if (!$opts{"dry-run"}); + $localtlpdb->remove_package("$pkg.$a") if (!$opts{"dry-run"}); } } } @@ -3413,7 +3406,7 @@ sub action_platform { if (TeXLive::TLUtils::member('win32', @todoarchs)) { for my $p (@extra_w32_packs) { info("remove: $p\n"); - $localtlmedia->remove_package($p) if (!$opts{"dry-run"}); + $localtlpdb->remove_package($p) if (!$opts{"dry-run"}); } } if (!$opts{"dry-run"}) { @@ -3629,11 +3622,11 @@ sub action_uninstall { } print ("Ok, removing the whole installation:\n"); init_local_db(); - TeXLive::TLUtils::remove_symlinks($localtlmedia->tlpdb->root, - $localtlmedia->platform(), - $localtlmedia->tlpdb->option("sys_bin"), - $localtlmedia->tlpdb->option("sys_man"), - $localtlmedia->tlpdb->option("sys_info")); + TeXLive::TLUtils::remove_symlinks($localtlpdb->root, + $localtlpdb->platform(), + $localtlpdb->option("sys_bin"), + $localtlpdb->option("sys_man"), + $localtlpdb->option("sys_info")); # now do remove the rest system("rm", "-rf", "$Master/texmf-dist"); system("rm", "-rf", "$Master/texmf-doc"); @@ -3845,7 +3838,7 @@ sub check_files { # if we are on W32, return (no find). We need -use-svn only for # checking the live repository on tug, which is not w32. - my $arch = $localtlmedia->platform(); + my $arch = $localtlpdb->platform(); return $ret if $arch eq "win32"; # check that all files in the trees are covered. @@ -4427,15 +4420,12 @@ sub init_local_db { # if the localtlpdb is already defined do simply return here already # to make sure that the settings in the local tlpdb do not overwrite # stuff changed via the GUI - return if defined $localtlmedia; return if defined $localtlpdb; - $localtlmedia = TeXLive::TLMedia->new ( $Master ); - die("cannot setup TLMedia in $Master") unless (defined($localtlmedia)); - $localtlpdb = $localtlmedia->tlpdb; - die("cannot find tlpdb in $Master") unless (defined($localtlpdb)); + $localtlpdb = TeXLive::TLPDB->new ( root => $Master ); + die("cannot setup TLPDB in $Master") unless (defined($localtlpdb)); # setup the programs, for w32 we need the shipped wget/xz etc, so we # pass the location of these files to setup_programs. - if (!setup_programs("$Master/tlpkg/installer", $localtlmedia->platform)) { + if (!setup_programs("$Master/tlpkg/installer", $localtlpdb->platform)) { tlwarn("Couldn't set up the necessary programs.\nInstallation of packages is not supported.\nPlease report to texlive\@tug.org.\n"); if (defined($should_i_die) && $should_i_die) { finish(1); @@ -4471,12 +4461,12 @@ sub init_local_db { } -# initialize the global $tlmediasrc object, or die. +# initialize the global $remotetlpdb object, or die. # uses the global $location. # sub init_tlmedia { - if (defined($tlmediatlpdb) && ($tlmediatlpdb->root eq $location)) { + if (defined($remotetlpdb) && ($remotetlpdb->root eq $location)) { # nothing to be done return; } @@ -4531,8 +4521,8 @@ http://tug.org/texlive/doc/install-tl.html END_NO_INTERNET # above text duplicated in install-tl - $tlmediasrc = TeXLive::TLMedia->new(-location => $location, - -tlpdbfile => $loc_copy_of_remote_tlpdb); + $remotetlpdb = TeXLive::TLPDB->new(root => $location, + tlpdbfile => $loc_copy_of_remote_tlpdb); $local_copy_tlpdb_used = 1; } else { ddebug("found remote digest: $rem_digest\n"); @@ -4540,19 +4530,17 @@ END_NO_INTERNET ddebug("rem_copy_digest = $rem_copy_digest\n"); if ($rem_copy_digest eq $rem_digest) { debug("md5 of local copy identical with remote hash\n"); - $tlmediasrc = TeXLive::TLMedia->new(-location => $location, - -tlpdbfile => $loc_copy_of_remote_tlpdb); + $remotetlpdb = TeXLive::TLPDB->new(root => $location, + tlpdbfile => $loc_copy_of_remote_tlpdb); $local_copy_tlpdb_used = 1; } } } } if (!$local_copy_tlpdb_used) { - # $tlmediasrc is a global variable - $tlmediasrc = TeXLive::TLMedia->new(-location => $location); + $remotetlpdb = TeXLive::TLPDB->new(root => $location); } - die($loadmediasrcerror . $location) unless defined($tlmediasrc); - $tlmediatlpdb = $tlmediasrc->tlpdb; + die($loadmediasrcerror . $location) unless defined($remotetlpdb); # we allow a range of years to be specified by the remote tlpdb # for which it might work. # the lower limit is TLPDB->config_minrelease @@ -4563,10 +4551,10 @@ END_NO_INTERNET # might use # release/2009-foobar # If it should work for 2009 and 2010, please use - # release/2010-foobar # minrelease/2009-foobar - my $texlive_release = $tlmediatlpdb->config_release; - my $texlive_minrelease = $tlmediatlpdb->config_minrelease; + # release/2010-foobar + my $texlive_release = $remotetlpdb->config_release; + my $texlive_minrelease = $remotetlpdb->config_minrelease; if (!defined($texlive_release)) { tldie "The installation repository does not specify a release year for which it was prepared, bailing out.\n"; } @@ -4595,7 +4583,7 @@ do not include the version of the local installation END_BADRANGE } } else { - # $texlive_release not defined, so only one year is valid + # $texlive_minrelease not defined, so only one year is valid if ($texlive_release_year != $TeXLive::TLConfig::ReleaseYear) { tldie <<END_BADYEAR $0: The TeX Live versions of the local installation @@ -4608,7 +4596,7 @@ END_BADYEAR } # check for being frozen - if ($tlmediatlpdb->option("frozen")) { + if ($remotetlpdb->option("frozen")) { my $frozen_msg = <<FROZEN; TeX Live $TeXLive::TLConfig::ReleaseYear is frozen forever and will no longer be updated. This happens in preparation for a new release. @@ -4636,7 +4624,7 @@ FROZEN &debug("Cannot save remote TeX Live database to $loc_copy_of_remote_tlpdb: $!\n"); } else { &debug("writing out tlpdb to $loc_copy_of_remote_tlpdb\n"); - $tlmediatlpdb->writeout($tlfh); + $remotetlpdb->writeout($tlfh); close($tlfh); } } diff --git a/Master/texmf/scripts/texlive/tlmgrgui.pl b/Master/texmf/scripts/texlive/tlmgrgui.pl index 29355a6119a..9b6c146e020 100644 --- a/Master/texmf/scripts/texlive/tlmgrgui.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui.pl @@ -53,9 +53,7 @@ my $mode_expert = $config{"gui-expertmode"}; # # stuff defined in tlmgr.pl that needs to be our-ed our $Master; -our $tlmediatlpdb; -our $tlmediasrc; -our $localtlmedia; +our $remotetlpdb; our $localtlpdb; our $location; our %opts; @@ -692,10 +690,10 @@ sub show_extended_info { $tf->Label(-text => $Packages{$p}{'secondary'}), -sticky => "nw"); } - if ($tlmediatlpdb) { + if ($remotetlpdb) { my @colls; if ($tlp->category ne "Collection" && $tlp->category ne "Scheme") { - @colls = $tlmediatlpdb->needed_by($tlp->name); + @colls = $remotetlpdb->needed_by($tlp->name); } @colls = grep {m;^collection-;} @colls; if (@colls) { @@ -958,12 +956,12 @@ sub MatchesFilters { ############# ARCH HANDLING ##################### sub init_archs { - if (!defined($tlmediatlpdb)) { + if (!defined($remotetlpdb)) { @archsavail = $localtlpdb->available_architectures; } else { - @archsavail = $tlmediatlpdb->available_architectures; + @archsavail = $remotetlpdb->available_architectures; } - $currentarch = $localtlmedia->platform(); + $currentarch = $localtlpdb->platform(); @archsinstalled = $localtlpdb->available_architectures; foreach my $a (@archsavail) { $archs{$a} = 0; @@ -1562,26 +1560,24 @@ sub setup_location { sub init_install_media { my $newroot = $location; - if (defined($tlmediatlpdb) && ($tlmediatlpdb->root eq $newroot)) { + if (defined($remotetlpdb) && ($remotetlpdb->root eq $newroot)) { # nothing to be done } else { $mw->Busy(-recurse => 1); info(__("Loading remote TeX Live Database\nThis may take some time, please wait!") . "\n"); - $tlmediasrc = TeXLive::TLMedia->new($newroot); + $remotetlpdb = TeXLive::TLPDB->new(root => $newroot); info(__("Completed") . ".\n"); $mw->Unbusy; - if (!defined($tlmediasrc)) { + if (!defined($remotetlpdb)) { # something went badly wrong, maybe the newroot is wrong? $mw->Dialog(-title => __("Warning"), -text => __("Could not load the TeX Live Database from %s\nIf you want to install or update packages, please try with a different package repository!\n\nFor configuration and removal you don\'t have to do anything.", $newroot), -buttons => [ __("Ok") ])->Show; - $tlmediatlpdb = undef; - $tlmediasrc = undef; + $remotetlpdb = undef; update_list_remote(); update_grid(); update_loaded_location_string("none"); } else { - $tlmediatlpdb = $tlmediasrc->tlpdb; update_list_remote(); update_grid(); update_loaded_location_string($location); @@ -1871,15 +1867,15 @@ sub update_list_remote { delete $Packages{$p}{'remoterevision'}; delete $Packages{$p}{'remotecatalogueversion'}; } - if (defined($tlmediatlpdb)) { - for my $p ($tlmediatlpdb->list_packages()) { + if (defined($remotetlpdb)) { + for my $p ($remotetlpdb->list_packages()) { # skip 00texlive packages next if ($p =~ m!^00texlive!); if ($p =~ m;\.;) { push @do_later_media, $p; next; } - my $tlp = $tlmediatlpdb->get_package($p); + my $tlp = $remotetlpdb->get_package($p); populate_Packages("remote", $tlp); } } @@ -1890,7 +1886,7 @@ sub update_list_remote { tlerror("very strange, above it matched and now not anymore?!?! $p\n"); next; } - my $tlp = $tlmediatlpdb->get_package($p); + my $tlp = $remotetlpdb->get_package($p); if (!defined($Packages{$mp})) { populate_Packages("remote", $tlp); } else { |