diff options
author | Norbert Preining <preining@logic.at> | 2007-07-12 09:38:09 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2007-07-12 09:38:09 +0000 |
commit | 2559ab32acfcf160257c8a7c85c968e7dd58b589 (patch) | |
tree | 96c6dfb1847833fd69bf0b03305a22f6119e5cc7 /Master/tlpkg/bin/tlpsrc2tlpdb | |
parent | fb899d343bd98cff4dfa012ef1e5cb7f851e69f4 (diff) |
the road to new texdoc handling:
- allow tags "details" and "language" for docfiles
- allow catalogue-* keys in a TLPOBJ file
- TLPOBJ.pm: add update_from_catalogue which updates some information
- adapt the tlpsrc2tlpdb script to take another argument -catalogue
in which case the database is build with catalogue information included
git-svn-id: svn://tug.org/texlive/trunk@4568 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin/tlpsrc2tlpdb')
-rwxr-xr-x | Master/tlpkg/bin/tlpsrc2tlpdb | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/Master/tlpkg/bin/tlpsrc2tlpdb b/Master/tlpkg/bin/tlpsrc2tlpdb index 6989de9be76..a496ad7183f 100755 --- a/Master/tlpkg/bin/tlpsrc2tlpdb +++ b/Master/tlpkg/bin/tlpsrc2tlpdb @@ -19,6 +19,7 @@ use TeXLive::TLPSRC; use TeXLive::TLPOBJ; use TeXLive::TLPDB; use TeXLive::TLTREE; +use TeXLive::TeXCatalogue; use Getopt::Long; use Pod::Usage; use File::Path; @@ -28,29 +29,44 @@ chomp (my $opt_master = `cd $::mydir/../.. && pwd`); our $opt_debug = 0; my $man = 0; my $help = 0; +my $opt_catalogue = ""; GetOptions("debug!", # debug mode - "master=s" => \$opt_master, # location of the tree - 'help|?' => \$help, man => \$man - ) or pod2usage(2); + "master=s" => \$opt_master, # location of the tree + "catalogue=s" => \$opt_catalogue, # location of the TeX Catalogue + 'help|?' => \$help, man => \$man + ) or pod2usage(2); pod2usage(1) if $help; pod2usage(-exitstatus => 0, -verbose => 2) if $man; if (! -d "$opt_master") { - die "Master $opt_master does not exists!"; + die "Master $opt_master does not exists!"; +} + +my $tlc; +if (! -d "$opt_catalogue") { + warn "Catalogue not found, we will continue without using it!"; +} else { + $tlc = TeXLive::TeXCatalogue->new( 'location' => "$opt_catalogue" ); } my $tltree = TeXLive::TLTREE->new( 'svnroot' => "$opt_master" ); $tltree->init_from_svn; + my $tldb = TeXLive::TLPDB->new; foreach my $f (@ARGV) { - my $tlsrc = new TeXLive::TLPSRC; - $tlsrc->from_file($f); - my $tlp = $tlsrc->make_tlpobj($tltree); - $tldb->add_tlpobj($tlp); + my $tlsrc = new TeXLive::TLPSRC; + $tlsrc->from_file($f); + my $tlp = $tlsrc->make_tlpobj($tltree); + # now merge the TeX Catalogue Information, currently only license + my $tlcname = defined($tlp->catalogue) ? $tlp->catalogue : $tlp->name; + if ($tlc) { + $tlp->update_from_catalogue($tlc); + } + $tldb->add_tlpobj($tlp); } $tldb->writeout; @@ -79,6 +95,10 @@ Prints the manual page and exits. The location given by B<-master> must point to a valid svn repository of TeX Live Master direcory. Defaults to ../.. of C<$0>. +=item B<-catalogue> +The location given by B<-catalogue> must point to a valid TeX Catalogue. +No default value. + =item B<-debug> Give debug messages from the TeX Live modules @@ -87,7 +107,10 @@ Give debug messages from the TeX Live modules =head1 DESCRIPTION B<tlpsrc2tlpdb> converts TeX Live Source Package files (tlpsrc) files into a -TeX Live Package Database (tlpdb). +TeX Live Package Database (tlpdb). If a TeX Catalogue is specified additional +information from the catalogue are merged into the TeX Live Database +(see L<TeXLive::TLPOBJ> for the list of included information from +the TeX Catalogue). =head1 AUTHORS AND COPYRIGHT @@ -102,4 +125,4 @@ GNU General Public License Version 2 or later. ### tab-width: 2 ### indent-tabs-mode: nil ### End: -# vim:set tabstop=2: # +# vim:set tabstop=2 expandtab: # |