From 942de74ec1f9e64ded85ebf46d9b85b5a8a666cf Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 5 Sep 2007 11:49:22 +0000 Subject: small fixes to the two binaries to work with -catalogue git-svn-id: svn://tug.org/texlive/trunk@4884 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/bin/tlpsrc2tlpdb | 5 +++-- Master/tlpkg/bin/tlpsrc2tlpobj | 23 +++++++++++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) (limited to 'Master') diff --git a/Master/tlpkg/bin/tlpsrc2tlpdb b/Master/tlpkg/bin/tlpsrc2tlpdb index c6f1f10f0e6..451872591c4 100755 --- a/Master/tlpkg/bin/tlpsrc2tlpdb +++ b/Master/tlpkg/bin/tlpsrc2tlpdb @@ -47,7 +47,7 @@ my $tlc; if (! -d "$opt_catalogue") { warn "$0: -d /Cat/a/logue not given, continuing without it.\n"; } else { - require "TeXLive::TeXCatalogue"; # not at compile time, for now anyway. + require TeXLive::TeXCatalogue; # not at compile time, for now anyway. $tlc = TeXLive::TeXCatalogue->new( 'location' => "$opt_catalogue" ); } @@ -97,7 +97,8 @@ 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. +No default value. If given, the generated tlpobj files will contain information +gathered from the TeX Catalogue. =item B<-debug> Give debug messages from the TeX Live modules diff --git a/Master/tlpkg/bin/tlpsrc2tlpobj b/Master/tlpkg/bin/tlpsrc2tlpobj index f6e854b077a..40f68494887 100755 --- a/Master/tlpkg/bin/tlpsrc2tlpobj +++ b/Master/tlpkg/bin/tlpsrc2tlpobj @@ -8,7 +8,7 @@ BEGIN { $^W = 1; - ($mydir = $0) =~ s,/[^/]*$,,; + chomp ($mydir = `dirname $0`); unshift (@INC, "$mydir/.."); } @@ -27,9 +27,11 @@ my $opt_outputdir = "./tlpobj"; 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 + "catalogue=s" => \$opt_catalogue, # location of the TeX Catalogue "outputdir=s" => \$opt_outputdir, 'help|?' => \$help, man => \$man ) or pod2usage(2); @@ -44,7 +46,15 @@ if (! -d "$opt_master") { if (! -d "$opt_outputdir") { mkpath("$opt_outputdir") or die "Cannot mkdir $opt_outputdir!"; } - + +my $tlc; +if (! -d "$opt_catalogue") { + warn "$0: -d /Cat/a/logue not given, continuing without it.\n"; +} else { + require TeXLive::TeXCatalogue; # not at compile time, for now anyway. + $tlc = TeXLive::TeXCatalogue->new( 'location' => "$opt_catalogue" ); +} + my $tltree = TeXLive::TLTREE->new( 'svnroot' => "$opt_master" ); $tltree->init_from_svn; @@ -52,6 +62,10 @@ foreach my $f (@ARGV) { my $tlsrc = new TeXLive::TLPSRC; $tlsrc->from_file($f); my $tlp = $tlsrc->make_tlpobj($tltree); + my $tlcname = defined($tlp->catalogue) ? $tlp->catalogue : $tlp->name; + if ($tlc) { + $tlp->update_from_catalogue($tlc); + } my $name = $tlp->name; open(FOO,">$opt_outputdir/$name.tlpobj") or die "Cannot create $opt_outputdir/$name.tlpobj!"; $tlp->writeout(\*FOO); @@ -83,6 +97,11 @@ 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 /src/TeX/texlive-svn/Master +=item B<-catalogue> +The location given by B<-catalogue> must point to a valid TeX Catalogue. +No default value. If given, the generated tlpobj files will contain information +gathered from the TeX Catalogue. + =item B<-outputdir> Specifies the location where tlp files are created. Defaults to ./tlp -- cgit v1.2.3