From ea341a12e816631bdc6442ab40ec46c50ec368ed Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 9 Jan 2008 09:24:45 +0000 Subject: check-file-coverage now reports the packages in which a file is included in case of double inclusions and it ignores the files in 00texlive.installer git-svn-id: svn://tug.org/texlive/trunk@6161 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/bin/check-file-coverage | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'Master/tlpkg/bin/check-file-coverage') diff --git a/Master/tlpkg/bin/check-file-coverage b/Master/tlpkg/bin/check-file-coverage index 0a38186078f..873a5fe2315 100755 --- a/Master/tlpkg/bin/check-file-coverage +++ b/Master/tlpkg/bin/check-file-coverage @@ -55,9 +55,38 @@ sub main die "$0: Master $opt_master not a directory, goodbye.\n"; } - # first we check for multiple included files using simple shell magic + # checking for duplicates + my $pack = ""; + open (TLPDB,"<$opt_master/tlpkg/texlive.tlpdb") + or die "Cannot open $opt_master/tlpkg/texlive.tlpdb for reading: $!\n"; + my %filetopacks; + while () { + # ignore files mentioned in 00texlive.installer + next if ($pack eq "00texlive.installer"); + next if m/^\s*#/; + next if m/^\s*$/; + next if m/^((bin|run|doc|src)files|depend|execute|category|revision|shortdesc|longdesc|catalogue)/; + if (m/^name\s+(\S+)\s*$/) { + $pack = "$1"; + next; + } + if (m/^ ([^\s]+)\s+/) { + push @{$filetopacks{$1}}, $pack; + next; + } + print "NOT HANDLED $_"; + } print "Multiple included files:\n"; - print `grep '^ ' $opt_master/tlpkg/texlive.tlpdb | awk '{print"\t"\$1}' | sort | uniq -d`; + foreach (keys %filetopacks) { + my @foo = @{$filetopacks{$_}}; + if ($#foo < 0) { + warn "that shouldn't happen: $_\n"; + } elsif ($#foo > 0) { + print " $_ (@foo)\n"; + } + } + # first we check for multiple included files using simple shell magic + #print `grep '^ ' $opt_master/tlpkg/texlive.tlpdb | awk '{print"\t"\$1}' | sort | uniq -d`; warn "$0: reading Master tree $opt_master, that takes some time ...\n"; my $tltree = TeXLive::TLTREE->new( "svnroot" => $opt_master ); -- cgit v1.2.3