summaryrefslogtreecommitdiff
path: root/Master/texmf/scripts
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2010-03-12 17:53:24 +0000
committerNorbert Preining <preining@logic.at>2010-03-12 17:53:24 +0000
commitedb543fd68f53404a38825694f9d54535feb7b50 (patch)
tree258d1655fc06e08ce19d782f526a569212a9f7a1 /Master/texmf/scripts
parent354c0864a5566b532eba4b6c12244e22d2f9078f (diff)
tlmgr: do not warn if during an upgrade a file is moved from one to another
package git-svn-id: svn://tug.org/texlive/trunk@17443 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf/scripts')
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl50
1 files changed, 49 insertions, 1 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index f0daffa7810..36d71c8de7f 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -1994,6 +1994,53 @@ sub action_update {
for (@addlines) { print; }
#
+ # compute the list of moved files from %removals, @new, @updated
+ #
+ my %do_warn_on_move;
+ {
+ # keep all these vars local to this block
+ my @removals = keys %removals;
+ my %old_files_to_pkgs;
+ my %new_files_to_pkgs;
+ # first save for each file in the currently installed packages
+ # to be updated the packages it is contained it (might be more!)
+ #
+ for my $p (@updated, @removals) {
+ my $pkg = $localtlpdb->get_package($p);
+ tlwarn("Should not happen: $p not found in local tlpdb\n") if (!$pkg);
+ next;
+ for my $f ($pkg->all_files) {
+ push @{$old_files_to_pkgs{$f}}, $p;
+ }
+ }
+ for my $p (@updated, @new) {
+ my $pkg = $tlmediatlpdb->get_package($p);
+ tlwarn("Should not happen: $p not found in $location\n") if (!$pkg);
+ next;
+ for my $f ($pkg->all_files) {
+ if ($pkg->relocated) {
+ $f =~ s:^$RelocPrefix/:$RelocTree/:;
+ }
+ push @{$new_files_to_pkgs{$f}}, $p;
+ }
+ }
+ #
+ # the idea of supressing warnings is simply that if a file is present
+ # in more than one package either in the beginning or after a full
+ # update then this should give a warning. In all other cases
+ # the warning should be supressed.
+ for my $f (keys %old_files_to_pkgs) {
+ my @a = @{$old_files_to_pkgs{$f}};
+ $do_warn_on_move{$f} = 1 if ($#a > 0)
+ }
+ for my $f (keys %new_files_to_pkgs) {
+ my @a = @{$new_files_to_pkgs{$f}};
+ $do_warn_on_move{$f} = 1 if ($#a > 0)
+ }
+ }
+
+
+ #
# ORDER OF PACKAGE ACTIONS
# 1. removals
# 2. updates
@@ -2220,7 +2267,8 @@ sub action_update {
if ($pkg =~ m/$CriticalPackagesRegexp/) {
debug("Not removing critical package $pkg\n");
} else {
- $localtlmedia->remove_package($pkg);
+ $localtlmedia->remove_package($pkg,
+ "remove-warn-files" => \%do_warn_on_move);
}
if ($tlmediasrc->install_package($pkg, $localtlpdb)) {
# installation succeeded because we got a reference