diff options
author | Karl Berry <karl@freefriends.org> | 2009-06-24 01:00:51 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-06-24 01:00:51 +0000 |
commit | 574a5480b543c3d5a0f3735e75b2fe81d751fa0e (patch) | |
tree | b6e320c811144922027622e6fec874367c0c500f /Master/tlpkg | |
parent | 3b4b10daeae8fca82fc30e9183ed53a3cc73e822 (diff) |
remove scripts merged into tlmgr
git-svn-id: svn://tug.org/texlive/trunk@13928 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rwxr-xr-x | Master/tlpkg/bin/check-depend-consistency | 134 | ||||
-rwxr-xr-x | Master/tlpkg/bin/check-duplicated-runfiles | 87 | ||||
-rwxr-xr-x | Master/tlpkg/bin/check-execute-consistency | 245 |
3 files changed, 0 insertions, 466 deletions
diff --git a/Master/tlpkg/bin/check-depend-consistency b/Master/tlpkg/bin/check-depend-consistency deleted file mode 100755 index 0c75e4ef5bd..00000000000 --- a/Master/tlpkg/bin/check-depend-consistency +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env perl -# $Id$ -# Copyright 2007, 2008, 2009 Norbert Preining -# This file is licensed under the GNU General Public License version 2 -# or any later version. -# -# Check that all packages are contained in at least one collection, and -# that all depend statements refer to an existing package. - -BEGIN { - $^W = 1; - ($mydir = $0) =~ s,/[^/]*$,,; - unshift (@INC, "$mydir/.."); -} - -our $mydir; - -use strict; -use Getopt::Long; -use Pod::Usage; -use File::Path; - -use TeXLive::TLConfig; -use TeXLive::TLUtils; -use TeXLive::TLPOBJ; -use TeXLive::TLPDB; - -my $help = 0; - -TeXLive::TLUtils::process_logging_options(); -GetOptions("help|?" => \$help) or pod2usage(1); -pod2usage("-exitstatus" => 0, "-verbose" => 2) if $help; - -exit (&main ()); - - -sub main -{ - my $ret = 0; - - # get the db. - chomp (my $Master = `cd $mydir/../.. && pwd`); - my $tlpdb = TeXLive::TLPDB->new("root" => $Master); - die "$0: Cannot find tlpdb in $Master.\n" unless defined($tlpdb); - - my %presentpkg; - for my $pkg ($tlpdb->list_packages) { - $presentpkg{$pkg} = 1; - } - - # list of collections. - my @colls = $tlpdb->collections; - my @coll_deps = $tlpdb->expand_dependencies("-no-collections",$tlpdb,@colls); - my %coll_deps; - @coll_deps{@coll_deps} = (); # initialize hash with keys from list - - my (%wrong_dep, @no_dep); - for my $pkg ($tlpdb->list_packages) { - # do not check any package starting with 00texlive. - next if $pkg =~ m/^00texlive/; - - # For each package, check that it is a dependency of some collection. - # Whatever is left in %coll_deps after this loop will be the problem - if (! exists $coll_deps{$pkg}) { - # Except that schemes and our special .win32 packages are ok. - push (@no_dep, $pkg) unless $pkg =~/^scheme-|\.win32$/; - } - - # For each dependency, check that we have a package. - for my $d ($tlpdb->get_package($pkg)->depends) { - next if ($d =~ m/\.ARCH$/); - if (!defined($presentpkg{$d})) { - push (@{$wrong_dep{$d}}, $pkg); - } - } - } - - if (keys %wrong_dep) { - $ret++; - print "DEPENDS WITHOUT PACKAGES:\n"; - for my $d (keys %wrong_dep) { - print "$d occurring in ", @{$wrong_dep{$d}}, "\n"; - } - } - - if (@no_dep) { - $ret++; - print "PACKAGES NOT IN ANY COLLECTION: @no_dep\n"; - } - - return $ret; -} - -__END__ - -=head1 NAME - -check-depend-consistency - check that all dependencies exist as packages - -=head1 SYNOPSIS - -check-depend-consistency [OPTION]... - -=head1 OPTIONS - -Only the standard options B<-help> and B<-q>, B<-v>, and -B<-logfile>=I<file> are accepted; see the C<process_logging_options> -function in L<TeXLive::TLUtils> for details. - -=head1 DESCRIPTION - -Check that all C<depend> statements in all TeX Live packages -(collections, schemes, and normal packages) refer to existing packages. - -Also check that every package is a dependency of at least one collection. - -These checks are made according to the tlpdb that is within the -hierarchy from which this script is invoked; the actual file tree is not -inspected. - -=head1 AUTHORS AND COPYRIGHT - -This script and its documentation were written for the TeX Live -distribution (L<http://tug.org/texlive>) and both are licensed under the -GNU General Public License Version 2 or later. - -=cut - -### Local Variables: -### perl-indent-level: 2 -### tab-width: 2 -### indent-tabs-mode: nil -### End: -# vim:set tabstop=2 expandtab: # diff --git a/Master/tlpkg/bin/check-duplicated-runfiles b/Master/tlpkg/bin/check-duplicated-runfiles deleted file mode 100755 index b3386aff32c..00000000000 --- a/Master/tlpkg/bin/check-duplicated-runfiles +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env perl -# $Id$ -# Copyright 2008, 2009 Manuel Pegourie-Gonnard. -# This file is licenced under the WTFPL version 2. -# -# Check there are no duplicated runtimes files. - -BEGIN { - $^W = 1; - ($mydir = $0) =~ s,/[^/]*$,,; - unshift (@INC, "$mydir/.."); -} - -use TeXLive::TLConfig qw/$RelocPrefix $RelocTree/; -use TeXLive::TLPOBJ; -use TeXLive::TLPDB; - -use File::Basename; - -# first, get and load the current texlive.tlpdb -# -chomp (my $Master = `cd $mydir/../.. && pwd`); -$tlpdb = TeXLive::TLPDB->new ("root" => "$Master"); -die("Cannot find tlpdb in $Master!\n") unless defined($tlpdb); - -# build a list of all runtime files associated to 'normal' packages -# -(my $non_normal = `ls $Master/bin`) =~ s/\n/\$|/g; # binaries -$non_normal .= '^0+texlive|^bin-|^collection-|^scheme-|^texlive-'; -my @runtime_files = (); -foreach my $tlpn ($tlpdb->list_packages) { - next if ($tlpn =~ /$non_normal/); - my $tlp = $tlpdb->get_package($tlpn); - my @files = $tlp->runfiles; - if ($tlp->relocated) { for (@files) { s:^$RelocPrefix/:$RelocTree/:; } } - push @runtime_files, @files; -} - -# build the duplicates list -# -my @duplicates = (""); # just to use $duplicates[-1] freely -my $prev = ""; -foreach my $f (sort map { basename($_) } @runtime_files) { - push (@duplicates, $f) if (($f eq $prev) and not ($f eq $duplicates[-1])); - $prev = $f; -} -shift @duplicates; # get rid of the fake 1st value - -# @duplicates = ('8r-base.map', 'aer.sty', 'lm-ec.map'); #Â for debugging - -# check if duplicates are different files -# -foreach my $f (@duplicates) { - #Â assume tex4ht stuff is ok, and don't worry about Changes/README for now - next if ($f =~ /(^Changes$|^README$|\.htf$|\.4hf$)/); - # - my @copies = grep (/\/$f$/, @runtime_files); - # map files can be duplicated as long as copies don't concern the same engine - if ($f =~ /\.map$/) { - my $need_check = 0; - my $prev_dir = ""; - my @cop = @copies; # don't break the outside list - map { s#^texmf-dist/fonts/map/(.*?)/.*#$1# } @cop; - foreach my $dir (sort @cop ) { - last if ($need_check = ($dir eq $prev_dir)); - $prev_dir = $dir; - } - next unless $need_check; - } - # if all copies are identical, ok, else, complain - my $diff = 0; - for (my $i = 1; $i < scalar(@copies); $i++) { - if ($diff = system ("diff -q --strip-trailing-cr " - . "$Master/$copies[$i-1] $Master/$copies[$i] >/dev/null")) { - print "# $f\ndiff $Master/$copies[$i-1] $Master/$copies[$i]\n"; - last; - } - } - print join ("\n", @copies), "\n" if ($diff and (scalar(@copies) > 2)); -} - -### Local Variables: -### perl-indent-level: 2 -### tab-width: 2 -### indent-tabs-mode: nil -### End -# vim: set tabstop=2 shiftwidth=2 expandtab: diff --git a/Master/tlpkg/bin/check-execute-consistency b/Master/tlpkg/bin/check-execute-consistency deleted file mode 100755 index 6dc3b048033..00000000000 --- a/Master/tlpkg/bin/check-execute-consistency +++ /dev/null @@ -1,245 +0,0 @@ -#!/usr/bin/env perl -# $Id$ -# Copyright 2007, 2009 Norbert Preining -# This file is licensed under the GNU General Public License version 2 -# or any later version. -# -# Check that files needed for execute statements in tlpsrc files are present. - -BEGIN { - $^W = 1; - ($mydir = $0) =~ s,/[^/]*$,,; - unshift (@INC, "$mydir/.."); -} - -our $mydir; - -use strict; - -use TeXLive::TLConfig; -use TeXLive::TLUtils; -use TeXLive::TLPOBJ; -use TeXLive::TLPDB; -use Getopt::Long; -use Pod::Usage; -use File::Path; - -my $help = 0; - -process_logging_options(); - -GetOptions("help|?" => \$help) or pod2usage(1); -pod2usage(-exitstatus => 0, -verbose => 2) if $help; - -exit (&main ()); - -sub main -{ - # get the db. - chomp (my $Master = `cd $mydir/../.. && pwd`); - my $tlpdb = TeXLive::TLPDB->new ("root" => "$Master"); - die("Cannot find tlpdb in $Master!\n") unless defined($tlpdb); - my (%maps,%langcodes,%fmtlines); - for my $pkg ($tlpdb->list_packages) { - for my $e ($tlpdb->get_package($pkg)->executes) { - if ($e =~ m/add(Mixed)?Map\s+(.*)$/) { - my $foo = $2; - chomp($foo); - push @{$maps{$foo}}, $pkg; - } elsif ($e =~ m/AddFormat\s+(.*)$/) { - my $foo = $1; - chomp($foo); - push @{$fmtlines{$foo}}, $pkg; - } elsif ($e =~ m/AddHyphen\s+.*\s+file=(\S+)\s*$/) { - my $foo = $1; - chomp($foo); - push @{$langcodes{$foo}}, $pkg; - } else { - warn "$pkg: unmatched execute: $e\n"; - } - } - } - my %badmaps; - foreach my $mf (keys %maps) { - my @found = $tlpdb->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"; - } - } - } - } - if (keys %badmaps) { - print "mentioned map file not occuring in any package:\n"; - foreach my $mf (keys %badmaps) { - print "\t$mf (execute in @{$badmaps{$mf}})\n"; - } - } - my %badhyphcodes; - my %problemhyphen; - foreach my $lc (keys %langcodes) { - next if ($lc eq "zerohyph.tex"); - my @found = $tlpdb->find_file("texmf-dist/tex/generic/hyph-utf8/loadhyph/$lc"); - if ($#found < 0) { - # try again this time search all packages - my @found = $tlpdb->find_file("$lc"); - if ($#found < 0) { - $badhyphcodes{$lc} = $langcodes{$lc}; - } else { - $problemhyphen{$lc} = [ @found ]; - } - } - } - if (keys %badhyphcodes) { - print "mentioned hyphen loaders without file:\n"; - foreach my $mf (keys %badhyphcodes) { - print "\t$mf (execute in @{$badhyphcodes{$mf}})\n"; - } - } - # disable the echoing of problematic hyphens - #if (keys %problemhyphen) { - # print "hyphen files with possible problematic location:\n"; - # foreach my $mf (keys %problemhyphen) { - # print "\t$mf (@{$problemhyphen{$mf}})\n"; - # } - #} - # - # what should be checked for the executes? we could check - # - the existence of the engine in bin/i386-linux or all $arch - # - the existence of the format name link/bat - # - parse the options parameter and check for the inifile - # - rework the format definition that we have inifile=pdflatex.ini - # isn't the * unnecessary? - my %missingbins; - my %missingengines; - my %missinginis; - for (keys %fmtlines) { - my %r = TeXLive::TLUtils::parse_AddFormat_line("$_"); - if (defined($r{"error"})) { - die "$r{'error'}, parsing $_, package(s) @{$fmtlines{$_}}"; - } - my $opt = $r{"options"}; - my $engine = $r{"engine"}; - my $name = $r{"name"}; - my $mode = $r{"mode"}; - # special case for cont-en ... - next if ($name eq "cont-en"); - # we check that the name exist in bin/$arch - for my $a ($tlpdb->available_architectures) { - my $f = "$Master/bin/$a/$name"; - if (!check_file($a, $f)) { - if ($a eq "i386-cygwin") { - # on cygwin the following can happen: xmltex -> pdftex, but - # there is only pdftex.exe, so -r does not succeed - if (-l $f) { - my $ld = readlink ($f); - if (!check_file($a, "$Master/bin/$a/$ld")) { - push @{$missingbins{$_}}, "bin/$a/$name" if $mode; - } - } else { - push @{$missingbins{$_}}, "bin/$a/$name" if $mode; - } - } else { - push @{$missingbins{$_}}, "bin/$a/$name" if $mode; - } - } - if (!check_file($a, "$Master/bin/$a/$engine")) { - push @{$missingengines{$_}}, "bin/$a/$engine" if $mode; - } - } - # check for the existence of the .ini file - # by using the last word in the options value - my $inifile = $opt; - # $inifile now contains "bla bla bla *file.ini" - # strip initial and trailing " - $inifile =~ s/^"(.*)"$/$1/; - # remove everything before the last space - $inifile =~ s/^.* ([^ ]*)$/$1/; - # remove the optional leading * - $inifile =~ s/^\*//; - my @found = $tlpdb->find_file("$inifile"); - if ($#found < 0) { - $missinginis{$_} = "$inifile"; - } - } - if (keys %missinginis) { - print "mentioned ini files that cannot be found:\n"; - for my $i (keys %missinginis) { - print "\t $missinginis{$i} (execute: $i)\n"; - } - } - if (keys %missingengines) { - print "mentioned engine files that cannot be found:\n"; - for my $i (keys %missingengines) { - print "\t @{$missingengines{$i}}\n"; - } - } - if (keys %missingbins) { - print "mentioned bin files that cannot be found:\n"; - for my $i (keys %missingbins) { - print "\t @{$missingbins{$i}}\n"; - } - } -} - -sub check_file { - my ($a, $f) = @_; - if (-r $f) { - return 1; - } else { - # not -r, so check for the extensions .bat and .exe on w32 and cygwin - if (($a eq "win32") || ($a eq "i386-cygwin")) { - if (-r "$f.exe" || -r "$f.bat") { - return 1; - } - } - return 0; - } -} - -__END__ - -=head1 NAME - -check-execute-consistency - check tlpdb execute directives - -=head1 SYNOPSIS - -check-execute-consistency - -=head1 OPTIONS - -Only the standard options B<-help> and B<-q>, B<-v>, and -B<-logfile>=I<file> are accepted; see the C<process_logging_options> -function in L<TeXLive::TLUtils> for details. - -=head1 DESCRIPTION - -Check that the files referred to by C<execute> directives in the TeX -Live Database are present. - -=head1 AUTHORS AND COPYRIGHT - -This script and its documentation were written for the TeX Live -distribution (L<http://tug.org/texlive>) and both are licensed under the -GNU General Public License Version 2 or later. - -=cut - -### Local Variables: -### perl-indent-level: 2 -### tab-width: 2 -### indent-tabs-mode: nil -### End: -# vim:set tabstop=2 expandtab: # |