From 26fc6689f0b86c8bba55fa329c7ee308fb1c37d5 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 2 Jul 2009 05:11:36 +0000 Subject: tlmgr check executes: warn if a the location of the map files and its execute statement are in different packages git-svn-id: svn://tug.org/texlive/trunk@14063 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/texlive/tlmgr.pl | 44 +++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 15 deletions(-) (limited to 'Master/texmf') diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 2a1c09ce5c5..23368a4f323 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -2697,21 +2697,35 @@ sub check_executes { } my %badmaps; foreach my $mf (keys %maps) { - my @found = $localtlpdb->find_file($mf); - if ($#found < 0) { - $badmaps{$mf} = $maps{$mf}; - } - if ($#found > 0) { - # we want to check for multiple inclusions - my %mapfn; - foreach my $foo (@found) { - $foo =~ m/^(.*):(.*)$/; - push @{$mapfn{$2}}, $1; - } - foreach my $k (keys %mapfn) { - my @bla = @{$mapfn{$k}}; - if ($#bla > 0) { - warn "map file $mf occurs multiple times (in pkg @bla)!\n"; + my @pkgsfound = @{$maps{$mf}}; + if ($#pkgsfound > 0) { + tlwarn ("map file $mf is referenced in the executes of @pkgsfound\n"); + } else { + # less then 1 occurrences is not possible, so we have only one + # package that contains the reference to that map file + my $pkgfoundexecute = $pkgsfound[0]; + my @found = $localtlpdb->find_file($mf); + if ($#found < 0) { + $badmaps{$mf} = $maps{$mf}; + } elsif ($#found > 0) { + # we want to check for multiple inclusions + my %mapfn; + foreach my $foo (@found) { + $foo =~ m/^(.*):(.*)$/; + push @{$mapfn{$2}}, $1; + } + foreach my $k (keys %mapfn) { + my @bla = @{$mapfn{$k}}; + if ($#bla > 0) { + tlwarn ("map file $mf occurs multiple times (in pkg @bla)!\n"); + } + } + } else { + # only one occurrence found, we check that the map is also contained + # in the right package! + my ($pkgcontained) = ( $found[0] =~ m/^(.*):.*$/ ); + if ($pkgcontained ne $pkgfoundexecute) { + tlwarn("map file $mf: execute in $pkgfoundexecute, map file in $pkgcontained\n"); } } } -- cgit v1.2.3