summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/bin')
-rwxr-xr-xMaster/tlpkg/bin/tl-dump-texcatalogue37
-rwxr-xr-xMaster/tlpkg/bin/tl-update-auto19
-rwxr-xr-xMaster/tlpkg/bin/tl-update-tlpdb22
3 files changed, 71 insertions, 7 deletions
diff --git a/Master/tlpkg/bin/tl-dump-texcatalogue b/Master/tlpkg/bin/tl-dump-texcatalogue
new file mode 100755
index 00000000000..c410397aa7a
--- /dev/null
+++ b/Master/tlpkg/bin/tl-dump-texcatalogue
@@ -0,0 +1,37 @@
+#!/usr/bin/env perl
+# $Id$
+# Copyright 2012 Norbert Preining
+# This file is licensed under the GNU General Public License version 2
+# or any later version.
+#
+# Write a parsable representation of the catalogue to stdout
+# run from cron.tl
+
+BEGIN {
+ $^W = 1;
+ chomp ($mydir = `dirname $0`);
+ unshift (@INC, "$mydir/..");
+}
+
+use strict;
+$^W = 1;
+use Data::Dumper;
+use TeXLive::TeXCatalogue;
+
+exit (&main ());
+
+sub main {
+ if (@ARGV != 1) {
+ die "Usage: $0 /PATH/TO/CATALOGUE\n";
+ }
+
+ my $texcatalogue = TeXLive::TeXCatalogue->new(location => $ARGV[0]);
+
+ $Data::Dumper::Indent = 1;
+ $Data::Dumper::Sortkeys = 1; # stable output
+ $Data::Dumper::Purity = 1; # recursive structures must be safe
+ print Data::Dumper->Dump([\$texcatalogue], [qw(tlc)]);
+
+ return 0;
+}
+
diff --git a/Master/tlpkg/bin/tl-update-auto b/Master/tlpkg/bin/tl-update-auto
index 6e3f3f1ded4..a664da9dcf1 100755
--- a/Master/tlpkg/bin/tl-update-auto
+++ b/Master/tlpkg/bin/tl-update-auto
@@ -249,6 +249,25 @@ fi
fi # !config_scripts_only
+# texcatalogue.data
+#
+if $config_scripts_only; then :; else
+$mydir/tl-dump-texcatalogue /home/httpd/html/catalogue >$temp.tcdata.new
+#
+tcdatafile=texmf/scripts/texlive/var/texcatalogue.data
+#
+if test ! -s $temp.tcdata.new; then
+ $verbose " $temp.tcdata.new empty, skipping."
+elif $diff $tcdatafile $temp.tcdata.new >$temp.tcdata.diff; then
+ $verbose " $tcdatafile ok."
+else
+ $chicken $cp $temp.tcdata.new $tcdatafile
+ update_list="$update_list $tcdatafile"
+fi
+fi # !config_scripts_only
+
+
+
# ctan mirror list from ctan.
if $config_scripts_only; then :; else
if test `date +%w` = 0; then # only update on Sundays
diff --git a/Master/tlpkg/bin/tl-update-tlpdb b/Master/tlpkg/bin/tl-update-tlpdb
index fe98834223c..1dd4fcf683f 100755
--- a/Master/tlpkg/bin/tl-update-tlpdb
+++ b/Master/tlpkg/bin/tl-update-tlpdb
@@ -20,6 +20,7 @@ use TeXLive::TLPOBJ;
use TeXLive::TLPDB;
use TeXLive::TLTREE;
use TeXLive::TLUtils;
+use TeXLive::TeXCatalogue;
use Getopt::Long;
use Pod::Usage;
use File::Path;
@@ -72,20 +73,27 @@ sub main
die "$progname: Master $opt_master not a directory, goodbye.\n";
}
+ $opt_catalogue = "$opt_master/texmf/scripts/texlive/var/texcatalogue.data"
+ if ! $opt_catalogue;
+
if ($opt_dry_run) {
$opt_no_commit = 1;
$opt_no_revision_check = 1;
$opt_output = "/tmp/tlut" if ! $opt_output;
- $opt_catalogue = "/home/httpd/html/catalogue" if ! $opt_catalogue;
}
- my $tlc = undef;
- if (! -d $opt_catalogue) {
- info ("$progname: -c /Cat/a/logue not given, continuing without it.\n");
+ our $tlc = undef;
+ if (!$opt_keep_catalogue) {
+ if (-r $opt_catalogue) {
+ info ("$progname: reading TeX Catalogue $opt_catalogue ...\n");
+ require($opt_catalogue);
+ #$tlc = TeXLive::TeXCatalogue->new ("location" => $opt_catalogue);
+ } else {
+ tlwarn("$progname: Cannot find $opt_catalogue, reuse old data!\n");
+ $opt_keep_catalogue = 1;
+ }
} else {
- require TeXLive::TeXCatalogue; # not at compile time, for now anyway.
- info ("$progname: reading TeX Catalogue $opt_catalogue ...\n");
- $tlc = TeXLive::TeXCatalogue->new ("location" => $opt_catalogue);
+ info ("$progname: reusing old catalogue data from tlpdb\n");
}
my $oldtlpdb;