summaryrefslogtreecommitdiff
path: root/new-infra
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2007-05-07 00:03:49 +0000
committerNorbert Preining <preining@logic.at>2007-05-07 00:03:49 +0000
commita6aaedd52b9c8b3117f3d97d71185d9dc82cd323 (patch)
tree64e3a3028de9f6783a4a8937537c21b4be7d38bb /new-infra
parent4262df1c241798d7f0ca409e39cbdad3395fd769 (diff)
new stuff: revision handling, some docs, tests
git-svn-id: svn://tug.org/texlive/trunk@4255 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'new-infra')
-rw-r--r--new-infra/README25
-rw-r--r--new-infra/specification.txt7
-rw-r--r--new-infra/tlsrc2tlp.pl50
-rw-r--r--new-infra/use_tldb.pl8
4 files changed, 77 insertions, 13 deletions
diff --git a/new-infra/README b/new-infra/README
index ea0e49a153a..523b7b6ab4b 100644
--- a/new-infra/README
+++ b/new-infra/README
@@ -1,5 +1,30 @@
A short example implementation
+current status:
+- tlsrc -> tlp conversion
+ Implemented:
+ . auto generation of packages in texmf-dist according to their
+ leaf 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?
+ . efficient procedures
+ . ???
+- 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
diff --git a/new-infra/specification.txt b/new-infra/specification.txt
index 4364ad00cb1..e1e393ada26 100644
--- a/new-infra/specification.txt
+++ b/new-infra/specification.txt
@@ -42,7 +42,7 @@ catalogue
includes all files which are in bin/$ARCH/ and have extension ${EXT}
where ARCH and EXT are expanded by the tlsrc interpreter
-execute free from
+execute free form
is taken one to one into the tlp file
depend
@@ -62,6 +62,7 @@ longdesc
-----------
same format as tlsrc, but the keys are
name
+ packageversion
revision
shortdesc
longdesc
@@ -77,6 +78,10 @@ same format as tlsrc, but the keys are
Interpretation
obvious
+ packageversion
+ maxmimum of all the last_changed_revisions of all
+ contained files
+
3) tldp file
------------
concatenation of all the tlp files, separated by empty line(s)
diff --git a/new-infra/tlsrc2tlp.pl b/new-infra/tlsrc2tlp.pl
index 7e98fa0d8db..e35eb99669c 100644
--- a/new-infra/tlsrc2tlp.pl
+++ b/new-infra/tlsrc2tlp.pl
@@ -36,7 +36,7 @@ sub main {
write_tlp_file($f);
}
foreach my $f (keys %AllFiles) {
- if ($AllFiles{$f} eq "") {
+ if ($AllFiles{$f}{'used'} != 1) {
print STDERR "Not covered file: $f\n";
}
}
@@ -78,7 +78,7 @@ sub read_tlsrc_file {
die("Continuation of $lastcmd not allowed, please fix tlsrc!\n");
}
}
- if ($line =~ /^name\s*(\w+)$/) {
+ if ($line =~ /^name\s*([\w-]+)$/) {
logit("found name: $1\n");
$name = "$1";
$lastcmd = "name";
@@ -169,15 +169,34 @@ sub read_tlsrc_file {
}
sub initialize_all_files {
- foreach my $f (`find texmf texmf-dist texmf-doc -type f`) {
- chomp($f);
- $AllFiles{$f} = "";
+ foreach my $l (`svn status -v`) {
+ chomp($l);
+ next if ($l =~ /^\?/); # ignore files not under version control
+ if ($l =~ /^(.)(.)(.)(.)(.)(.)..\s*(\d+)\s+(\d+)\s+\w+\s+(.+)$/) {
+ my $lastchanged = $8;
+ my $entry = "$9";
+ next if -d $entry;
+ $AllFiles{$entry}{'used'} = 0;
+ $AllFiles{$entry}{'lastchangedrev'} = $lastchanged;
+ } else {
+ die("Cannot read svn status output line: $l");
+ }
}
}
+#
+# possible optimizations:
+# - compile perl regexps once at the beginning before entering the big loop
+# in the loop mega action
+#
sub generate_tlp_data {
my ($tlp) = @_;
# predefined runpattern if all are missing
+ # WARNING
+ # Note that this will NOT NOT NOT find files in leaf directories named
+ # after the package but OUTSIDE texmf-dist, so files in
+ # texmf-doc/..../packagename/
+ # will NOT be found.
if (!(defined($tls{$tlp}{'runpatterns'}))) {
my $l = "d texmf-dist/.*/$tlp";
@{$tls{$tlp}{'runpatterns'}} = ("$l");
@@ -202,35 +221,43 @@ sub generate_tlp_data {
$tldb{$tlp}{'docfiles'} = [ ];
$tldb{$tlp}{'binfiles'} = [ ];
$tldb{$tlp}{'srcfiles'} = [ ];
- FILELABEL: foreach my $f (keys %AllFiles) {
+ $tldb{$tlp}{'packageversion'} = 0;
+ my $filemax;
+ my @allf = keys %AllFiles;
+ FILELABEL: foreach my $f (@allf) {
+ $filemax = $AllFiles{$f}{'lastchangedrev'};
foreach my $p (@{$tls{$tlp}{'runpatterns'}}) {
if (pattern_hit($f,$p,"run")) {
- $AllFiles{$f} = 1;
+ $AllFiles{$f}{'used'} = 1;
logit("Hit\n");
+ $tldb{$tlp}{'packageversion'} = $filemax > $tldb{$tlp}{'packageversion'} ? $filemax : $tldb{$tlp}{'packageversion'};
$tldb{$tlp}{'runfiles'} = [ @{$tldb{$tlp}{'runfiles'}}, $f ];
next FILELABEL;
}
}
foreach my $p (@{$tls{$tlp}{'docpatterns'}}) {
if (pattern_hit($f,$p,"doc")) {
- $AllFiles{$f} = 1;
+ $AllFiles{$f}{'used'} = 1;
logit("Hit\n");
+ $tldb{$tlp}{'packageversion'} = $filemax > $tldb{$tlp}{'packageversion'} ? $filemax : $tldb{$tlp}{'packageversion'};
$tldb{$tlp}{'docfiles'} = [ @{$tldb{$tlp}{'docfiles'}}, $f ];
next FILELABEL;
}
}
foreach my $p (@{$tls{$tlp}{'binpatterns'}}) {
if (pattern_hit($f,$p,"bin")) {
- $AllFiles{$f} = 1;
+ $AllFiles{$f}{'used'} = 1;
logit("Hit\n");
+ $tldb{$tlp}{'packageversion'} = $filemax > $tldb{$tlp}{'packageversion'} ? $filemax : $tldb{$tlp}{'packageversion'};
$tldb{$tlp}{'binfiles'} = [ @{$tldb{$tlp}{'binfiles'}}, $f ];
next FILELABEL;
}
}
foreach my $p (@{$tls{$tlp}{'srcpatterns'}}) {
if (pattern_hit($f,$p,"src")) {
- $AllFiles{$f} = 1;
+ $AllFiles{$f}{'used'} = 1;
logit("Hit\n");
+ $tldb{$tlp}{'packageversion'} = $filemax > $tldb{$tlp}{'packageversion'} ? $filemax : $tldb{$tlp}{'packageversion'};
$tldb{$tlp}{'srcfiles'} = [ @{$tldb{$tlp}{'srcfiles'}}, $f ];
next FILELABEL;
}
@@ -242,6 +269,7 @@ sub write_tlp_file {
my ($tlp) = @_;
open(TLP,">tlp/$tlp.tlp") || die("Cannot open tlp/$tlp.tlp for writing: $!");
print TLP "name $tlp\n";
+ print TLP "packageversion $tldb{$tlp}{'packageversion'}\n";
if (defined($tldb{$tlp}{'shortdesc'})) {
$tlpline = "shortdesc $tldb{$tlp}{'shortdesc'}";
write TLP;
@@ -253,7 +281,6 @@ sub write_tlp_file {
if (defined($tldb{$tlp}{'catalogue'})) {
print TLP "catalogue $tldb{$tlp}{'catalogue'}\n";
}
- my @tmp;
if (defined($tldb{$tlp}{'executes'})) {
foreach (@{$tldb{$tlp}{'executes'}}) {
print TLP "execute $_\n";
@@ -264,6 +291,7 @@ sub write_tlp_file {
print TLP "depend $_\n";
}
}
+ my @tmp;
@tmp = @{$tldb{$tlp}{'docfiles'}};
if ($#tmp >= 0) {
print TLP "docfiles\n";
diff --git a/new-infra/use_tldb.pl b/new-infra/use_tldb.pl
index d9342a0267b..4403dd48112 100644
--- a/new-infra/use_tldb.pl
+++ b/new-infra/use_tldb.pl
@@ -84,7 +84,12 @@ sub read_tldb_file {
$started = 1;
} else {
$started || die("First directive needs to be 'name'");
- if ($line =~ /^shortdesc\s*(.*)$/) {
+ if ($line =~ /^packageversion\s*(.*)$/) {
+ logit("found packageversion: $1\n");
+ $tldb{$name}{'packageversion'} = "$1";
+ $lastcmd = "packageversion";
+ next;
+ } elsif ($line =~ /^shortdesc\s*(.*)$/) {
logit("found shortdesc: $1\n");
$tldb{$name}{'shortdesc'} .= "$1 ";
$lastcmd = "shortdesc";
@@ -170,6 +175,7 @@ sub write_tlp_file {
my ($tlp) = @_;
open(TLP,">tlp/$tlp.tlp") || die("Cannot open tlp/$tlp.tlp for writing: $!");
print TLP "name $tlp\n";
+ print TLP "packageversion $tldb{$tlp}{'packageversion'}\n";
if (defined($tldb{$tlp}{'shortdesc'})) {
$tlpline = "shortdesc $tldb{$tlp}{'shortdesc'}";
write TLP;