From e346d80f3e4b476b95b7ce6ded11adcc88c99275 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 28 Mar 2012 09:14:31 +0000 Subject: more updates to tlmgr gui multi support git-svn-id: svn://tug.org/texlive/trunk@25758 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/dev/dev.multi-source-support-v2.patch | 110 +++++++++++++++++---- 1 file changed, 89 insertions(+), 21 deletions(-) (limited to 'Master/tlpkg/dev') diff --git a/Master/tlpkg/dev/dev.multi-source-support-v2.patch b/Master/tlpkg/dev/dev.multi-source-support-v2.patch index ab37f7cf9fd..18c03dcd4ec 100644 --- a/Master/tlpkg/dev/dev.multi-source-support-v2.patch +++ b/Master/tlpkg/dev/dev.multi-source-support-v2.patch @@ -1,8 +1,8 @@ --- texmf/scripts/texlive/tlmgr.pl | 916 ++++++++++++++++++++++++++++++++------ - texmf/scripts/texlive/tlmgrgui.pl | 236 ++++++++- + texmf/scripts/texlive/tlmgrgui.pl | 292 ++++++++++-- tlpkg/TeXLive/TLPDB.pm | 706 ++++++++++++++++++++++++++--- - 3 files changed, 1618 insertions(+), 240 deletions(-) + 3 files changed, 1665 insertions(+), 249 deletions(-) Index: tlpkg/TeXLive/TLPDB.pm =================================================================== @@ -2241,7 +2241,7 @@ Index: texmf/scripts/texlive/tlmgr.pl Index: texmf/scripts/texlive/tlmgrgui.pl =================================================================== --- texmf/scripts/texlive/tlmgrgui.pl.orig 2011-06-16 21:30:37.000000000 +0900 -+++ texmf/scripts/texlive/tlmgrgui.pl 2012-03-24 16:46:19.086564149 +0900 ++++ texmf/scripts/texlive/tlmgrgui.pl 2012-03-28 14:30:06.000129905 +0900 @@ -1,7 +1,7 @@ #!/usr/bin/env perl # $Id: tlmgrgui.pl 23011 2011-06-16 12:30:37Z preining $ @@ -2394,7 +2394,7 @@ Index: texmf/scripts/texlive/tlmgrgui.pl if ($mode_expert) { -@@ -1383,16 +1421,14 @@ +@@ -1383,48 +1421,145 @@ } } @@ -2416,12 +2416,60 @@ Index: texmf/scripts/texlive/tlmgrgui.pl + $sw->Label(-text => $info)->pack(-padx => "2m", -pady => "2m"); my $f1 = $sw->Frame; - my $entry = $f1->Entry(-text => $val, -width => 50); -@@ -1417,10 +1453,71 @@ +- my $entry = $f1->Entry(-text => $val, -width => 50); +- $entry->pack(-side => "left",-padx => "2m", -pady => "2m"); ++ my @mirror_list; ++ push @mirror_list, " " . __("Default remote repository") . ": http://mirror.ctan.org"; ++ push @mirror_list, TeXLive::TLUtils::create_mirror_list(); ++ my $entry = $f1->BrowseEntry( ++ -listheight => 12, ++ -listwidth => 400, ++ -width => 50, ++ -autolistwidth => 1, ++ -choices => \@mirror_list, ++ -browsecmd => ++ sub { ++ if ($val !~ m/^ /) { ++ $val = ""; ++ } elsif ($val =~ m!(http|ftp)://!) { ++ $val = TeXLive::TLUtils::extract_mirror_entry($val); ++ } else { ++ $val =~ s/^\s*//; ++ } ++ }, ++ -variable => \$val)->pack(-side => "left",-padx => "2m", -pady => "2m"); ++ ++ #my $entry = $f1->Entry(-text => $val, -width => 50); ++ #$entry->pack(-side => "left",-padx => "2m", -pady => "2m"); + + my $f2 = $sw->Frame; + $f2->Button(-text => __("Choose Directory"), + -command => sub { +- my $var = $sw->chooseDirectory; +- if (defined($var)) { +- $entry->delete(0,"end"); +- $entry->insert(0,$var); +- } ++ $val = $sw->chooseDirectory; ++ #if (defined($var)) { ++ # $entry->delete(0,"end"); ++ # $entry->insert(0,$var); ++ #} + })->pack(-side => "left",-padx => "2m", -pady => "2m"); + $f2->Button(-text => __("Default remote repository"), + -command => sub { +- $entry->delete(0,"end"); +- $entry->insert(0,$TeXLiveURL); ++ #$entry->delete(0,"end"); ++ #$entry->insert(0,$TeXLiveURL); ++ $val = $TeXLiveURL; + })->pack(-side => "left",-padx => "2m", -pady => "2m"); + $f1->pack; + $f2->pack; my $f = $sw->Frame; my $okbutton = $f->Button(-text => __("Ok"), -+ -command => sub { $val = $entry->get; $done = 1; } ++ -command => sub { $done = 1; } + )->pack(-side => 'left',-padx => "2m", -pady => "2m"); + my $cancelbutton = $f->Button(-text => __("Cancel"), + -command => sub { $val = undef; $done = 1; } @@ -2463,17 +2511,31 @@ Index: texmf/scripts/texlive/tlmgrgui.pl + my @entry_loc; my $locw = 30; + my @entry_del; + my @entry_chg; ++ ++ my %edit_repos = %tlpdb_repos; ++ my @edit_tags = @tlpdb_tags; + push @entry_tag, $f1->Entry(-text => 'main', -state => 'readonly', -width => $tagw); + push @entry_loc, $f1->Entry(-text => $tlpdb_repos{'main'}, -width => $locw); + push @entry_del, $f1->Button(-text => __("Delete"), -state => 'disabled'); -+ push @entry_chg, $f1->Button(-text => __("Change")); -+ for my $t (sort @tlpdb_tags) { ++ push @entry_chg, $f1->Button(-text => __("Change"), ++ -command => sub { ++ my $ret = ask_one_repository($sw, __("Change main package repository"), ++ __("New main package repository")); ++ $edit_repos{'main'} = $ret if (defined($ret)); ++ }); ++ for my $t (sort @edit_tags) { + next if ($t eq "main"); -+ push @entry_tag, $f1->Entry(-text => $t, -width => $tagw); -+ push @entry_loc, $f1->Entry(-text => $tlpdb_repos{$t}, -width => $locw); ++ push @entry_tag, $f1->Entry(-textvariable => \$t, -width => $tagw); ++ push @entry_loc, $f1->Entry(-textvariable => \$edit_repos{$t}, -width => $locw); + push @entry_del, $f1->Button(-text => __("Delete")); -+ push @entry_chg, $f1->Button(-text => __("Change")); -+ } ++ push @entry_chg, $f1->Button(-text => __("Change"), ++ -command => sub { ++ my $ret = ask_one_repository($sw, __("Change subsidiary package repository"), ++ __("New subsidiary package repository")); ++ $edit_repos{$t} = $ret if (defined($ret)); ++ }); ++ } ++ # add some "Add ..." line? TODO + for my $i (0..$#entry_tag) { + $entry_tag[$i]->grid( $entry_loc[$i], $entry_del[$i], $entry_chg[$i], + -padx => "1m", -pady => "1m", -sticky => "nwe"); @@ -2491,7 +2553,13 @@ Index: texmf/scripts/texlive/tlmgrgui.pl $sw->destroy; })->pack(-side => 'left',-padx => "2m", -pady => "2m"); my $cancelbutton = $f->Button(-text => __("Cancel"), -@@ -1554,19 +1651,27 @@ + -command => sub { $sw->destroy })->pack(-side => 'right',-padx => "2m", -pady => "2m"); ++ my $resetbutton = $f->Button(-text => __("Revert"), ++ -command => sub { print "TODO REVERT SETTINGS\n"; })->pack(-side => 'right',-padx => "2m", -pady => "2m"); + $f->pack(-expand => 'x'); + $sw->bind('', [ $okbutton, 'Invoke' ]); + $sw->bind('', [ $cancelbutton, 'Invoke' ]); +@@ -1554,19 +1689,27 @@ sub setup_location { my $loc = shift; $location = $loc; @@ -2524,7 +2592,7 @@ Index: texmf/scripts/texlive/tlmgrgui.pl $mw->Unbusy; if (!defined($remotetlpdb)) { # something went badly wrong, maybe the newroot is wrong? -@@ -1725,7 +1830,7 @@ +@@ -1725,7 +1868,7 @@ # sub populate_Packages # sub populate_Packages { @@ -2533,7 +2601,7 @@ Index: texmf/scripts/texlive/tlmgrgui.pl my $p = $tlp->name; $Packages{$p}{'displayname'} = $p; if ($mode eq "local") { -@@ -1736,6 +1841,10 @@ +@@ -1736,6 +1879,10 @@ $Packages{$p}{'tlp'} = $tlp; } else { $Packages{$p}{'remoterevision'} = $tlp->revision; @@ -2544,7 +2612,7 @@ Index: texmf/scripts/texlive/tlmgrgui.pl $Packages{$p}{'selected'} = 0 unless defined $Packages{$p}{'selected'}; if (!defined($Packages{$p}{'tlp'})) { -@@ -1865,6 +1974,7 @@ +@@ -1865,6 +2012,7 @@ next; } delete $Packages{$p}{'remoterevision'}; @@ -2552,7 +2620,7 @@ Index: texmf/scripts/texlive/tlmgrgui.pl delete $Packages{$p}{'remotecatalogueversion'}; } if (defined($remotetlpdb)) { -@@ -1875,8 +1985,15 @@ +@@ -1875,8 +2023,15 @@ push @do_later_media, $p; next; } @@ -2570,7 +2638,7 @@ Index: texmf/scripts/texlive/tlmgrgui.pl } } my @avail_arch = $localtlpdb->available_architectures; -@@ -1886,9 +2003,16 @@ +@@ -1886,9 +2041,16 @@ tlerror("very strange, above it matched and now not anymore?!?! $p\n"); next; } @@ -2589,7 +2657,7 @@ Index: texmf/scripts/texlive/tlmgrgui.pl } else { # two cases: # - $mp.$ma where $ma is in available_archs -@@ -1926,7 +2050,7 @@ +@@ -1926,7 +2088,7 @@ } else { # only show that one if it is locally installed if (defined($Packages{$p})) { @@ -2598,7 +2666,7 @@ Index: texmf/scripts/texlive/tlmgrgui.pl } } } -@@ -2216,7 +2340,47 @@ +@@ -2216,7 +2378,47 @@ sub update_loaded_location_string { my $arg = shift; $arg || ($arg = $location); -- cgit v1.2.3