diff options
author | Norbert Preining <preining@logic.at> | 2009-02-11 02:31:03 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2009-02-11 02:31:03 +0000 |
commit | bb8566efe0c59ee3289b4487707ee5c34e1b7491 (patch) | |
tree | f950535313644d3b0e90a68d9e677c05b69c3d61 /Master/texmf/scripts | |
parent | eee26d6dea780b094443f563157e5a83fd88cf38 (diff) |
use the same global our $tlmediatlpdb throughout, and add some our statements
to the tlmgrgui.pl script at the top
git-svn-id: svn://tug.org/texlive/trunk@12140 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf/scripts')
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr.pl | 26 | ||||
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl | 10 |
2 files changed, 14 insertions, 22 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index d50a0b5318b..0e7d4a4d633 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -780,7 +780,6 @@ sub action_show { action_gui("config"); } init_local_db(); - my $tlmediatlpdb; foreach my $pkg (@ARGV) { my $tlpdb = $localtlpdb; my $tlp = $localtlpdb->get_package($pkg); @@ -788,7 +787,6 @@ sub action_show { if (!$tlp) { if (!$tlmediatlpdb) { init_tlmedia(); - $tlmediatlpdb = $tlmediasrc->tlpdb; } $tlp = $tlmediatlpdb->get_package($pkg); $tlpdb = $tlmediatlpdb; @@ -803,7 +801,6 @@ sub action_show { # not referenced in the local tlpdb, so try the remote here, too if (!$tlmediatlpdb) { init_tlmedia(); - $tlmediatlpdb = $tlmediasrc->tlpdb; } @colls = $tlmediatlpdb->needed_by($pkg); } @@ -1253,12 +1250,10 @@ sub action_update { action_gui("update"); } init_local_db(1); - # initialize the TLMedia from $location $opts{"no-depends"} = 1 if $opts{"no-depends-at-all"}; my %ret; init_tlmedia(); - my $mediatlpdb = $tlmediasrc->tlpdb; info("update: dry run, no changes will be made\n") if $opts{"dry-run"}; # if the update is not for one of the critical packages then do @@ -1284,7 +1279,7 @@ sub action_update { } } if ($other_updates_asked_for) { - if (check_for_critical_updates($localtlpdb, $mediatlpdb)) { + if (check_for_critical_updates($localtlpdb, $tlmediatlpdb)) { if ($opts{"force"}) { tlwarn("$0: Continuing due to --force.\n"); } elsif ($opts{"list"}) { @@ -1393,12 +1388,12 @@ sub action_update { my @colls = (); for my $p ($localtlpdb->collections) { push @colls, $p - if defined($mediatlpdb->get_package($p)); + if defined($tlmediatlpdb->get_package($p)); } my @localexpansion = $localtlpdb->expand_dependencies($localtlpdb, @colls); my @remoteexpansion = - $mediatlpdb->expand_dependencies($localtlpdb, @colls); + $tlmediatlpdb->expand_dependencies($localtlpdb, @colls); for my $p (@remoteexpansion) { $newpkgs{$p} = 1; } @@ -1433,11 +1428,11 @@ sub action_update { } # update all .ARCH dependencies, too, unless $opts{"no-depends-at-all"}: - @todo = $mediatlpdb->expand_dependencies("-only-arch", $localtlpdb, @todo) + @todo = $tlmediatlpdb->expand_dependencies("-only-arch", $localtlpdb, @todo) unless $opts{"no-depends-at-all"}; # # update general deps unless $opts{"no-depends"}: - @todo = $mediatlpdb->expand_dependencies("-no-collections",$localtlpdb,@todo) + @todo = $tlmediatlpdb->expand_dependencies("-no-collections",$localtlpdb,@todo) unless $opts{"no-depends"}; # @@ -1481,7 +1476,7 @@ sub action_update { next; } # install new packages - my $mediatlp = $mediatlpdb->get_package($pkg); + my $mediatlp = $tlmediatlpdb->get_package($pkg); if (!defined($mediatlp)) { tlwarn("\nShould not happen: $pkg not found in $location\n"); next; @@ -1491,7 +1486,7 @@ sub action_update { next; } my $rev = $tlp->revision; - my $mediatlp = $mediatlpdb->get_package($pkg); + my $mediatlp = $tlmediatlpdb->get_package($pkg); if (!defined($mediatlp)) { debug("$pkg cannot be found in $location\n"); next; @@ -1532,7 +1527,7 @@ sub action_update { my %sizes; # for size calculation we also want w32 special packages if (@new || @updated || @w32_updated) { - %sizes = %{$mediatlpdb->sizes_of_packages( + %sizes = %{$tlmediatlpdb->sizes_of_packages( $localtlpdb->option_install_srcfiles, $localtlpdb->option_install_docfiles, @new, @updated, @w32_updated)}; @@ -1571,7 +1566,7 @@ sub action_update { # install all the new packages first for my $pkg (sort @new) { # install new packages - my $mediatlp = $mediatlpdb->get_package($pkg); + my $mediatlp = $tlmediatlpdb->get_package($pkg); if (!defined($mediatlp)) { tlwarn("\nShould not happen: $pkg not found in $location\n"); next; @@ -1603,7 +1598,7 @@ sub action_update { my $unwind_package; my $remove_unwind_container = 0; my $rev = $tlp->revision; - my $mediatlp = $mediatlpdb->get_package($pkg); + my $mediatlp = $tlmediatlpdb->get_package($pkg); if (!defined($mediatlp)) { debug("$pkg cannot be found in $location\n"); next; @@ -1768,7 +1763,6 @@ sub action_install { $opts{"no-depends"} = 1 if $opts{"no-depends-at-all"}; my %ret; init_tlmedia(); - my $tlmediatlpdb = $tlmediasrc->tlpdb; # check for updates to tlmgr itself, and die unless --force is given if (check_for_critical_updates( $localtlpdb, $tlmediatlpdb)) { diff --git a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl index 3dc9bac0098..2d6bb4d6b83 100755 --- a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl @@ -7,7 +7,6 @@ # GUI for tlmgr # -our $Master; use Tk; use Tk::Dialog; @@ -19,6 +18,10 @@ use TeXLive::Splashscreen; use TeXLive::TLUtils qw(setup_programs platform_desc win32 debug); +our $Master; +our $tlmediatlpdb; +our $tlmediasrc; +our $location; # # translation facility, not fully functional by now # @@ -220,7 +223,6 @@ our @alllocalpackages = setup_list(0,$localtlpdb->list_packages); our @updatepackages; setup_programs("$Master/tlpkg/installer", $localtlpdb->option_platform); -our $location; my $loc = $localtlpdb->option_location; if (defined($loc)) { $location = $loc; @@ -239,10 +241,6 @@ push @update_function_list, \&init_install_media; push @update_function_list, \&create_update_list; - -# wm title . "tlmgr 2008" - -# frame .top our $top = $mw->Frame; our $quit = $top->Button(-text => ___"quit", |