summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tl-dump-texcatalogue
blob: c410397aa7a9e7a010d8bf8b29626614b098a602 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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;
}