summaryrefslogtreecommitdiff
path: root/Master/texmf/scripts
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-11-11 10:12:12 +0000
committerNorbert Preining <preining@logic.at>2008-11-11 10:12:12 +0000
commit627d74b280414eea3986af8b6a1ad28db014c9ae (patch)
tree7b35c9dff77b6c713201c704dc5c6df3ed76b411 /Master/texmf/scripts
parentf7a2016d401dffcec0bb70e84e06c19b75e88ab4 (diff)
include new new/remove/forcedremoved logic as dicussed on ML
git-svn-id: svn://tug.org/texlive/trunk@11256 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf/scripts')
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl113
1 files changed, 41 insertions, 72 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index 39977f5883d..ef2e669b65f 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -1115,50 +1115,51 @@ sub action_update {
my @todo;
my %removals;
+ my %forcermpkgs;
+ my %newpkgs;
+ # check for new/removed/forcibly removed packages.
+ # we start from the list of installed collections in the local tlpdb
+ # and expand this list once with expand_dependencies in the local tlpdb
+ # and once in the tlmedia tlpdb. Then we compare the lists
+ # let A = set of local expansions
+ # B = set of remote expansions
+ # then we should(?) have
+ # B \ A set of new packages
+ # A \ B set of packages removed on the server
+ # A \cup B set of packages which should be checked for forcible removal
+ my @localexpansion =
+ $localtlpdb->expand_dependencies($localtlpdb, $localtlpdb->collections);
+ my @remoteexpansion =
+ $mediatlpdb->expand_dependencies($localtlpdb, $localtlpdb->collections);
+ for my $p (@remoteexpansion) {
+ $newpkgs{$p} = 1;
+ }
+ for my $p (@localexpansion) {
+ delete($newpkgs{$p});
+ $removals{$p} = 1;
+ }
+ for my $p (@remoteexpansion) {
+ delete($removals{$p});
+ }
+ for my $p (@localexpansion) {
+ # intersection, don't check A\B and B\A
+ next if $newpkgs{$p};
+ next if $removals{$p};
+ my $tlp = $localtlpdb->get_package($p);
+ if (!defined($tlp)) {
+ $forcermpkgs{$p} = 1;
+ }
+ }
+ debug ("tlmgr: newpkg: " . join("\n\t",keys %newpkgs) . "\n");
+ debug ("tlmgr: rempkg: " . join("\n\t",keys %removals) . "\n");
+ debug ("tlmgr: forpkg: " . join("\n\t",keys %forcermpkgs) . "\n");
+
if ($opt_all || $opt_list) {
@todo = $localtlpdb->list_packages;
- # we check for deleted packages by checking:
- # . the package is referenced by collection of the local tlpdb
- # . the package is present in the local tlpdb
- # . the collection is present in the remote tlpdb
- # . the package is not referenced any more in the remote tlpdb
- # That is done as follows:
- # . collect all the dependencies of the LOCAL collection in a hash
- # . delete all hash entries for dependencies occuring on the local
- for my $c ($localtlpdb->collections) {
- my $tlc = $localtlpdb->get_package($c);
- die "should not happen, pkg $c listed but not found" if !defined($tlc);
- my $tlcremote = $mediatlpdb->get_package($c);
- if (!defined($tlcremote)) {
- debug("Collection $c is not present on the server!\n");
- } else {
- for my $d ($tlc->depends) {
- $removals{$d} = $c;
- }
- for my $d ($tlcremote->depends) {
- delete($removals{$d});
- }
- }
- }
- # make an additional round over all collections on the remote server
- # in case a package has been moved between collections
- for my $c ($mediatlpdb->collections) {
- my $tlc = $mediatlpdb->get_package($c);
- die "should not happen, $c listed but not found" if !defined($tlc);
- for my $d ($tlc->depends) {
- # those package are referenced, so do not remove them
- delete($removals{$d});
- }
- }
- for my $d (keys %removals) {
- info("$d ($removals{$d}): removed package\n");
- }
} else {
@todo = @ARGV;
}
- my %forcermpkgs;
- my %newpkgs;
#
# we have to remove all the stuff before we install other packages
# to support moving of files from one package to another.
@@ -1175,38 +1176,6 @@ sub action_update {
}
}
- # check for new packages.
- # loop over all installed collections:
- for my $c ($localtlpdb->collections) {
- my $localtlc = $localtlpdb->get_package($c);
- if (!defined($localtlc)) {
- tlwarn("\nShould not happen, no localtlc for $c\n");
- next;
- }
- my @localtlcdeps = $localtlc->depends;
- my $tlc = $mediatlpdb->get_package($c);
- if (!defined($tlc)) {
- debug("collection $c has disappeared from the network!\n");
- } else {
- # take all the dependencies of the installed collection
- # as found in the network tlpdb
- for my $d ($tlc->depends) {
- my $tlp = $localtlpdb->get_package($d);
- if (!defined($tlp)) {
- # here we have two cases:
- # 1) the packages is already mentioned in the local tlpdb, in this
- # case it was forcibly removed and we do not reinstall it;
- # 2) it is not mentioned, then it is really a new package and will
- # be auto installed.
- if (grep(/^$d$/, @localtlcdeps)) {
- $forcermpkgs{$d} = $c;
- } else {
- $newpkgs{$d} = $c;
- }
- }
- }
- }
- }
if (!@todo) {
tlwarn("tlmgr update: please specify a list of packages or --all.\n");
}
@@ -1234,7 +1203,7 @@ sub action_update {
# will be in the dependency expansion, and we want it.
my $newpkg_coll = $newpkgs{$pkg} || $newpkgs{$pkg_noarch};
if ($forcerm_coll) {
- info("skipping forcibly removed package $pkg ($forcerm_coll)\n");
+ info("skipping forcibly removed package $pkg\n");
next;
} elsif ($newpkg_coll) {
# do nothing here, it will be reported below.
@@ -1252,7 +1221,7 @@ sub action_update {
next;
}
my $mediarev = $mediatlp->revision;
- info("auto-install: $pkg ($newpkg_coll)\n");
+ info("auto-install: $pkg\n");
next if ($opt_dry || $opt_list);
my $foo = $tlmediasrc->install_package($pkg, $localtlpdb);
if (ref $foo) {