diff options
author | Norbert Preining <preining@logic.at> | 2008-09-10 13:57:16 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-09-10 13:57:16 +0000 |
commit | c8db5196e7ef42bf9413b3bc5c189f68e1809b5a (patch) | |
tree | 6f09a63a86d5ba6c74325ac31b9439ff257548c2 /Master | |
parent | e17e4c041d19ebb98a8dea097948b18001fc0956 (diff) |
update multi-source patch for
tlmgr install package/tag
support
git-svn-id: svn://tug.org/texlive/trunk@10539 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/tlpkg/etc/multi-source-support.diff | 119 |
1 files changed, 91 insertions, 28 deletions
diff --git a/Master/tlpkg/etc/multi-source-support.diff b/Master/tlpkg/etc/multi-source-support.diff index feffbb91962..9e96668d938 100644 --- a/Master/tlpkg/etc/multi-source-support.diff +++ b/Master/tlpkg/etc/multi-source-support.diff @@ -134,7 +134,7 @@ my $self = shift; if (@_) { $self->_set_option_value("opt_sys_bin", shift); } --- /src/TeX/texlive-svn/Master/texmf/scripts/texlive/tlmgr.pl 2008-09-08 17:19:03.000000000 +0200 -+++ texmf/scripts/texlive/tlmgr.pl 2008-09-09 13:08:45.000000000 +0200 ++++ texmf/scripts/texlive/tlmgr.pl 2008-09-10 15:54:25.000000000 +0200 @@ -48,15 +48,19 @@ # used variables @@ -158,7 +158,16 @@ # option handling my $opt_location; -@@ -414,15 +418,13 @@ +@@ -133,6 +137,8 @@ + merge_into(\%ret, action_install()); + } elsif ($action =~ m/^update$/i) { + merge_into(\%ret, action_update()); ++} elsif ($action =~ m/^candidates$/i) { ++ action_candidates(); + } elsif ($action =~ m/^backup$/i) { + merge_into(\%ret, action_backup()); + } elsif ($action =~ m/^restore$/i) { +@@ -414,15 +420,13 @@ } init_local_db(); foreach my $pkg (@ARGV) { @@ -177,7 +186,7 @@ } else { $installed = 1; } -@@ -432,6 +434,7 @@ +@@ -432,6 +436,7 @@ print "ShortDesc: ", $tlp->shortdesc, "\n" if ($tlp->shortdesc); print "LongDesc: ", $tlp->longdesc, "\n" if ($tlp->longdesc); print "Installed: ", ($installed?"Yes\n":"No\n"); @@ -185,7 +194,7 @@ print "\n"; } else { printf STDERR "Cannot find $pkg\n"; -@@ -448,17 +451,22 @@ +@@ -448,17 +453,22 @@ "file" => \$opt_file) or pod2usage(2); my $r = shift @ARGV; my $ret = ""; @@ -213,7 +222,7 @@ if (@ret) { print "$pkg:\n"; foreach (@ret) { -@@ -467,9 +475,9 @@ +@@ -467,9 +477,9 @@ } } else { next if ($pkg =~ m/\./); @@ -225,7 +234,7 @@ $lt |= ""; if (($pkg =~ m/$r/) || ($t =~ m/$r/) || ($lt =~ m/$r/)) { $ret .= " $pkg - $t\n"; -@@ -614,7 +622,6 @@ +@@ -614,7 +624,6 @@ "dry-run" => \$opt_dry) or pod2usage(2); my %ret; init_tlmedia(); @@ -233,7 +242,7 @@ my @todo; if ($opt_all || $opt_list) { @todo = $localtlpdb->list_packages; -@@ -625,19 +632,22 @@ +@@ -625,19 +634,22 @@ # we check for new packages # loop over all installed collections for my $c ($localtlpdb->collections) { @@ -268,7 +277,7 @@ } } } -@@ -655,18 +665,22 @@ +@@ -655,18 +667,22 @@ next; } my $rev = $tlp->revision; @@ -298,7 +307,7 @@ } else { # first remove the package, then reinstall it # this way we get rid of useless files -@@ -706,7 +720,7 @@ +@@ -706,7 +722,7 @@ # these packages cannot be upgrade on win32 # so we have to create a update program my $media = $tlmediasrc->media; @@ -307,7 +316,7 @@ my $root = $localtlpdb->root; my $temp = "$root/temp"; TeXLive::TLUtils::mkdirhier($temp); -@@ -740,8 +754,8 @@ +@@ -740,8 +756,8 @@ print "update: $pkg done\n"; } } @@ -318,7 +327,7 @@ next; } } -@@ -761,13 +775,23 @@ +@@ -761,17 +777,50 @@ ); tlwarn("UPDATER has been created, please execute tlpkg\\installer\\updater.bat\n"); } @@ -349,21 +358,75 @@ } return(\%ret); } -@@ -790,7 +814,12 @@ - print "install: $pkg\n"; - } else { - # install the packages and run postinstall actions (that is the 0) -- merge_into(\%ret, $tlmediasrc->install_package($pkg, $localtlpdb, $opt_nodepends, 0)); -+ my ($maxsrc) = install_candidate($pkg); -+ if (defined($maxsrc)) { -+ merge_into(\%ret, $tlmediasrc{$maxsrc}->install_package($pkg, $localtlpdb, $opt_nodepends, 0)); + ++sub action_candidates { ++ init_local_db(1); ++ init_tlmedia(); ++ foreach my $pkg (@ARGV) { ++ my @l = (); ++ for my $s (keys %tlmediasrc) { ++ my $tlp = $tlmediatlpdb{$s}->get_package($pkg); ++ if ($tlp) { ++ push @l, "$s (" . $tlp->revision . ")"; ++ } ++ } ++ if (@l) { ++ print "$pkg:\n"; ++ for my $f (@l) { ++ print "\t$f\n"; ++ } ++ } else { ++ print "No installation candidate for $pkg\ņ"; ++ } ++ } ++} ++ ++ + sub action_install { + if ($opt_gui) { + action_gui("install"); +@@ -786,11 +835,38 @@ + my %ret; + init_tlmedia(); + foreach my $pkg (@ARGV) { ++ my $package = $pkg; ++ my $tag; ++ my $maxsrc; ++ if ($pkg =~ m!^([^/]+)/(.*)$!) { ++ $package = "$1"; ++ $tag = "$2"; ++ if (defined($tlmediatlpdb{$tag})) { ++ if (defined($tlmediatlpdb{$tag}->get_package($package))) { ++ # we can actually install from there ++ $maxsrc = $tag; ++ } else { ++ tlwarn("Package $package not found in source $tag\n"); ++ tlwarn("Skipping installation of $pkg\n"); ++ next; ++ } + } else { ++ tlwarn("The tag $tag for installing $package is not defined!\n"); ++ tlwarn("Skipping installation of $pkg\n"); ++ next; ++ } ++ } else { ++ ($maxsrc) = install_candidate($pkg); ++ if (!defined($maxsrc)) { + tlwarn("No installation candidate for $pkg found!\n"); + } ++ } ++ + if ($opt_dry) { +- print "install: $pkg\n"; ++ print "install: $package (from $maxsrc)\n"; + } else { + # install the packages and run postinstall actions (that is the 0) +- merge_into(\%ret, $tlmediasrc->install_package($pkg, $localtlpdb, $opt_nodepends, 0)); ++ merge_into(\%ret, $tlmediasrc{$maxsrc}->install_package($package, $localtlpdb, $opt_nodepends, 0)); } } if ($opt_dry) { -@@ -805,13 +834,17 @@ +@@ -805,13 +881,17 @@ my $what = shift @ARGV; $what || ($what = ""); init_tlmedia(); @@ -385,7 +448,7 @@ } foreach (@whattolist) { if (defined($localtlpdb->get_package($_))) { -@@ -819,7 +852,7 @@ +@@ -819,7 +899,7 @@ } else { print " "; } @@ -394,7 +457,7 @@ print "$_: ", defined($foo) ? $foo : "(shortdesc missing)" , "\n"; } return; -@@ -833,17 +866,68 @@ +@@ -833,17 +913,68 @@ $what = "show" unless defined($what); init_local_db(); if ($what =~ m/^location$/i) { @@ -472,7 +535,7 @@ } elsif ($what =~ m/^docfiles$/i) { # changes the default docfiles my $loc = shift @ARGV; -@@ -903,10 +987,16 @@ +@@ -903,10 +1034,16 @@ # list the available architectures # initialize the TLMedia from $location init_tlmedia(); @@ -491,7 +554,7 @@ if (member($a,@already_installed_arch)) { print "(i) $a\n"; } else { -@@ -918,9 +1008,15 @@ +@@ -918,9 +1055,15 @@ exit(0); } elsif ($what =~ m/^add$/i) { init_tlmedia(); @@ -509,7 +572,7 @@ my @todoarchs; foreach my $a (@ARGV) { if (TeXLive::TLUtils::member($a, @already_installed_arch)) { -@@ -943,7 +1039,13 @@ +@@ -943,7 +1086,13 @@ if ($opt_dry) { print "Installing $pkg.$a\n"; } else { @@ -524,7 +587,7 @@ } } } -@@ -951,9 +1053,14 @@ +@@ -951,9 +1100,14 @@ } if (TeXLive::TLUtils::member('win32', @todoarchs)) { # install the necessary win32 stuff @@ -542,7 +605,7 @@ } # update the option_archs list of installed archs my @larchs = $localtlpdb->option_available_architectures; -@@ -1026,18 +1133,30 @@ +@@ -1026,18 +1180,30 @@ } } # let cmd line options override the settings in localtlpdb @@ -581,7 +644,7 @@ } sub action_gui { -@@ -1209,18 +1328,66 @@ +@@ -1209,18 +1375,66 @@ # initialize a tlmedia object and returns it, or dies # sub init_tlmedia { |