diff options
author | Norbert Preining <preining@logic.at> | 2008-09-17 23:44:23 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-09-17 23:44:23 +0000 |
commit | cde0219a9250f225a5d36651f2a4b189c37a4754 (patch) | |
tree | d7396cebf7c9d9fc3a73ee02b1b62fc2ed31f429 /Master | |
parent | 19013ab96b71cb402d3386025c84af2c2fe3d903 (diff) |
make
tlmgr check --use-svn files
do the same (or even more) then check-file-coverage. But currently that does
not work in Win32 (missing find for TLMedia->init_from_file), nor MacOS
(find does not support -wholename).
git-svn-id: svn://tug.org/texlive/trunk@10625 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr.pl | 121 |
1 files changed, 108 insertions, 13 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 599cc5eafd7..f4184d2387c 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -1234,17 +1234,20 @@ sub action_uninstall { sub action_check { + my $svn = 0; + Getopt::Long::Configure(qw(no_pass_through)); + GetOptions("use-svn" => \$svn) or pod2usage(2); my $what = shift @ARGV; $what || ($what = "all"); init_local_db(); my $ret = 0; if ($what =~ m/^all/i) { - $ret ||= check_file(); - $ret ||= check_collections(); + $ret ||= check_files($svn); + $ret ||= check_collections($svn); } elsif ($what =~ m/^files/i) { - $ret ||= check_file(); + $ret ||= check_files($svn); } elsif ($what =~ m/^collections/i) { - $ret ||= check_collections(); + $ret ||= check_collections($svn); } else { print "No idea how to check that: $what\n"; } @@ -1254,22 +1257,100 @@ sub action_check { # # check file coverage, roughly equivalent to tlpkg/bin/check-file-coverage # -sub check_file { - my @missing = (); +sub check_files { + my $svn = shift; + my $ret = 0; + my %filetopacks; my $Master = $localtlpdb->root; for my $p ($localtlpdb->list_packages()) { my $tlp = $localtlpdb->get_package($p); for my $f ($tlp->all_files) { - push @missing, "$f ($p)" if (! -r "$Master/$f"); + push @{$filetopacks{$f}}, $p; } } - return(0) if (!@missing); - print "Missing files (relative to $Master):\n"; - for my $m (@missing) { - print "\t$m\n"; + my @multiple = (); + my @missing = (); + for (keys %filetopacks) { + push @missing, $_ if (! -r "$Master/$_"); + my @foo = @{$filetopacks{$_}}; + if ($#foo < 0) { + warn "that shouldn't happen: $_\n"; + } elsif ($#foo > 0) { + push @multiple, $_; + } } - print "\n"; + if ($#multiple >= 0) { + $ret = 1; + print "Multiple included files (relative to $Master):\n"; + for (sort @multiple) { + my @foo = @{$filetopacks{$_}}; + print " $_ (@foo)\n"; + } + print "\n"; + } + if ($#missing >= 0) { + $ret = 1; + print "Files mentioned in tlpdb but missing (relative to $Master):\n"; + for my $m (@missing) { + print "\t$m\n"; + } + print "\n"; + } + # + # do check that all files in the trees are covered + # + my @IgnorePatterns = qw! + .mkisofsrc$ autorun.inf$ + support/ source/ setuptl/ + texmf-dist/ls-R$ texmf-doc/ls-R$ texmf/ls-R$ + tlpkg/tlpsrc/ + tlpkg/bin + tlpkg/lib/ tlpkg/tests/ tlpkg/etc/ + tlpkg/texlive.tlpdb + tlpkg/tlpobj + texmf-var/ + texmf-config/ + texmf.cnf + install-tl.log + tlpkg/texlive.profile + !; + + my $tltree = TeXLive::TLTREE->new ("svnroot" => $Master); + if ($svn) { + $tltree->init_from_svn; + } else { + $tltree->init_from_files; + } + my %tltreefiles = %{$tltree->{'_allfiles'}}; + my @tlpdbfiles = keys %filetopacks; + my @nohit; + for my $f (keys %tltreefiles) { + # if it is mentioned in the tlpdb or is ignored it is considered + # as covered, thus, otherwise we push it onto the nothit list + if (!defined($filetopacks{$f})) { + my $ignored = 0; + for my $p (@IgnorePatterns) { + if ($f =~ m/^$p/) { + $ignored = 1; + last; + } + } + if (!$ignored) { + push @nohit, $f; + } + } + } + if (@nohit) { + $ret = 1; + print "Files present but not covered (relative to $Master):\n"; + for my $f (sort @nohit) { + print " $f\n"; + } + print "\n"; + } + return($ret); } + # # check collections # @@ -1676,7 +1757,7 @@ location, prefixing those already installed with C<i >. With an argument lists only collections or schemes, as requested. -=item B<check [files|collections|all]> +=item B<check [I<option>...] [files|collections|all]> Executes one (or all) check(s) on the consistency of the installation. @@ -1687,6 +1768,10 @@ Executes one (or all) check(s) on the consistency of the installation. Checks that all files listed in the TeX Live Database (texlive.tlpdb) are actually present, and lists those missing. +Note that on Windows that will not work currently, since Windows does not +ship find. Also MacOS seems to ship a strange find implementation that does +not support -wholename, so that will break, too. + =item B<collections> Lists those packages which occur as dependencies in an installed collections, @@ -1694,6 +1779,16 @@ but are themselves not installed. =back +Available options are: + +=over 4 + +=item B<-use-svn> + +Use svn status instead of listing the files. + +=back + =item B<uninstall> Uninstalls the entire TeX Live installation. Options: |