summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-10-04 11:00:18 +0000
committerNorbert Preining <preining@logic.at>2009-10-04 11:00:18 +0000
commit00620f60f9a3194476cead0cca62a6c875aae89c (patch)
treec5941efef187646f62b6598b4811c30ea58d2d84 /Master
parentd869a95b0a7367022ddbaa6db9ae93651d812285 (diff)
reorder of things to be done in tlmgr: first auto-removal, then updates,
then auto-install git-svn-id: svn://tug.org/texlive/trunk@15636 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl137
1 files changed, 79 insertions, 58 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index 48cbe655f19..d7701332959 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -1965,6 +1965,19 @@ sub action_update {
# print deferred machine-readable lines after the header
for (@addlines) { print; }
+ #
+ # ORDER OF PACKAGE ACTIONS
+ # 1. removals
+ # 2. updates
+ # 3. auto-install
+ # that way if a file has been moved from one to another package it
+ # removing the old version after the new package has been installed
+ # will not give a warning about files being included somewhere else
+ #
+
+ #
+ # REMOVALS
+ #
for my $p (keys %removals) {
if ($opts{"no-auto-remove"}) {
info("not removing $p due to -no-auto-remove (removed on server)\n");
@@ -2011,65 +2024,10 @@ sub action_update {
my $donesize = 0;
my $totalsize = $sizes{'__TOTAL__'};
- # install all the new packages first
- my @new_packs;
- my @new_colls;
- my @new_schemes;
- for my $pkg (sort @new) {
- # we do name checking here, not to load all tlpobj again and again
- if ($pkg =~ m/^scheme-/) {
- push @new_schemes, $pkg;
- } elsif ($pkg =~ m/^collection-/) {
- push @new_colls, $pkg;
- } else {
- push @new_packs, $pkg;
- }
- }
- @new_packs = sort packagecmp @new_packs;
- for my $pkg (@new_packs, @new_colls, @new_schemes) {
- if ($opts{"no-auto-install"}) {
- info("not auto-installing $pkg due to -no-auto-install (new on server)\n")
- unless $::machinereadable;
- } else {
- # install new packages
- my $mediatlp = $tlmediatlpdb->get_package($pkg);
- if (!defined($mediatlp)) {
- tlwarn("\nShould not happen: $pkg not found in $location");
- next;
- }
- my $mediarev = $mediatlp->revision;
- my ($estrem, $esttot);
- if (!$opts{"list"}) {
- ($estrem, $esttot) = TeXLive::TLUtils::time_estimate($totalsize,
- $donesize, $starttime);
- }
- if ($::machinereadable) {
- my @maargs = ($pkg, $FLAG_AUTOINSTALL, "-", $mediatlp->revision, $sizes{$pkg});
- if (!$opts{"list"}) {
- push @maargs, $estrem, $esttot;
- }
- machine_line(@maargs);
- } else {
- my $kb = int($sizes{$pkg} / 1024) + 1;
- if ($opts{"list"}) {
- info("$pkg [${kb}k]: local: <absent>, source: " . $mediatlp->revision . " (auto-install)\n");
- } else {
- info("[$currnr/$totalnr, $estrem/$esttot] auto-install: $pkg [${kb}k]\n");
- }
- }
- $currnr++;
- $donesize += $sizes{$pkg};
- next if ($opts{"dry-run"} || $opts{"list"});
- if ($tlmediasrc->install_package($pkg, $localtlpdb)) {
- # installation succeeded because we got a reference
- logpackage("auto-install new: $pkg ($mediarev)");
- $nrupdated++;
- } else {
- tlwarn("$0: couldn't install new package $pkg\n");
- }
- }
- }
+ #
+ # UPDATES
+ #
#
# update order of packages:
# first all normal packages, then collections, then schemes
@@ -2230,6 +2188,69 @@ sub action_update {
info("done\n") unless $::machinereadable;
}
+
+ #
+ # NEW PACKAGES
+ #
+ my @new_packs;
+ my @new_colls;
+ my @new_schemes;
+ for my $pkg (sort @new) {
+ # we do name checking here, not to load all tlpobj again and again
+ if ($pkg =~ m/^scheme-/) {
+ push @new_schemes, $pkg;
+ } elsif ($pkg =~ m/^collection-/) {
+ push @new_colls, $pkg;
+ } else {
+ push @new_packs, $pkg;
+ }
+ }
+ @new_packs = sort packagecmp @new_packs;
+ for my $pkg (@new_packs, @new_colls, @new_schemes) {
+ if ($opts{"no-auto-install"}) {
+ info("not auto-installing $pkg due to -no-auto-install (new on server)\n")
+ unless $::machinereadable;
+ } else {
+ # install new packages
+ my $mediatlp = $tlmediatlpdb->get_package($pkg);
+ if (!defined($mediatlp)) {
+ tlwarn("\nShould not happen: $pkg not found in $location");
+ next;
+ }
+ my $mediarev = $mediatlp->revision;
+ my ($estrem, $esttot);
+ if (!$opts{"list"}) {
+ ($estrem, $esttot) = TeXLive::TLUtils::time_estimate($totalsize,
+ $donesize, $starttime);
+ }
+ if ($::machinereadable) {
+ my @maargs = ($pkg, $FLAG_AUTOINSTALL, "-", $mediatlp->revision, $sizes{$pkg});
+ if (!$opts{"list"}) {
+ push @maargs, $estrem, $esttot;
+ }
+ machine_line(@maargs);
+ } else {
+ my $kb = int($sizes{$pkg} / 1024) + 1;
+ if ($opts{"list"}) {
+ info("$pkg [${kb}k]: local: <absent>, source: " . $mediatlp->revision . " (auto-install)\n");
+ } else {
+ info("[$currnr/$totalnr, $estrem/$esttot] auto-install: $pkg [${kb}k]\n");
+ }
+ }
+ $currnr++;
+ $donesize += $sizes{$pkg};
+ next if ($opts{"dry-run"} || $opts{"list"});
+ if ($tlmediasrc->install_package($pkg, $localtlpdb)) {
+ # installation succeeded because we got a reference
+ logpackage("auto-install new: $pkg ($mediarev)");
+ $nrupdated++;
+ } else {
+ tlwarn("$0: couldn't install new package $pkg\n");
+ }
+ }
+ }
+
+
print "end-of-updates\n" if $::machinereadable;
#