diff options
author | Norbert Preining <preining@logic.at> | 2008-06-02 06:28:23 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-06-02 06:28:23 +0000 |
commit | fbad9280127d8685a3c43ab6c8c277d90af9e555 (patch) | |
tree | 70e104b54a01b0cf8ff8a1bb9f9a7e1878d3800e /Master/tlpkg | |
parent | db54ace53994fd33ed3b48927bfb62fb356c3b83 (diff) |
TLPSRC.pm: tlwarn on patterns without matching files
execptions: - default patterns do not need to match a file
- f ignore patterns do not need to match a file ;-)
git-svn-id: svn://tug.org/texlive/trunk@8465 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPSRC.pm | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/Master/tlpkg/TeXLive/TLPSRC.pm b/Master/tlpkg/TeXLive/TLPSRC.pm index 6bbb37a1ad4..28dedc2fef5 100644 --- a/Master/tlpkg/TeXLive/TLPSRC.pm +++ b/Master/tlpkg/TeXLive/TLPSRC.pm @@ -202,6 +202,9 @@ sub make_tlpobj my $usedefault = 1; my @allpospats; my @allnegpats; + # + # runpatterns + # foreach my $p (@{$self->{'runpatterns'}}) { if ($p =~ m/^\+!(.*)$/) { push @allnegpats, $1; @@ -219,7 +222,9 @@ sub make_tlpobj if ($self->category eq "Package") { foreach my $md (qw/bibtex context dvips fonts makeindex metafont metapost mft omega scripts tex vtex/) { - push @allpospats, "t texmf-dist $md $self->{'name'}"; + # mark the default pattern with a leading * so that + # we do not warn a missing hit on a default pattern + push @allpospats, "*t texmf-dist $md $self->{'name'}"; } } } @@ -229,6 +234,9 @@ sub make_tlpobj foreach my $p (@allnegpats) { $self->_do_normal_pattern($p,$tlp,$tltree,'run',1); } + # + # srcpatterns + # @allpospats = (); @allnegpats = (); $usedefault = 1; @@ -248,9 +256,9 @@ sub make_tlpobj if ($usedefault) { # default patterns for srcfiles if ($self->category eq "Package") { - push @allpospats, "t texmf-dist source $self->{'name'}"; + push @allpospats, "*t texmf-dist source $self->{'name'}"; } elsif ($self->category eq "Documentation") { - push @allpospats, "t texmf-doc source $self->{'name'}"; + push @allpospats, "*t texmf-doc source $self->{'name'}"; } } foreach my $p (@allpospats) { @@ -259,6 +267,9 @@ sub make_tlpobj foreach my $p (@allnegpats) { $self->_do_normal_pattern($p,$tlp,$tltree,'src',1); } + # + # docpatterns + # @allpospats = (); @allnegpats = (); $usedefault = 1; @@ -278,9 +289,9 @@ sub make_tlpobj if ($usedefault) { # default patterns for docfiles if ($self->category eq "Package") { - push @allpospats, "t texmf-dist doc $self->{'name'}"; + push @allpospats, "*t texmf-dist doc $self->{'name'}"; } elsif ($self->category eq "Documentation") { - push @allpospats, "t texmf-doc doc $self->{'name'}"; + push @allpospats, "*t texmf-doc doc $self->{'name'}"; } } foreach my $p (@allpospats) { @@ -289,6 +300,9 @@ sub make_tlpobj foreach my $p (@allnegpats) { $self->_do_normal_pattern($p,$tlp,$tltree,'doc',1); } + # + # binpatterns + # # no default patterns for binfiles @allpospats = (); @allnegpats = (); @@ -309,7 +323,14 @@ sub make_tlpobj my %archmatches = %$matchref; my @archs = $tltree->architectures; foreach my $arch (@archs) { - $tlp->add_binfiles($arch,@{$archmatches{$arch}}); + my @archfiles = (); + if (defined($archmatches{$arch})) { + @archfiles = @{$archmatches{$arch}}; + } + if (!@archfiles) { + tlwarn("binpattern without hit: ".$self->name.": $arch: $p\n"); + } + $tlp->add_binfiles($arch,@archfiles); } } foreach my $p (@allnegpats) { @@ -318,7 +339,14 @@ sub make_tlpobj my %archmatches = %$matchref; my @archs = $tltree->architectures; foreach my $arch (@archs) { - $tlp->remove_binfiles($arch,@{$archmatches{$arch}}); + my @archfiles = (); + if (defined($archmatches{$arch})) { + @archfiles = @{$archmatches{$arch}}; + } + if (!@archfiles) { + tlwarn("binpattern without hit: ".$self->name.": $arch: $p\n"); + } + $tlp->remove_binfiles($arch,@archfiles); } } # add the revision number of the .tlpsrc file to the compute list: @@ -330,8 +358,16 @@ sub make_tlpobj sub _do_normal_pattern { my ($self,$p,$tlp,$tltree,$type,$negative) = @_; + my $is_default_pattern = 0; + if ($p =~ m/^\*/) { + $is_default_pattern = 1; + $p =~ s/^\*//; + } my $matchref = $tltree->get_matching_files($type,$p); my @matchfiles = @$matchref; + if (!$is_default_pattern && !@matchfiles && ($p !~ m/^f ignore/)) { + tlwarn("pattern without hit: ".$self->name.": $p\n"); + } if (defined($negative) && $negative == 1) { $tlp->remove_files($type,@matchfiles); } else { |