diff options
author | Karl Berry <karl@freefriends.org> | 2016-06-13 20:45:11 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-06-13 20:45:11 +0000 |
commit | 4c015cef69dbc996e766a3113004f24c700c166d (patch) | |
tree | c0f8751632e2525ccb21913a65bb6f829038fd97 /Master/tlpkg/bin | |
parent | cb42f7dd530ef6ee8b5f84819df7c730a7a99caa (diff) |
fmttrigger updates
git-svn-id: svn://tug.org/texlive/trunk@41438 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin')
-rwxr-xr-x | Master/tlpkg/bin/check-fmttriggers | 79 |
1 files changed, 43 insertions, 36 deletions
diff --git a/Master/tlpkg/bin/check-fmttriggers b/Master/tlpkg/bin/check-fmttriggers index 60cbca9d533..a696789d07d 100755 --- a/Master/tlpkg/bin/check-fmttriggers +++ b/Master/tlpkg/bin/check-fmttriggers @@ -64,13 +64,14 @@ sub main { # read tlpdb. my $tlpdb_file = "$Master/tlpkg/texlive.tlpdb"; - my ($tlpdb,$fmttriggers) = &tlpdb_by_file ($tlpdb_file); + my ($tlpdb,$fmttriggers,$fmtpkgcontainers) = &tlpdb_by_file ($tlpdb_file); - # map files used in format building to packages. + # map files used in the format builds to packages. my %pkgs_per_format = &pkgs_per_format ($tlpdb, %files_per_format); # check that those packages are exactly what's listed as needed. - return &compare_pkgs_and_triggers (\%pkgs_per_format, $fmttriggers); + return &compare_pkgs_and_triggers (\%pkgs_per_format, + $fmttriggers, $fmtpkgcontainers); } @@ -157,10 +158,10 @@ sub files_per_format { my $ef = "$engine.$format"; # Unfortunately, format filenames themselves are not unique, due to - # cont-en and pdfcsplain. Shouldn't be any engine-format dups, though. + # cont-en and pdfcsplain. Shouldn't be any engine+format dups, though. # - tldie ("$prg: already saw format $ef\n (with files @{$ret{$ef}})\n" - . " files now = @files\n") + tldie ("$prg: already saw format $ef\n (with files @{$ret{$ef}}),\n" + . " files now = @files\n") if exists $ret{$ef}; $ret{$ef} = \@files; } @@ -170,9 +171,10 @@ sub files_per_format { } -# Read TLPDB_FILE and return references to two hashes: one mapping -# contained files to TL package names, and a second mapping -# engine.format names to their specified fmttriggers. +# Read TLPDB_FILE and return references to three hashes: +# the first mapping contained files to TL package names, +# the second mapping engine.format names to their specified fmttriggers, +# and the third mapping engine.format names to the package defining them. # # Instead of using the general TeXLive::TLPDB functions, read the tlpdb # file ourselves. We want to build the file->package mapping just once, @@ -182,7 +184,7 @@ sub files_per_format { # sub tlpdb_by_file { my ($tlpdb_file) = @_; - my (%tlpfiles, %fmttriggers); + my (%tlpfiles, %fmttriggers, %fmtpkgcontainers); open (my $tlpdb, $tlpdb_file) || die "open($tlpdb_file) failed: $!"; my $pkg; @@ -198,7 +200,14 @@ sub tlpdb_by_file { . "line = $_\n"); } if ($af{"fmttriggers"}) { - $fmttriggers{"$af{engine}.$af{name}"} = $af{"fmttriggers"}; + my $ef = "$af{engine}.$af{name}"; + if (exists ($fmttriggers{$ef})) { + tldie ("$prg: already saw triggers for $ef ($fmttriggers{$ef})," + . " triggers now = $af{fmttriggers}\n"); + } + $fmttriggers{$ef} = $af{"fmttriggers"}; + $fmtpkgcontainers{$ef} = $pkg; + #warn " fmtpkgcontainers{$ef} = $pkg\n"; } else { tlwarn ("$prg: no fmttriggers: $_\n"); } @@ -209,8 +218,8 @@ sub tlpdb_by_file { # The installer "package" isn't one, just ignore it. next if $pkg eq "00texlive.installer"; my $f = $_; - tldie ("$prg: already saw file $f (package $tlpfiles{$f}), " - . "now in package $pkg\n") + tlwarn ("$prg: already saw file $f (package $tlpfiles{$f})," + . " now in package $pkg\n") if exists $tlpfiles{$f}; # should never happen $tlpfiles{$f} = $pkg; } @@ -219,7 +228,7 @@ sub tlpdb_by_file { &info ("TLPDB files: " . scalar (keys %tlpfiles) . " triggers: " . scalar (keys %fmttriggers) . "\n"); - return (\%tlpfiles, \%fmttriggers); + return (\%tlpfiles, \%fmttriggers, \%fmtpkgcontainers); } @@ -231,14 +240,6 @@ sub pkgs_per_format { my ($tlpdb,%files_per_format) = @_; my %ret; # format->pkgs mapping - # we don't include these as fmttriggers since when they meaningfully - # change, fmtutil should get called anyway due to language.* changing. - my @skip_pkgs = qw(dehyph-exptl hyph-utf8 hyphen-ancientgreek hyphen-german - hyphen-greek ruhyphen ukrhyph); - # there's also the question of the binaries themselves. we just - # ignore that, since it hasn't been a problem in practice: when the - # binaries change, everything tends to change anyway. - for my $format (sort keys %files_per_format) { &debug ("finding packages for $format...\n"); my %pkgs_for_this_format; @@ -246,13 +247,12 @@ sub pkgs_per_format { for my $f (@$files_ref) { if (exists $tlpdb->{$f}) { my $pkg = $tlpdb->{$f}; - next if grep ($_ eq $pkg, @skip_pkgs); $pkgs_for_this_format{$pkg} = 1; } else { tlwarn ("$prg: tl package not found for file: $f\n"); } } - # + # looked up all files for this format; save our list of packages. my @pkgs = sort keys %pkgs_for_this_format; &debug (" packages for $format: @pkgs\n"); @@ -268,32 +268,42 @@ sub pkgs_per_format { } -# Compare lists of required packages with lists of existing trigger -# directives. Return 0 if identical, 1 otherwise (and report -# differences). +# Compare lists of packages required by building (PKGS_PER_FORMAT) with +# lists of existing trigger directives (FMTTRIGGER). Return 0 if +# identical, 1 otherwise (and report differences). Ignore hyphenation +# dependencies and the package itself containing the trigger directive +# (FMTPKGCONTAINERS). # sub compare_pkgs_and_triggers { - my ($pkgs_per_format,$fmttriggers) = @_; + my ($pkgs_per_format,$fmttriggers,$fmtpkgcontainers) = @_; my $bad_p = 0; my $all_pkgs = 0; + # we don't include these as fmttriggers since when they meaningfully + # change, fmtutil should get called anyway due to language.* changing. + my @skip_pkgs = qw(dehyph-exptl hyph-utf8 ruhyphen ukrhyph); + # Anything matching hyphen-.* is also ignored. + for my $ef (sort keys %$pkgs_per_format) { my @recorded_pkgs = @{$pkgs_per_format->{$ef}}; $all_pkgs += @recorded_pkgs; my %recorded_pkgs; - @recorded_pkgs{@recorded_pkgs} = (); # hash slice for recorded files + @recorded_pkgs{@recorded_pkgs} = (); # hash slice for recorded pkgs if (defined $fmttriggers->{$ef}) { my @tlpdb_pkgs = @{$fmttriggers->{$ef}}; my %tlpdb_pkgs; - @tlpdb_pkgs{@tlpdb_pkgs} = (); # hash slice for the tlpdb side + @tlpdb_pkgs{@tlpdb_pkgs} = (); # hash slice for tlpdb pkgs my @recorded_only = (); for my $r (keys %recorded_pkgs) { if (exists $tlpdb_pkgs{$r}) { delete $tlpdb_pkgs{$r}; # ok, in both } else { + next if grep ($_ eq $r, @skip_pkgs); + next if $r =~ /hyphen-.*/; + next if $r eq $fmtpkgcontainers->{$ef}; push (@recorded_only, $r); } } @@ -370,12 +380,9 @@ L<TeXLive::TLUtils> for details. =head1 DESCRIPTION -This program removes the binary directories of the platforms given as -arguments; that is, remove the binfiles entries in the tlpdb, and remove -the containers. (Any xz and wget binaries for the installer remain, though.) - -It is used during DVD production to exclude certain platforms, and is -run from the L<tl-update-images> script. +Compare the fmttriggers= listed in the tlpsrc files with the actual +dependencies found by running fmtutil -recorder and inspecting the +recorder (.fls) files. =head1 AUTHORS AND COPYRIGHT |