summaryrefslogtreecommitdiff
path: root/new-infra/create-tldb.pl
blob: 0a068e835bb95d7e8b5422713fab2774bdff0d8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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);