summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tlpsrc2tlpdb
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/bin/tlpsrc2tlpdb')
-rwxr-xr-xMaster/tlpkg/bin/tlpsrc2tlpdb43
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: #