From 5ab926badb5ad24f8b4b994ad5f18f0d2b3a6953 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 10 Jan 2008 10:53:59 +0000 Subject: add logging facilities, see extra email git-svn-id: svn://tug.org/texlive/trunk@6176 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/bin/tlpsrc2tlpdb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'Master/tlpkg/bin/tlpsrc2tlpdb') diff --git a/Master/tlpkg/bin/tlpsrc2tlpdb b/Master/tlpkg/bin/tlpsrc2tlpdb index f543ec89721..ecfd64dbb06 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::TLUtils; use Getopt::Long; use Pod::Usage; use File::Path; @@ -26,7 +27,7 @@ use File::Path; my $opt_all = 0; my $opt_catalogue = ""; chomp (my $opt_master = `cd $::mydir/../.. && pwd`); -our $opt_debug = 0; +my $opt_debug = 0; my $help = 0; my $opt_nobinsplit = 0; @@ -39,6 +40,11 @@ GetOptions( pod2usage(-exitstatus => 0, -verbose => 2) if $help; +if ($opt_debug) { + $::LOGLEVELFILE = $::LOG_DDDEBUG; + $::LOGLEVELTERMINAL = $::LOG_DDDEBUG; +} + exit (&main ()); @@ -50,10 +56,10 @@ sub main my $tlc = undef; if (! -d $opt_catalogue) { - warn "$0: -c /Cat/a/logue not given, continuing without it.\n"; + tllog($::LOG_NORMAL, "$0: -c /Cat/a/logue not given, continuing without it.\n"); } else { require TeXLive::TeXCatalogue; # not at compile time, for now anyway. - warn "$0: reading TeX Catalogue tree $opt_catalogue ...\n"; + tllog($::LOG_NORMAL, "$0: reading TeX Catalogue tree $opt_catalogue ...\n"); $tlc = TeXLive::TeXCatalogue->new( "location" => $opt_catalogue ); } @@ -64,11 +70,11 @@ sub main @ARGV = glob ("*.tlpsrc"); } - warn "$0: reading Master tree $opt_master ...\n"; + tllog($::LOG_NORMAL, "$0: reading Master tree $opt_master ...\n"); my $tltree = TeXLive::TLTREE->new( "svnroot" => $opt_master ); $tltree->init_from_svn; - warn "$0: updating from tlpsrc ...\n"; + tllog($::LOG_NORMAL, "$0: updating from tlpsrc ...\n"); my $tldb = TeXLive::TLPDB->new; my $last = ""; my $src_count = 0; @@ -109,7 +115,7 @@ sub main if ($opt_all) { $tldb->root("$opt_master"); $tldb->save; - warn "$0: wrote $src_count packages ", $tldb->root, ".\n"; + tllog($::LOG_NORMAL, "$0: wrote $src_count packages ", $tldb->root, ".\n"); } else { $tldb->writeout; } -- cgit v1.2.3