From 2c863339ea98cde989caaede49639f33ff7093e9 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 24 May 2007 07:52:22 +0000 Subject: more hacking git-svn-id: svn://tug.org/texlive/trunk@4352 c570f23f-e606-0410-a88d-b1316a301751 --- new-infra/TLP.pm | 251 ++++++++++++++++++++++++++++++++++++++++++++ new-infra/TLSRC.pm | 155 +++++++++++++++++++++++---- new-infra/TLTREE.pm | 98 +++++++++++++++-- new-infra/specification.txt | 13 ++- new-infra/test-tlp.pl | 10 ++ new-infra/test-tltree.pl | 27 +++++ new-infra/tlsrc/bar.tlsrc | 4 +- new-infra/tlsrc/baz.tlsrc | 6 +- new-infra/tlsrc2tlp.pl | 14 +-- 9 files changed, 529 insertions(+), 49 deletions(-) create mode 100644 new-infra/TLP.pm create mode 100644 new-infra/test-tlp.pl create mode 100644 new-infra/test-tltree.pl diff --git a/new-infra/TLP.pm b/new-infra/TLP.pm new file mode 100644 index 00000000000..d3d12aebccb --- /dev/null +++ b/new-infra/TLP.pm @@ -0,0 +1,251 @@ +# +# TLP.pm +# module for using tlp files +# Copyright 2007 Norbert Preining +# +# This file is licensed under the GNU General Public Licence version 2 +# or any later version + +package TLP; + +sub new { + my $class = shift; + my %params = @_; + my $self = { + name => $params{'name'}, + shortdesc => $params{'shortdesc'}, + longdesc => $params{'longdesc'}, + catalogue => $params{'catalogue'}, + runfiles => $params{'runfiles'}, + srcfiles => $params{'srcpatterns'}, + docfiles => $params{'docfiles'}, + binfiles => $params{'binfiles'}, + executes => $params{'executes'}, + depends => $params{'depends'}, + revision => $params{'revision'}, + }; + bless $self, $class; + return $self; +} + +sub from_file { + my $self = shift; + if (@_ != 1) { + die("Need a filename for initialization!"); + } + open(TMP,"<$_[0]") || die("Cannot open tlp file: $_[0]"); + my @lines = ; + close(TMP); + my $started = 0; + my $finished = 0; + my $lastcmd = ""; + + foreach my $line (@lines) { + $line =~ /^\s*#/ && next; # skip comment lines + if ($line =~ /^\s*$/) { + if (!$started) { next; } + if ($finished) { next; } + die("No empty line allowed within tlp files!"); + } + if ($line =~ /^ /) { + if ( ($lastcmd eq "longdesc") || + ($lastcmd eq "runfiles") || + ($lastcmd eq "binfiles") || + ($lastcmd eq "docfiles") || + ($lastcmd eq "srcfiles") || + ($lastcmd eq "executes") || + ($lastcmd eq "depend") ) { + $line =~ s/^ /$lastcmd /; + } else { + die("Continuation of $lastcmd not allowed, please fix tlp!\n"); + } + } + if ($line =~ /^name\s*(\w+)$/) { + $name = "$1"; + $lastcmd = "name"; + $self->name("$name"); + $started && die("Cannot have two name directives!"); + $started = 1; + } else { + $started || die("First directive needs to be 'name'"); + if ($line =~ /^shortdesc\s+(.*)$/) { + $self->{'shortdesc'} .= "$1 "; + $lastcmd = "shortdesc"; + next; + } elsif ($line =~ /^longdesc\s+(.*)$/) { + $self->{'longdesc'} .= "$1 "; + $lastcmd = "longdesc"; + next; + } elsif ($line =~ /^catalogue\s+(.*)$/) { + $self->catalogue("$1"); + $lastcmd = "catalogue"; + next; + } elsif ($line =~ /^runfiles\s+(.*)$/) { + push @{$self->{'runfiles'}}, "$1" unless "$1" eq ""; + $lastcmd = "runfiles"; + next; + } elsif ($line =~ /^srcfiles\s+(.*)$/) { + push @{$self->{'srcfiles'}}, "$1" unless "$1" eq ""; + $lastcmd = "srcfiles"; + next; + } elsif ($line =~ /^docfiles\s+(.*)$/) { + push @{$self->{'docfiles'}}, "$1" unless "$1" eq ""; + $lastcmd = "docfiles"; + next; + } elsif ($line =~ /^binfiles\s+(.*)$/) { + push @{$self->{'binfiles'}}, "$1" unless "$1" eq ""; + $lastcmd = "binfiles"; + next; + } elsif ($line =~ /^execute\s*(.*)$/) { + push @{$self->{'executes'}}, "$1" unless "$1" eq ""; + $lastcmd = "execute"; + next; + } elsif ($line =~ /^depend\s*(.*)$/) { + push @{$self->{'depends'}}, "$1" unless "$1" eq ""; + $lastcmd = "depend"; + next; + } else { + die("Unknown directive ...$line... in $tldb, please fix it!"); + } + } + } +} + +sub writeout { + my $self = shift; + my $fd = (@_ ? $_[0] : STDOUT); + print $fd "name ", $self->name, "\n"; + defined($self->{'revision'}) && print $fd "revision $self->{'revision'}\n"; + defined($self->{'catalogue'}) && print $fd "catalogue $self->{'catalogue'}\n"; + defined($self->{'shortdesc'}) && print $fd "shortdesc $self->{'shortdesc'}\n"; + defined($self->{'longdesc'}) && print $fd "longdesc $self->{'longdesc'}\n"; + if (defined($self->{'depends'})) { + foreach (@{$self->{'depends'}}) { + print $fd "depend $_\n"; + } + } + if (defined($self->{'executes'})) { + foreach (@{$self->{'executes'}}) { + print $fd "execute $_\n"; + } + } + if (defined($self->{'srcfiles'}) && (@{$self->{'srcfiles'}})) { + print $fd "srcfiles\n"; + foreach (@{$self->{'srcfiles'}}) { + print $fd " $_\n"; + } + } + if (defined($self->{'runfiles'}) && (@{$self->{'runfiles'}})) { + print $fd "runfiles\n"; + foreach (@{$self->{'runfiles'}}) { + print $fd " $_\n"; + } + } + if (defined($self->{'docfiles'}) && (@{$self->{'docfiles'}})) { + print $fd "docfiles\n"; + foreach (@{$self->{'docfiles'}}) { + print $fd " $_\n"; + } + } + if (defined($self->{'binfiles'}) && (@{$self->{'binfiles'}})) { + print $fd "binfiles\n"; + foreach (@{$self->{'binfiles'}}) { + print $fd " $_\n"; + } + } +} + +# +# member access functions +# +sub name { + my $self = shift; + if (@_) { $self->{'name'} = shift } + return $self->{'name'}; +} +sub shortdesc { + my $self = shift; + if (@_) { $self->{'shortdesc'} = shift } + return $self->{'shortdesc'}; +} +sub longdesc { + my $self = shift; + if (@_) { $self->{'longdesc'} = shift } + return $self->{'longdesc'}; +} +sub revision { + my $self = shift; + if (@_) { $self->{'revision'} = shift } + return $self->{'revision'}; +} +sub catalogue { + my $self = shift; + if (@_) { $self->{'catalogue'} = shift } + return $self->{'catalogue'}; +} +sub srcfiles { + my $self = shift; + if (@_) { @{ $self->{'srcfiles'} } = @_ } + return @{ $self->{'srcfiles'} }; +} +sub add_srcfiles { + my ($self,@files) = @_; + push @{ $self->{'srcfiles'} }, @files; +} +sub docfiles { + my $self = shift; + if (@_) { @{ $self->{'docfiles'} } = @_ } + return @{ $self->{'docfiles'} }; +} +sub add_docfiles { + my ($self,@files) = @_; + push @{ $self->{'docfiles'} }, @files; +} +sub binfiles { + my $self = shift; + if (@_) { @{ $self->{'binfiles'} } = @_ } + return @{ $self->{'binfiles'} }; +} +sub add_binfiles { + my ($self,@files) = @_; + push @{ $self->{'binfiles'} }, @files; +} +sub runfiles { + my $self = shift; + if (@_) { @{ $self->{'runfiles'} } = @_ } + return @{ $self->{'runfiles'} }; +} +sub add_runfiles { + my ($self,@files) = @_; + push @{ $self->{'runfiles'} }, @files; +} +sub depends { + my $self = shift; + if (@_) { @{ $self->{'depends'} } = @_ } + return @{ $self->{'depends'} }; +} +sub executes { + my $self = shift; + if (@_) { @{ $self->{'executes'} } = @_ } + return @{ $self->{'executes'} }; +} + + +1; + + + +###### Formats +format TLP = +^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +$tlpline + ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~ +$tlpline +. + +### Local Variables: +### perl-indent-level: 4 +### tab-width: 4 +### indent-tabs-mode: t +### End: +# vim:set tabstop=4: # diff --git a/new-infra/TLSRC.pm b/new-infra/TLSRC.pm index 8862e4cb3f4..2cc88a478da 100644 --- a/new-infra/TLSRC.pm +++ b/new-infra/TLSRC.pm @@ -8,6 +8,9 @@ package TLSRC; +use TLP; +use TLTREE; + sub new { my $class = shift; my %params = @_; @@ -54,10 +57,10 @@ sub from_file { } if ($line =~ /^ /) { if ( ($lastcmd eq "longdesc") || - ($lastcmd eq "runpattern") || - ($lastcmd eq "binpattern") || - ($lastcmd eq "docpattern") || - ($lastcmd eq "srcpattern") || + ($lastcmd eq "runpatterns") || + ($lastcmd eq "binpatterns") || + ($lastcmd eq "docpatterns") || + ($lastcmd eq "srcpatterns") || ($lastcmd eq "execute") || ($lastcmd eq "depend") ) { $line =~ s/^ /$lastcmd /; @@ -76,35 +79,35 @@ sub from_file { $shortdesc .= "$1 "; $lastcmd = "shortdesc"; next; - } elsif ($line =~ /^longdesc\s*(.*)$/) { + } elsif ($line =~ /^longdesc\s+(.*)$/) { $longdesc .= "$1 "; $lastcmd = "longdesc"; next; - } elsif ($line =~ /^catalogue\s*(.*)$/) { + } elsif ($line =~ /^catalogue\s+(.*)$/) { $catalogue .= "$1 "; $lastcmd = "catalogue"; next; - } elsif ($line =~ /^runpattern\s*(.*)$/) { + } elsif ($line =~ /^runpatterns\s+(.*)$/) { push @runpatterns, "$1"; $lastcmd = "runpattern"; next; - } elsif ($line =~ /^srcpattern\s*(.*)$/) { + } elsif ($line =~ /^srcpatterns\s+(.*)$/) { push @srcpatterns, "$1"; $lastcmd = "srcpattern"; next; - } elsif ($line =~ /^docpattern\s*(.*)$/) { + } elsif ($line =~ /^docpatterns\s+(.*)$/) { push @docpatterns, "$1"; $lastcmd = "docpattern"; next; - } elsif ($line =~ /^binpattern\s*(.*)$/) { + } elsif ($line =~ /^binpatterns\s+(.*)$/) { push @binpatterns, "$1"; $lastcmd = "binpattern"; next; - } elsif ($line =~ /^execute\s*(.*)$/) { + } elsif ($line =~ /^execute\s+(.*)$/) { push @executes, "$1"; $lastcmd = "execute"; next; - } elsif ($line =~ /^depend\s*(.*)$/) { + } elsif ($line =~ /^depend\s+(.*)$/) { push @depends, "$1"; $lastcmd = "depend"; next; @@ -142,28 +145,136 @@ sub writeout { print $fd "execute $_\n"; } } - if (defined($self->{'srcpatterns'})) { + if (defined($self->{'srcpatterns'}) && (@{$self->{'srcpatterns'}})) { + print $fd "srcpatterns\n"; foreach (@{$self->{'srcpatterns'}}) { - print $fd "srcpattern $_\n"; + print $fd " $_\n"; } } - if (defined($self->{'runpatterns'})) { + if (defined($self->{'runpatterns'}) && (@{$self->{'runpatterns'}})) { + print $fd "runpatterns\n"; foreach (@{$self->{'runpatterns'}}) { - print $fd "runpattern $_\n"; + print $fd " $_\n"; } } - if (defined($self->{'docpatterns'})) { + if (defined($self->{'docpatterns'}) && (@{$self->{'docpatterns'}})) { + print $fd "docpatterns\n"; foreach (@{$self->{'docpatterns'}}) { - print $fd "docpattern $_\n"; + print $fd " $_\n"; } } - if (defined($self->{'binpatterns'})) { + if (defined($self->{'binpatterns'}) && (@{$self->{'binpatterns'}})) { + print $fd "binpatterns\n"; foreach (@{$self->{'binpatterns'}}) { - print $fd "binpattern $_\n"; + print $fd " $_\n"; + } + } +} + +# +# the hard work, generate a TLP file +# + +sub make_tlp { + my ($self,$tltree) = @_; + # predefined patterns if all are missing + if (! ( (defined($self->{'runpatterns'})) || + (defined($self->{'srcpatterns'})) || + (defined($self->{'docpatterns'})) || + (defined($self->{'binpatterns'})) )) { + foreach my $md (qw/bibtex context dvips fonts makeindex metafont + metapost mft omega scripts tex vtex/) { + push @{$self->{'runpatterns'}}, "t texmf-dist $md $tlp"; + } + push @{$self->{'docpatterns'}}, "t texmf-dist doc $tlp"; + push @{$self->{'srcpatterns'}}, "t texmf-dist source $tlp"; + } + my $tlp = TLP->new; + $tlp->name($tlsrc->name); + $tlp->shortdesc($self->{'shortdesc'}) if (defined($self->{'shortdesc'})); + $tlp->longdesc($self->{'longdesc'}) if (defined($tls{$tlp}{'longdesc'})); + $tlp->catalogue($self->{'catalogue'}) if (defined($tls{$tlp}{'catalogue'})); + $tlp->executes($self->{'executes'}) if (defined($tls{$tlp}{'executes'})); + $tlp->depends($self->{'depends'}) if (defined($tls{$tlp}{'depends'})); + $tlp->revision(0); + my $filemax; + foreach my $p (@{$self->{'runpatterns'}}) { + my ($pattype,@patwords) = split ' ',$p; + if ($pattype eq "t") { + $self->_do_leaf_pattern($tlp,$tltree,'runfiles',@patwords); + } else { + $self->_do_regexp_pattern($tlp,$tltree,'runfiles',$p); + } + } + foreach my $p (@{$self->{'srcpatterns'}}) { + my ($pattype,@patwords) = split ' ',$p; + if ($pattype eq "t") { + $self->_do_leaf_pattern($tlp,$tltree,'srcfiles',@patwords); + } else { + $self->_do_regexp_pattern($tlp,$tltree,'srcfiles',$p); + } + } + foreach my $p (@{$self->{'docpatterns'}}) { + my ($pattype,@patwords) = split ' ',$p; + if ($pattype eq "t") { + $self->_do_leaf_pattern($tlp,$tltree,'docfiles',@patwords); + } else { + $self->_do_regexp_pattern($tlp,$tltree,'docfiles',$p); + } + } + foreach my $p (@{$self->{'binpatterns'}}) { + my ($pattype,@patwords) = split ' ',$p; + if ($pattype eq "t") { + $self->_do_leaf_pattern($tlp,$tltree,'binfiles',@patwords); + } else { + $self->_do_regexp_pattern($tlp,$tltree,'binfiles',$p); + } + } +} + +sub _do_leaf_pattern { + my ($self,$tlp,$tltree,$type,@patwords) = @_; + my @matchfiles = $tltree->get_files_matching_dir_pattern($type,$patwords); + my $filemax; + foreach my $f (@matchfiles) { + $filemax = $tltree->file_svn_lastrevision($f); + $tlp->revision($filemax > $tlp->revision ? : $filemax : $tlp->revision); + } +} + +sub _do_regexp_pattern { + my ($self,$tltree,$tlp,$filetype,$p) = @_; + my @matchfiles = $tltree->get_files_matching_regexp_pattern($type,$p); + my $filemax; + foreach my $f (@matchfiles) { + $filemax = $tltree->file_svn_lastrevision($f); + $tlp->revision($filemax > $tlp->revision ? : $filemax : $tlp->revision); + } +} + +sub pattern_hit { + my ($file, $pattern) = @_; + my (@dirs) = split /\//, $file; + $pattern =~ /^(d|f|t)\s+(.*)$/; + my $pattype = $1; + my $patdata = $2; + logit("pattype=...$pattype...patdata=...$patdata...\n"); + if ($pattype eq "d") { + pop @dirs ; + my $foo = join "/",@dirs; + logit("matching [d] >>>$patdata<<< against >>>$foo<<<\n"); + if ($foo =~ /^$patdata$/) { + return 1; + } + } elsif ($pattype eq "f") { + logit("matching [f] >>>$patdata<<< against >>>$file<<<\n"); + if ($file =~ /^$patdata$/) { + return 1; } + } else { + die("Unknown pattern specification: $pattern!"); } - # print final empty line - print $fd "\n"; + return 0; } # diff --git a/new-infra/TLTREE.pm b/new-infra/TLTREE.pm index 4278188ad4d..0240168bd57 100644 --- a/new-infra/TLTREE.pm +++ b/new-infra/TLTREE.pm @@ -14,8 +14,9 @@ sub new { my $self = { svnroot => $params{'svnroot'}, # private stuff - _tree => {}, + _allfiles => {}, _dirtree => {}, + _dirnames => {}, _filesofdir => {}, _subdirsofdir => {}, }; @@ -53,8 +54,7 @@ sub _initialize_lines { my $lastchanged = $8; my $entry = "$9"; next if -d $entry; # TODO: what to do with links??? - @{$self->{'_tree'}{$entry}{'used'}} = (); - $self->{'_tree'}{$entry}{'lastchangedrev'} = $lastchanged; + $self->{'_allfiles'}{$entry}{'lastchangedrev'} = $lastchanged; my $fn = basename($entry); my $dn = dirname($entry); add_path_to_tree($self->{'_dirtree'}, split("[/\\\\]", $dn)); @@ -67,13 +67,12 @@ sub _initialize_lines { # - create list of top level dirs with a list of full path names of # the respective dir attached $self->walk_tree(\&find_alldirs); - walk_tree($DirTree, \&find_alldirs); chdir($oldpwd); } sub print_tree { - my ($node) = @_; - &walk_tree($node, \&print_node); + my $self = shift; + $self->walk_tree(\&print_node); } sub find_alldirs { @@ -100,12 +99,14 @@ sub print_node { } sub walk_tree { + my $self = shift; my (@stack_dir); - walk_tree1(@_, @stack_dir); + $self->_walk_tree1($self->{'_dirtree'},@_, @stack_dir); } sub _walk_tree1 { - my ($self,$node, $pre_proc, $post_proc, @stack_dir) = @_; + my $self = shift; + my ($node,$pre_proc, $post_proc, @stack_dir) = @_; my $v; for my $k (keys(%{$node})) { push @stack_dir, $k; @@ -170,6 +171,87 @@ sub basename { return $1; } +sub file_svn_lastrevision { + my $self = shift; + my $fn = shift; + if (defined($self->{'_allfiles'}{$fn})) { + return($self->{'_allfiles'}{$fn}{'lastchangedrev'}); + } else { + return(undef); + } +} + +sub get_files_matching_regexp_pattern { + my $self = shift; + my ($type,$p) = @_; + my @returnfiles; + FILELABEL: foreach my $f (keys(%{$self->{'_allfiles'}})) { + if (_pattern_hit($f,$p)) { + push_uniq(\@returnfiles,$f); + next FILELABEL; + } + } +} + +sub _pattern_hit { + my ($file, $pattern) = @_; + my (@dirs) = split /\//, $file; + $pattern =~ /^(d|f|t)\s+(.*)$/; + my $pattype = $1; + my $patdata = $2; + if ($pattype eq "d") { + pop @dirs ; + my $foo = join "/",@dirs; + if ($foo =~ /^$patdata$/) { + return 1; + } + } elsif ($pattype eq "f") { + if ($file =~ /^$patdata$/) { + return 1; + } + } else { + die("Unknown pattern specification: $pattern!"); + } + return 0; +} + +sub get_files_matching_dir_pattern { + my $self = shift; + my ($type,@patwords) = @_; + # the pattern type looks like: dir1 dir2 ... dirn dirtl + # where a file matches if it looks like + # dir1/dir2/.../dirn/.*/dirtl/file + # all but the first define the first dirs, the last the leaf dir + my $tl = pop @patwords; + my @returnfiles; + if (defined($self->{'_dirnames'}{$tl})) { + foreach my $tld (@{$self->{'_dirnames'}{$tl}}) { + if (index($tld,join("/",@patwords)."/") == 0) { + my @files = $self->files_under_path($tld); + push_uniq(\@returnfiles, @files); + } + } + } + return(@returnfiles); +} + +sub files_under_path { + my $self = shift; + my $p = shift; + my @files = (); + foreach my $aa (@{$self->{'_filesofdir'}{$p}}) { + push_uniq( \@files, $p . "/" . $aa); + } + print "p=$p\n"; + if (defined($self->{'_subdirsofdir'}{$p})) { + foreach my $sd (@{$self->{'_subdirsofdir'}{$p}}) { + my @sdf = $self->files_under_path($p . "/" . $sd); + push_uniq (\@files, @sdf); + } + } + return @files; +} + # # member access functions # diff --git a/new-infra/specification.txt b/new-infra/specification.txt index 57c66d2cb09..d6fb56ed281 100644 --- a/new-infra/specification.txt +++ b/new-infra/specification.txt @@ -13,10 +13,10 @@ possible keys are shortdesc longdesc catalogue - runpattern - srcpattern - docpattern - binpattern + runpatterns + srcpatterns + docpatterns + binpatterns execute depend @@ -27,7 +27,7 @@ name catalogue name of the respective Catalogue entry, if missing, same as name -(run|src|doc|bin)pattern +(run|src|doc|bin)patterns (cheap/expensive means working time) current status: @@ -102,7 +102,6 @@ longdesc ----------- same format as tlsrc, but the keys are name - packageversion revision shortdesc longdesc @@ -118,7 +117,7 @@ same format as tlsrc, but the keys are Interpretation obvious - packageversion + revision maxmimum of all the last_changed_revisions of all contained files diff --git a/new-infra/test-tlp.pl b/new-infra/test-tlp.pl new file mode 100644 index 00000000000..b27d219889c --- /dev/null +++ b/new-infra/test-tlp.pl @@ -0,0 +1,10 @@ +#!/usr/bin/perl -w + +use strict; + +use TLP; + +my $tlsrc = new TLP; +$tlsrc->from_file("tlp/baz.tlp"); +$tlsrc->writeout(); + diff --git a/new-infra/test-tltree.pl b/new-infra/test-tltree.pl new file mode 100644 index 00000000000..5e718923379 --- /dev/null +++ b/new-infra/test-tltree.pl @@ -0,0 +1,27 @@ +#!/usr/bin/perl -w + +use strict; + +use TLTREE; +use Data::Dumper; + +my $tl = TLTREE->new( 'svnroot' => "/src/TeX/texlive-svn/new-infra" ); + +print "svnroot = ", $tl->svnroot, "\n"; +$tl->init_from_svn; + +#print Dumper($tl); + +#$tl->print_tree; + +my $fn="texmf-dist/fonts/tfm/baz/file1"; +print "$fn rev = ", $tl->file_svn_lastrevision($fn), "\n"; + +my @foo = $tl->get_files_matching_dir_pattern('binfiles',"texmf-dist","fonts"); + +print "files under texmf-dist fonts = @foo\n"; + +@foo = $tl->get_files_matiching_regexp_pattern('binfiles',"f texmf-dist/.*"); + +print "files mathcing f texmf-dist/.*: @foo\n"; + diff --git a/new-infra/tlsrc/bar.tlsrc b/new-infra/tlsrc/bar.tlsrc index fb13f1e373d..cd1f0632167 100644 --- a/new-infra/tlsrc/bar.tlsrc +++ b/new-infra/tlsrc/bar.tlsrc @@ -10,5 +10,5 @@ longdesc the bar package is used for doing useless depend othercoll depend another collection depend foo -runpattern d texmf-dist/.*/bar -binpattern f texmf/.*/bar/.* +runpatterns d texmf-dist/.*/bar +binpatterns f texmf/.*/bar/.* diff --git a/new-infra/tlsrc/baz.tlsrc b/new-infra/tlsrc/baz.tlsrc index eb838c4cc27..338a2fe1251 100644 --- a/new-infra/tlsrc/baz.tlsrc +++ b/new-infra/tlsrc/baz.tlsrc @@ -4,6 +4,6 @@ longdesc the baz depend othercoll depend another collection depend foo -runpattern t texmf-dist baz -docpattern t texmf-doc baz -srcpattern t texmf baz +runpatterns t texmf-dist baz +docpatterns t texmf-doc baz +srcpatterns t texmf baz diff --git a/new-infra/tlsrc2tlp.pl b/new-infra/tlsrc2tlp.pl index e861f56a276..68872334a07 100644 --- a/new-infra/tlsrc2tlp.pl +++ b/new-infra/tlsrc2tlp.pl @@ -129,7 +129,7 @@ sub read_tlsrc_file { $started = 1; } else { $started || die("First directive needs to be 'name'"); - if ($line =~ /^shortdesc\s*(.*)$/) { + if ($line =~ /^shortdesc\s+(.*)$/) { logit("found shortdesc: $1\n"); $shortdesc .= "$1 "; $lastcmd = "shortdesc"; @@ -144,32 +144,32 @@ sub read_tlsrc_file { $catalogue .= "$1 "; $lastcmd = "catalogue"; next; - } elsif ($line =~ /^runpattern\s*(.*)$/) { + } elsif ($line =~ /^runpatterns\s+(.*)$/) { logit("found runpattern: $1\n"); push @runpatterns, "$1"; $lastcmd = "runpattern"; next; - } elsif ($line =~ /^srcpattern\s*(.*)$/) { + } elsif ($line =~ /^srcpatterns\s+(.*)$/) { logit("found srcpattern: $1\n"); push @srcpatterns, "$1"; $lastcmd = "srcpattern"; next; - } elsif ($line =~ /^docpattern\s*(.*)$/) { + } elsif ($line =~ /^docpatterns\s+(.*)$/) { logit("found docpattern: $1\n"); push @docpatterns, "$1"; $lastcmd = "docpattern"; next; - } elsif ($line =~ /^binpattern\s*(.*)$/) { + } elsif ($line =~ /^binpatterns\s+(.*)$/) { logit("found binpattern: $1\n"); push @binpatterns, "$1"; $lastcmd = "binpattern"; next; - } elsif ($line =~ /^execute\s*(.*)$/) { + } elsif ($line =~ /^execute\s+(.*)$/) { logit("found execute: $1\n"); push @executes, "$1"; $lastcmd = "execute"; next; - } elsif ($line =~ /^depend\s*(.*)$/) { + } elsif ($line =~ /^depend\s+(.*)$/) { logit("found depend: $1\n"); push @depends, "$1"; $lastcmd = "depend"; -- cgit v1.2.3