diff options
author | Norbert Preining <preining@logic.at> | 2008-08-26 09:33:39 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-08-26 09:33:39 +0000 |
commit | e69fe702409c684a643b1dfeaef34056a537e875 (patch) | |
tree | ed27ab87a5734d29ff4e3c6a238d36d19f74d9de /Master/tlpkg/etc | |
parent | d1640c64af49f2a2c7b60ffe32dca8ce63dee0af (diff) |
add another patch to be included
git-svn-id: svn://tug.org/texlive/trunk@10405 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/etc')
-rw-r--r-- | Master/tlpkg/etc/tlmgr-and-gui-fix-on-mirror.diff | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/Master/tlpkg/etc/tlmgr-and-gui-fix-on-mirror.diff b/Master/tlpkg/etc/tlmgr-and-gui-fix-on-mirror.diff new file mode 100644 index 00000000000..cb15133ff10 --- /dev/null +++ b/Master/tlpkg/etc/tlmgr-and-gui-fix-on-mirror.diff @@ -0,0 +1,142 @@ +Index: tlmgr.pl +=================================================================== +--- tlmgr.pl (revision 10402) ++++ tlmgr.pl (working copy) +@@ -37,7 +37,7 @@ + use TeXLive::TLUtils; + use TeXLive::TLWinGoo; + use TeXLive::TLPostActions; +-TeXLive::TLUtils->import( qw(kpsewhich member win32 merge_into copy log) ); ++TeXLive::TLUtils->import( qw(kpsewhich member info give_ctan_mirror win32 merge_into copy log debug) ); + use Cwd qw/abs_path/; + use Pod::Usage; + use Getopt::Long qw(:config no_autoabbrev require_order); +@@ -416,8 +416,7 @@ + my $installed = 0; + if (!$tlp) { + if (!$tlmediatlpdb) { +- $tlmediasrc = TeXLive::TLMedia->new($location); +- die($loadmediasrcerror . $location) unless defined($tlmediasrc); ++ init_tlmedia(); + $tlmediatlpdb = $tlmediasrc->tlpdb; + } + $tlp = $tlmediatlpdb->get_package($pkg); +@@ -449,8 +448,7 @@ + my $tlpdb; + init_local_db(); + if ($opt_global) { +- $tlmediasrc = TeXLive::TLMedia->new($location); +- die($loadmediasrcerror . $location) unless defined($tlmediasrc); ++ init_tlmedia(); + $tlpdb = $tlmediasrc->tlpdb; + } else { + $tlpdb = $localtlpdb; +@@ -612,8 +610,7 @@ + "backupdir=s" => \$opt_backupdir, + "dry-run" => \$opt_dry) or pod2usage(2); + my %ret; +- $tlmediasrc = TeXLive::TLMedia->new($location); +- die($loadmediasrcerror . $location) unless defined($tlmediasrc); ++ init_tlmedia(); + my $mediatlpdb = $tlmediasrc->tlpdb; + my @todo; + if ($opt_all || $opt_list) { +@@ -636,7 +633,7 @@ + my $rev = $tlp->revision; + my $mediatlp = $mediatlpdb->get_package($pkg); + if (!defined($mediatlp)) { +- print "$pkg cannot be found in $location\n"; ++ debug("$pkg cannot be found in $location\n"); + next; + } + my $mediarev = $mediatlp->revision; +@@ -763,8 +760,7 @@ + GetOptions("no-depends" => \$opt_nodepends, + "dry-run" => \$opt_dry) or pod2usage(2); + my %ret; +- $tlmediasrc = TeXLive::TLMedia->new($location); +- die($loadmediasrcerror . $location) unless defined($tlmediasrc); ++ init_tlmedia(); + foreach my $pkg (@ARGV) { + if ($opt_dry) { + print "install: $pkg\n"; +@@ -784,8 +780,7 @@ + init_local_db(); + my $what = shift @ARGV; + $what || ($what = ""); +- $tlmediasrc = TeXLive::TLMedia->new($location); +- die($loadmediasrcerror . $location) unless defined($tlmediasrc); ++ init_tlmedia(); + my @whattolist; + if ($what =~ m/^collection/i) { + @whattolist = $tlmediasrc->tlpdb->collections; +@@ -881,8 +876,7 @@ + if ($what =~ m/^list$/i) { + # list the available architectures + # initialize the TLMedia from $location +- $tlmediasrc = TeXLive::TLMedia->new($location); +- die($loadmediasrcerror . $location) unless defined($tlmediasrc); ++ init_tlmedia(); + my $mediatlpdb = $tlmediasrc->tlpdb; + my @already_installed_arch = $localtlpdb->available_architectures; + print "Available architectures:\n"; +@@ -897,8 +891,7 @@ + print "You can add new architectures with tlmgr arch add arch1 arch2\n"; + exit(0); + } elsif ($what =~ m/^add$/i) { +- $tlmediasrc = TeXLive::TLMedia->new($location); +- die($loadmediasrcerror . $location) unless defined($tlmediasrc); ++ init_tlmedia(); + my $mediatlpdb = $tlmediasrc->tlpdb; + my @already_installed_arch = $localtlpdb->available_architectures; + my @available_arch = $mediatlpdb->available_architectures; +@@ -1183,7 +1176,24 @@ + system("rmdir", "--ignore-fail-on-non-empty", "$texdir"); + } + ++# ++# init_tlmedia ++# initialize a tlmedia object and returns it, or dies ++# ++sub init_tlmedia { ++ if (($location =~ m/$TeXLiveServerURL/) || ++ ($location =~ m/^defaultnet$/i)) { ++ $location = give_ctan_mirror(); ++ info("Using mirror $location\n"); ++ } ++ # $tlmediasrc is a global function ++ $tlmediasrc = TeXLive::TLMedia->new($location); ++ die($loadmediasrcerror . $location) unless defined($tlmediasrc); ++} + ++ ++ ++ + # + # return all the directories from which all content will be removed + # +Index: tlmgrgui/tlmgrgui-real.pl +=================================================================== +--- tlmgrgui/tlmgrgui-real.pl (revision 10402) ++++ tlmgrgui/tlmgrgui-real.pl (working copy) +@@ -116,7 +116,7 @@ + loadremotetlpdbwait => "Loading remote TeX Live Database\nThis may take some time, please wait!", + runupdater => "Some package cannot be updated using the GUI!\nPlease run TEXROOT/tlpkg/installer/updater.bat once,\notherwise the updates will not be complete!\nNOTE: You have to QUIT this program first!", + actions => "Actions", +- reinitlsr => "Re-initalise file database", ++ reinitlsr => "Re-initialise file database", + recreateformats => "Re-create all formats", + updatemaps => "Update font map database", + warningnonetupdate => "No updates found.\n\nYour installation is set up to look on the disk for updates.\n\nIf you want to install from the Internet for this one time only, click on the \"Change\" button above and select \"Default Net Location\" (or any other network location you know to be working).\n\nIf you want to change it permanently, go to the \"Configuration\" Tab and change the default installation source.", +@@ -667,6 +667,11 @@ + my $f = $sw->Frame; + my $okbutton = $f->Button(-text => 'Ok', + -command => sub { $location = $entry->get; ++ # we want to check that if mirror.ctan.org is used ++ # that we select a mirror once ++ if ($location =~ m/$TeXLive::TLConfig::TeXLiveServerURL/) { ++ $location = TeXLive::TLUtils::give_ctan_mirror(); ++ } + run_update_functions() ; + $sw->destroy })->pack(-side => 'left', -padx => "2m", -pady => "2m"); + my $cancelbutton = $f->Button(-text => 'Cancel', |