summaryrefslogtreecommitdiff
path: root/new-infra
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2007-05-27 07:06:46 +0000
committerNorbert Preining <preining@logic.at>2007-05-27 07:06:46 +0000
commit67cd9230b2f85b81e4bee784cf6118afa5fcdaf1 (patch)
tree66fa9c923fd172deb822bf947d11cc6a35d565a3 /new-infra
parent43e7a0d990a62424029303aa9b928a330e696168 (diff)
multi-arch
size computation many fixes was a long night on the train ;-) git-svn-id: svn://tug.org/texlive/trunk@4376 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'new-infra')
-rw-r--r--new-infra/Perl-API.txt27
-rw-r--r--new-infra/README50
-rw-r--r--new-infra/TLP.pm45
-rw-r--r--new-infra/TLSRC.pm139
-rw-r--r--new-infra/TLTREE.pm98
-rw-r--r--new-infra/TODO9
-rw-r--r--new-infra/create-tldb.pl33
-rw-r--r--new-infra/specification.txt36
-rw-r--r--new-infra/test-tltree.pl17
-rw-r--r--new-infra/texmf/test/bar/aaa/file13
-rw-r--r--new-infra/texmf/test/bar/aaa/file21
-rw-r--r--new-infra/texmf/test/bar/aaa/file31
-rw-r--r--new-infra/tlsrc/bar.tlsrc5
-rw-r--r--new-infra/tlsrc/binaries-a.tlsrc4
-rw-r--r--new-infra/tlsrc/binaries-b.tlsrc4
-rw-r--r--new-infra/tlsrc/rrr.tlsrc7
16 files changed, 242 insertions, 237 deletions
diff --git a/new-infra/Perl-API.txt b/new-infra/Perl-API.txt
index c0009fc728c..8243c45936e 100644
--- a/new-infra/Perl-API.txt
+++ b/new-infra/Perl-API.txt
@@ -27,9 +27,6 @@ Read/Write functions (with argument set, without arg read)
$tlsrc->depends
$tlsrc->executes
- $tlsrc->architectures
- predefined to ....
-
Generation function
$tlp = $tlsrc->make_tlp($tltree);
generates a TLP object from itself (a TLSRC obj) and
@@ -61,6 +58,11 @@ Input/Output
creates a zip file of the tlp in $ziploc
zip $ziploc files ...
NOT IMPLEMENTED
+
+
+Utilities:
+ $tlp->recompute_sizes($tltree)
+ recomputes all the *size fields, see below
Read/Write functions (with argument set, without arg read)
@@ -125,12 +127,11 @@ Input/Ouput
Pattern matching functions
- $tltree->get_files_matching_regexp_pattern($type,$pattern)
- returns a list of files matching $pattern
- (see specification)
-
- $tltree->get_files_matching_dir_pattern($type,@patwords)
- returns a list of files matching a t pattern with words
+ $ref = $tltree->get_matching_files($type,$pattern)
+ for $type = bin
+ returns a ref to a hash of keys = architectures
+ otherwise
+ returns a ref to an array
(see specification)
Other functions
@@ -140,6 +141,12 @@ Other functions
as given by svn status -v
undef if file is not contained in $tltree
+ $tltree->size_of($file)
+ returns the size of $file, or undef if not in tree
+
+ $tlsrc->architectures
+ predefined to ....
+
Module TLDB
-----------
@@ -173,7 +180,7 @@ Input/Output
TLP interface
$tldb->add_tlp($tlp)
- adds a TLP to the TLDB
+ adds a TLP to the TLDB (or replaces an already present)
$tlp = $tldb->get_package("packagename");
returns undef if not installed
diff --git a/new-infra/README b/new-infra/README
index be08e705e5c..729ab601740 100644
--- a/new-infra/README
+++ b/new-infra/README
@@ -1,18 +1,11 @@
-A short example implementation
-status 2007-05-13
+README of new infra
+===================
-current status:
-- tlsrc -> tlp conversion
- Implemented:
- . auto generation of packages in texmf-dist according to their
- directory name
- . package version based on the maximum of all package file
- last changed revision number of subversion
- Missing:
- . update/inclusion of information from the catalogue
- . missing source keys?
- . ???
+Current status as of 2007-05-27
+- modules work, but need more testing
+
+- tlp generation from trivial tlsrc:
I have generated tlsrc files for all texmf-dist/tpm/*.tpm files containing
only the name, executes, and depends, and from these I generated tlp files
The automatic procedure works quiet well:
@@ -28,34 +21,5 @@ current status:
Generation time on my small laptop for all texmf-dist tlp is around 40sec
-- tlp -> tldb conversion
- Implemented:
- . just do it, trivial, cat $i, echo "" ...
- Missing:
- . no idea what it shoud do
-- usage of tldb
- Implemented:
- . reading of the whole tldp and generation of a perl hash
- . generation of tlp files from the tldp database
- Missing
- . replacement/update/other operations on single tlp entries
- this should be trivial as it is only hash operations
-
-make runs the following commands:
-
-1) generates tlp from tlsrc/*.tlsrc
- currently implemented is the auto generation of packages
- if no pattern is given (see tlsrc/foo.tlsrc) and more
- complicated patterns (using perl regexp atm).
-
-2) generates a tldb from tlp/*.tlp
- trivial concatenation with empty lines between
-
-3) moves tlp to tlp.old
-
-4) re-generates the tlp from the tldb
- use_tldb defines a function read_tldb_file which reads the whole
- file into a hash
-
-5) compares tlp.old and tlp
+- updater is there as skeleton
diff --git a/new-infra/TLP.pm b/new-infra/TLP.pm
index 96450cd62de..3cf126ea0fc 100644
--- a/new-infra/TLP.pm
+++ b/new-infra/TLP.pm
@@ -8,6 +8,7 @@
package TLP;
+use TLTREE;
use FileHandle;
my $_tmp;
@@ -160,6 +161,42 @@ sub from_fh {
return $started;
}
+sub recompute_sizes {
+ my ($self,$tltree) = @_;
+ $self->{'docsize'} = $self->_recompute_size("doc",$tltree);
+ $self->{'srcsize'} = $self->_recompute_size("src",$tltree);
+ $self->{'runsize'} = $self->_recompute_size("run",$tltree);
+ foreach $a ($tltree->architectures) {
+ $self->{'binsize'}{$a} = $self->_recompute_size("bin",$tltree,$a);
+ }
+}
+
+
+sub _recompute_size {
+ my ($self,$type,$tltree,$arch) = @_;
+ my $size = 0;
+ if ($type eq "bin") {
+ my %binfiles = %{$self->{'binfiles'}};
+ if (defined($binfiles{$arch})) {
+ foreach $f (@{$binfiles{$arch}}) {
+ $size += $tltree->size_of($f);
+ }
+ }
+ } else {
+ if (defined($self->{"${type}files"}) && (@{$self->{"${type}files"}})) {
+ foreach $f (@{$self->{"${type}files"}}) {
+ my $s = $tltree->size_of($f);
+ if (defined($s)) {
+ $size += $s;
+ } else {
+ printf STDERR "size for $f not defined, strange ...\n";
+ }
+ }
+ }
+ }
+ return $size;
+}
+
sub writeout {
my $self = shift;
my $fd = (@_ ? $_[0] : STDOUT);
@@ -183,19 +220,19 @@ sub writeout {
}
}
if (defined($self->{'docfiles'}) && (@{$self->{'docfiles'}})) {
- print $fd "docfiles\n";
+ print $fd "docfiles size=$self->{'docsize'}\n";
foreach (sort @{$self->{'docfiles'}}) {
print $fd " $_\n";
}
}
if (defined($self->{'srcfiles'}) && (@{$self->{'srcfiles'}})) {
- print $fd "srcfiles\n";
+ print $fd "srcfiles size=$self->{'srcsize'}\n";
foreach (sort @{$self->{'srcfiles'}}) {
print $fd " $_\n";
}
}
if (defined($self->{'runfiles'}) && (@{$self->{'runfiles'}})) {
- print $fd "runfiles\n";
+ print $fd "runfiles size=$self->{'runsize'}\n";
foreach (sort @{$self->{'runfiles'}}) {
print $fd " $_\n";
}
@@ -310,7 +347,7 @@ sub add_runfiles {
sub add_files {
my ($self,$type,@files) = @_;
die("Cannot use add_files for binfiles, we need that arch!") if ($type eq "bin");
- push @{ $self->{$type} }, @files;
+ push @{ $self->{"${type}files"} }, @files;
}
sub depends {
my $self = shift;
diff --git a/new-infra/TLSRC.pm b/new-infra/TLSRC.pm
index 8945dd0aec5..db3d641756d 100644
--- a/new-infra/TLSRC.pm
+++ b/new-infra/TLSRC.pm
@@ -8,18 +8,11 @@
package TLSRC;
-my @Architectures = qw/alpha-linux hppa-hpux i386-darwin i386-freebsd
- i386-linux i386-openbsd i386-solaris mips-irix powerpc-aix powerpc-darwin
- powerpc-linux sparc-linux sparc-solaris win32 x86_64-linux/;
-
+use FileHandle;
use TLP;
use TLTREE;
-print "WARNING WARNING WARNING\n";
-print "format of TLP files has changed, we need to adapt the TLSRC !!!\n";
-print "Multiple *files arch=... size=....\n";
-print "also in _do_*_pattern something with the arch!\n";
-die;
+my $_tmp;
sub new {
my $class = shift;
@@ -78,7 +71,7 @@ sub from_file {
die("Continuation of $lastcmd not allowed, please fix tlsrc!\n");
}
}
- if ($line =~ /^name\s*([\w-]+)$/) {
+ if ($line =~ /^name\s*([-\w]+)$/) {
$name = "$1";
$lastcmd = "name";
$started && die("Cannot have two name directives!");
@@ -98,27 +91,27 @@ sub from_file {
$lastcmd = "catalogue";
next;
} elsif ($line =~ /^runpatterns\s+(.*)$/) {
- push @runpatterns, "$1";
- $lastcmd = "runpattern";
+ push @runpatterns, "$1" if ("$1" ne "");
+ $lastcmd = "runpatterns";
next;
} elsif ($line =~ /^srcpatterns\s+(.*)$/) {
- push @srcpatterns, "$1";
- $lastcmd = "srcpattern";
+ push @srcpatterns, "$1" if ("$1" ne "");
+ $lastcmd = "srcpatterns";
next;
} elsif ($line =~ /^docpatterns\s+(.*)$/) {
- push @docpatterns, "$1";
- $lastcmd = "docpattern";
+ push @docpatterns, "$1" if ("$1" ne "");
+ $lastcmd = "docpatterns";
next;
} elsif ($line =~ /^binpatterns\s+(.*)$/) {
- push @binpatterns, "$1";
- $lastcmd = "binpattern";
+ push @binpatterns, "$1" if ("$1" ne "");
+ $lastcmd = "binpatterns";
next;
} elsif ($line =~ /^execute\s+(.*)$/) {
- push @executes, "$1";
+ push @executes, "$1" if ("$1" ne "");
$lastcmd = "execute";
next;
} elsif ($line =~ /^depend\s+(.*)$/) {
- push @depends, "$1";
+ push @depends, "$1" if ("$1" ne "");
$lastcmd = "depend";
next;
} else {
@@ -141,12 +134,12 @@ sub from_file {
sub writeout {
my $self = shift;
my $fd = (@_ ? $_[0] : STDOUT);
+ format_name $fd "multilineformat";
print $fd "name ", $self->name, "\n";
print $fd "catalogue $self->{'catalogue'}\n";
defined($self->{'shortdesc'}) && print $fd "shortdesc $self->{'shortdesc'}\n";
if (defined($self->{'longdesc'})) {
- my $tmp = $self->{'longdesc'};
- $~ = "multilineformat";
+ $_tmp = "longdesc $self->{'longdesc'}";
write $fd;
}
if (defined($self->{'depends'})) {
@@ -213,92 +206,44 @@ sub make_tlp {
$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',$q);
- }
+ $self->_do_normal_pattern($p,$tlp,$tltree,'run');
}
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',$q);
- }
+ $self->_do_normal_pattern($p,$tlp,$tltree,'src');
}
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',$q);
- }
+ $self->_do_normal_pattern($p,$tlp,$tltree,'doc');
}
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',$q);
+ my $matchref;
+ $matchref = $tltree->get_matching_files('bin',$p);
+ my %archmatches = %$matchref;
+ my @archs = $tltree->architectures;
+ my $filemax;
+ my @matchfiles;
+ foreach my $arch (@archs) {
+ @matchfiles = @{$archmatches{$arch}};
+ foreach my $f (@matchfiles) {
+ $filemax = $tltree->file_svn_lastrevision($f);
+ $tlp->revision(($filemax > $tlp->revision) ? $filemax : $tlp->revision);
+ }
+ $tlp->add_binfiles($arch,@matchfiles);
}
}
+ $tlp->recompute_sizes($tltree);
return $tlp;
}
-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);
- }
- if ($type eq "bin") {
- # we have to do something with the architecture!!!
- $tlp->add_binfiles($arch,@matchfiles);
- } else {
- $tlp->add_files($type,@matchfiles);
- }
-}
-
-sub _do_regexp_pattern {
- my ($self,$tlp,$tltree,$type,$p) = @_;
- my @matchfiles = $tltree->get_files_matching_regexp_pattern($type,$p);
+sub _do_normal_pattern {
+ my ($self,$p,$tlp,$tltree,$type) = @_;
+ my $matchref = $tltree->get_matching_files($type,$p);
+ my @matchfiles = @$matchref;
my $filemax;
foreach my $f (@matchfiles) {
$filemax = $tltree->file_svn_lastrevision($f);
$tlp->revision(($filemax > $tlp->revision) ? $filemax : $tlp->revision);
}
- if ($type eq "bin") {
- # we have to do something with the architecture!!!
- $tlp->add_binfiles($arch,@matchfiles);
- } else {
- $tlp->add_files($type,@matchfiles);
- }
-}
-
-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;
+ $tlp->add_files($type,@matchfiles);
}
#
@@ -354,21 +299,15 @@ sub executes {
if (@_) { @{ $self->{'executes'} } = @_ }
return @{ $self->{'executes'} };
}
-sub architectures {
- my $self = shift;
- if (@_) { @Architectures = @_ }
- return @Architectures;
-}
-
1;
# FORMATS
format multilineformat =
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-$tmp
+$_tmp
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~
-$tmp
+$_tmp
.
### Local Variables:
diff --git a/new-infra/TLTREE.pm b/new-infra/TLTREE.pm
index 9da7844f800..60377e12d83 100644
--- a/new-infra/TLTREE.pm
+++ b/new-infra/TLTREE.pm
@@ -8,6 +8,10 @@
package TLTREE;
+my @Architectures = qw/alpha-linux hppa-hpux i386-darwin i386-freebsd
+ i386-linux i386-openbsd i386-solaris mips-irix powerpc-aix powerpc-darwin
+ powerpc-linux sparc-linux sparc-solaris win32 x86_64-linux/;
+
sub new {
my $class = shift;
my %params = @_;
@@ -55,6 +59,9 @@ sub _initialize_lines {
my $entry = "$9";
next if -d $entry; # TODO: what to do with links???
$self->{'_allfiles'}{$entry}{'lastchangedrev'} = $lastchanged;
+ my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,
+ $mtime,$ctime,$bklsize,$blocks) = stat($entry);
+ $self->{'_allfiles'}{$entry}{'size'} = $size;
my $fn = basename($entry);
my $dn = dirname($entry);
add_path_to_tree($self->{'_dirtree'}, split("[/\\\\]", $dn));
@@ -181,48 +188,70 @@ sub file_svn_lastrevision {
}
}
-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 size_of {
+ my ($self,$f) = @_;
+ if (defined($self->{'_allfiles'}{$f})) {
+ return($self->{'_allfiles'}{$f}{'size'});
+ } else {
+ return(undef);
}
- return(@returnfiles);
}
-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;
+sub get_matching_files {
+ my ($self, $type, $p) = @_;
+ if ($type eq "bin") {
+ # we first substitute arch for ${ARCH}
+ my %returnfiles;
+ foreach $a (@Architectures) {
+ my $ARCH = $a;
+ my $newp;
+ eval "\$newp = \"$p\"";
+ my @foo = $self->_get_matching_files($type,$newp);
+ $returnfiles{$a} = [ @foo ];
}
+ return(\%returnfiles);
+ } else {
+ my @returnfiles = $self->_get_matching_files($type,$p);
+ return(\@returnfiles);
+ }
+}
+
+
+sub _get_matching_files {
+ my ($self, $type, $p) = @_;
+ my ($pattype,$patdata,@rest) = split ' ',$p;
+ my @matchfiles;
+ if ($pattype eq "t") {
+ @matchfiles = $self->_get_files_matching_dir_pattern($type,$patdata,@rest);
} elsif ($pattype eq "f") {
- if ($file =~ /^$patdata$/) {
- return 1;
+ if (defined($self->{'_allfiles'}{$patdata})) {
+ @matchfiles = ( $patdata );
}
+ } elsif ($pattype eq "r") {
+ @matchfiles = $self->_get_files_matching_regexp_pattern($type,$patdata);
+ } elsif ($pattype eq "d") {
+ @matchfiles = $self->files_under_path($patdata);
} else {
- die("Unknown pattern specification: $pattern!");
+ die "Unknown pattern $p";
}
- return 0;
+ return @matchfiles;
}
-sub get_files_matching_dir_pattern {
+sub _get_files_matching_regexp_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 ($type,$regexp) = @_;
+ my @returnfiles;
+ FILELABEL: foreach my $f (keys(%{$self->{'_allfiles'}})) {
+ if ($f =~ /^$regexp$/) {
+ push_uniq(\@returnfiles,$f);
+ next FILELABEL;
+ }
+ }
+ return(@returnfiles);
+}
+
+sub _get_files_matching_dir_pattern {
+ my ($self,$type,@patwords) = @_;
my $tl = pop @patwords;
my @returnfiles;
if (defined($self->{'_dirnames'}{$tl})) {
@@ -252,6 +281,7 @@ sub files_under_path {
return @files;
}
+
#
# member access functions
#
@@ -260,6 +290,12 @@ sub svnroot {
if (@_) { $self->{'svnroot'} = shift };
return $self->{'svnroot'};
}
+sub architectures {
+ my $self = shift;
+ if (@_) { @Architectures = @_ }
+ return @Architectures;
+}
+
1;
diff --git a/new-infra/TODO b/new-infra/TODO
index 710192efea8..c4858c43f84 100644
--- a/new-infra/TODO
+++ b/new-infra/TODO
@@ -1,14 +1,5 @@
TODO for new-infra
==================
-- TLSRC.pm: ${arch} etc for file lists/patterns
- needs adaption of the format of *patterns in tlsrc (?we could add
- the .exe on Win32 automatically) and *files in tlp
- Format should be:
- tlp:
- runfiles arch=...
- file1
- file2
- runfiles arch=... file
- move several functions from TLTREE to a module TLUtils (push_uniq etc)
- use push_uniq in TLP.pm add_files ... we have multiple occurrences of files
- TLP.pm: make_zip function
diff --git a/new-infra/create-tldb.pl b/new-infra/create-tldb.pl
new file mode 100644
index 00000000000..0a068e835bb
--- /dev/null
+++ b/new-infra/create-tldb.pl
@@ -0,0 +1,33 @@
+use TLSRC;
+use TLP;
+use TLDB;
+use TLTREE;
+# create tltree from everything under new-infra
+my $tltree = TLTREE->new( 'svnroot' => "/src/TeX/texlive-svn/new-infra");
+# init it from svn status -v
+$tltree->init_from_svn;
+
+# create an empty TLDB;
+my $tldb = TLDB->new;
+
+# create tlps for all tlsrc/*.tlsrc
+foreach my $f (<tlsrc/*.tlsrc>) {
+ my $tlsrc = new TLSRC;
+ # read the specification from a the .tlsrc file
+ $tlsrc->from_file($f);
+ # create the tlp, for this we need the $tltree
+ my $tlp = $tlsrc->make_tlp($tltree);
+ # add the $tlp to the TLDB
+ $tldb->add_tlp($tlp);
+ # in addition, write it out to a file
+ my $name = $tlp->name;
+ open(FOO,">tlp/$name.tlp");
+ $tlp->writeout(\*FOO);
+ close(FOO);
+}
+
+# finish by writing out the TLDB
+open(TMP,">test.tldb");
+$tldb->writeout(\*TMP);
+close(TMP);
+
diff --git a/new-infra/specification.txt b/new-infra/specification.txt
index 05c205ed275..56dc91ae8dc 100644
--- a/new-infra/specification.txt
+++ b/new-infra/specification.txt
@@ -32,44 +32,22 @@ catalogue
current status:
TYPE PAT
- TYPE = d f t
+ TYPE = t f d r
t word1 ... wordN wordL
include all files below all dirs of the form
word1/.../wordN/.../wordL/...
(cheap)
- d regexp
- include all files in directory mathing regexp
- (expensive)
- f regexp
- include all files matching regexp
- (expensive)
-
- new idea???
- list of pattern of the form
- TYPE PAT
- where
- TYPE = d f t r
- and PAT is a free text
-
- t word1 ... wordN wordL
- include all files below all dirs of the form
- word1/.../wordN/.../wordL/...
- (cheap)
-
- d string
- include all files below the directory d (now expansion at all)
- (should we add glob expansion?)
- (cheap, with glob I don't know)
-
f string
- include file string
+ include file "string"
(should we add glob expansion?)
(cheap, with glob I don't know)
-
+ d string
+ include all files in and below the directory "string"
+ (cheap)
r regexp
- includes all files which are matched by regexp
+ include all files matching /^regexp$/
(expensive)
-
+
Note that if one of the patterns section is empty an entry
is automatically generated:
for runpatterns:
diff --git a/new-infra/test-tltree.pl b/new-infra/test-tltree.pl
index d0648005dec..657516b8568 100644
--- a/new-infra/test-tltree.pl
+++ b/new-infra/test-tltree.pl
@@ -10,18 +10,25 @@ my $tl = TLTREE->new( 'svnroot' => "/src/TeX/texlive-svn/new-infra" );
print "svnroot = ", $tl->svnroot, "\n";
$tl->init_from_svn;
-#print Dumper($tl);
+print Dumper($tl);
#$tl->print;
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");
+my $foo = $tl->get_matching_files("run","t texmf-dist fonts");
-print "files under texmf-dist fonts = @foo\n";
+print "files under texmf-dist fonts = @$foo\n";
-@foo = $tl->get_files_matching_regexp_pattern('binfiles',"f texmf/.*/bar/.*");
+$foo = $tl->get_matching_files('run',"f texmf/.*/bar/.*");
-print "files mathcing f texmf/.*/bar/.*: @foo\n";
+print "files mathcing f texmf/.*/bar/.*: @$foo\n";
+
+$foo = $tl->get_matching_files('bin','f bin/${ARCH}/.*');
+
+foreach (keys %$foo) {
+ my @a = @{$foo->{$_}};
+ print "arch=$_: @a\n";
+}
diff --git a/new-infra/texmf/test/bar/aaa/file1 b/new-infra/texmf/test/bar/aaa/file1
index e69de29bb2d..b750bc36736 100644
--- a/new-infra/texmf/test/bar/aaa/file1
+++ b/new-infra/texmf/test/bar/aaa/file1
@@ -0,0 +1,3 @@
+Hello
+Hello World
+Hello
diff --git a/new-infra/texmf/test/bar/aaa/file2 b/new-infra/texmf/test/bar/aaa/file2
index e69de29bb2d..557db03de99 100644
--- a/new-infra/texmf/test/bar/aaa/file2
+++ b/new-infra/texmf/test/bar/aaa/file2
@@ -0,0 +1 @@
+Hello World
diff --git a/new-infra/texmf/test/bar/aaa/file3 b/new-infra/texmf/test/bar/aaa/file3
index e69de29bb2d..ed7b2ef70aa 100644
--- a/new-infra/texmf/test/bar/aaa/file3
+++ b/new-infra/texmf/test/bar/aaa/file3
@@ -0,0 +1 @@
+Hello World foobbar
diff --git a/new-infra/tlsrc/bar.tlsrc b/new-infra/tlsrc/bar.tlsrc
index cd1f0632167..4645a92f0c1 100644
--- a/new-infra/tlsrc/bar.tlsrc
+++ b/new-infra/tlsrc/bar.tlsrc
@@ -10,5 +10,6 @@ longdesc the bar package is used for doing useless
depend othercoll
depend another collection
depend foo
-runpatterns d texmf-dist/.*/bar
-binpatterns f texmf/.*/bar/.*
+runpatterns t texmf-dist bar
+docpatterns r texmf/.*/bar/.*
+binpatterns t bin ${ARCH}
diff --git a/new-infra/tlsrc/binaries-a.tlsrc b/new-infra/tlsrc/binaries-a.tlsrc
index e60a532192e..2ef6c64830e 100644
--- a/new-infra/tlsrc/binaries-a.tlsrc
+++ b/new-infra/tlsrc/binaries-a.tlsrc
@@ -1,5 +1,5 @@
-name binaries
+name binaries-a
shortdesc binaries for the world
longdesc we provide nice binaries for the world
longdesc and we want them to rule the world.
-binpatterns t bin $arch
+binpatterns t bin ${ARCH}
diff --git a/new-infra/tlsrc/binaries-b.tlsrc b/new-infra/tlsrc/binaries-b.tlsrc
index ff082f79935..d7db11fcbb5 100644
--- a/new-infra/tlsrc/binaries-b.tlsrc
+++ b/new-infra/tlsrc/binaries-b.tlsrc
@@ -1,5 +1,5 @@
-name binaries
+name binaries-b
shortdesc binaries for the world
longdesc we provide nice binaries for the world
longdesc and we want them to rule the world.
-binpatterns f bin/$arch/.*
+binpatterns r bin/${ARCH}/.*
diff --git a/new-infra/tlsrc/rrr.tlsrc b/new-infra/tlsrc/rrr.tlsrc
new file mode 100644
index 00000000000..25052ce44a1
--- /dev/null
+++ b/new-infra/tlsrc/rrr.tlsrc
@@ -0,0 +1,7 @@
+name rrr
+shortdesc the baz package
+longdesc the baz
+depend othercoll
+depend another collection
+depend foo
+runpatterns d texmf-dist