diff options
author | Karl Berry <karl@freefriends.org> | 2008-01-30 19:46:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-01-30 19:46:26 +0000 |
commit | c27794c728b94c0ba9b8129ad321ca213ddb226f (patch) | |
tree | ae0e6705dc8504091bee82d88100be186d7504c9 | |
parent | 32007571a8759ecd90104eb8f3dfc47065680007 (diff) |
we will use generate-updmap instead of this
git-svn-id: svn://tug.org/texlive/trunk@6450 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-x | Master/tlpkg/bin/tlpdb2updmap | 162 |
1 files changed, 0 insertions, 162 deletions
diff --git a/Master/tlpkg/bin/tlpdb2updmap b/Master/tlpkg/bin/tlpdb2updmap deleted file mode 100755 index bd084eba8cd..00000000000 --- a/Master/tlpkg/bin/tlpdb2updmap +++ /dev/null @@ -1,162 +0,0 @@ -#!/usr/bin/env perl -# $Id: tlpdb2list 5188 2007-10-14 20:32:44Z karl $ -# Copyright 2007 Karl Berry. -# This file is licensed under the GNU General Public License version 2 -# or any later version. -# -# Update the map files in updmap.cfg from tlpdb -- a convenience, since -# the only other way to enable new maps is to do an install. (updmap -# --syncwithtrees disables old maps, but does not enable new.) - -BEGIN { - $^W = 1; - ($mydir = $0) =~ s,/[^/]*$,,; - unshift (@INC, "$mydir/.."); -} - -use strict; - -use TeXLive::TLConfig; -use TeXLive::TLPOBJ; -use TeXLive::TLPDB; -use Getopt::Long; -use Pod::Usage; -use File::Path; - -our $NEW_UPDMAP_CFG; - -our $mydir; -my $opt_debug = 0; -my $help = 0; - -GetOptions("debug!", "help|?" => \$help) or pod2usage(1); - -pod2usage(-exitstatus => 0, -verbose => 2) if $help; - -if ($opt_debug) { - $::LOGLEVELFILE = $::LOG_DDDEBUG; - $::LOGLEVELTERMINAL = $::LOG_DDDEBUG; -} - -exit (&main ()); - -sub main -{ - # get the db. - chomp (my $Master = `cd $mydir/../.. && pwd`); # xx TLPDB should default - my $tlpdb = TeXLive::TLPDB->new ("root" => "$Master"); - - # get list of packages. - my %maps; - for my $pkg ($tlpdb->list_packages) { - my $obj = $tlpdb->get_package ($pkg); - die "$0: no TeX Live package named $pkg in $Master.\n" if ! $obj; - - # record any maps. - my @executes = $obj->executes; - for (my $e = 0; $e < @executes; $e++) { - my ($action,$value) = split (" ", $executes[$e]); - if ($action =~ /add.*Map/) { - $maps{$action} .= " " if exists $maps{$action}; - $maps{$action} .= $value; - } - } - } - - return &update_updmap_cfg ($Master, %maps); -} - - - -# update updmap.cfg per MAPS. -# -sub update_updmap_cfg -{ - my ($Master, %maps) = @_; - - # read old file. - my $UPDMAP_CFG = "$Master/texmf/web2c/updmap.cfg"; - my @updmap = `cat $UPDMAP_CFG`; - - # find last comment line (which is where the maps start). - my $last_comment; - for ($last_comment = $#updmap; $last_comment >= 0; $last_comment--) { - last if $updmap[$last_comment] =~ /^#/; - } - die "no last comment in $UPDMAP_CFG?!" if $last_comment < 0; - - # write new file. - local *NEW_UPDMAP_CFG; - my $new_updmap_cfg = "$UPDMAP_CFG.new"; # just the filename - $NEW_UPDMAP_CFG = ">$new_updmap_cfg"; # for open - open (NEW_UPDMAP_CFG) || die "open($NEW_UPDMAP_CFG) failed: $!"; - - # first copy everything up to and including the last comment. - for (my $i = 0; $i <= $last_comment; $i++) { - print NEW_UPDMAP_CFG $updmap[$i]; - } - - # add our map lines, preserving alphabetical order. - for my $action (sort keys %maps) { - my @maps = split (/ /, $maps{$action}); - (my $key = $action) =~ s/^add//; # addMap in tlp, Map in updmap.cfg - @maps = map { "$key $_\n" } sort @maps; - print NEW_UPDMAP_CFG @maps; - } - close (NEW_UPDMAP_CFG) || warn "close($NEW_UPDMAP_CFG) failed: $!"; - - # show differences. - print `diff $UPDMAP_CFG $new_updmap_cfg`; - my $ret = $? / 8; - if ($ret == 0) { - unlink ($new_updmap_cfg) || die "unlink($new_updmap_cfg) failed: $!"; - } - - return $ret; -} - -__END__ - -=head1 NAME - -tlpdb2updmap - update updmap.cfg from a TeX Live database - -=head1 SYNOPSIS - -tlpdb2updmap [OPTION]... - -=head1 OPTIONS - -The standard options C<-help> and C<-debug> are accepted. -See the tlpfiles documentation for details. - -=head1 DESCRIPTION - -B<tlpdb2updmap> creates an updated C<updmap.cfg> file in a TL tree with -the C<Map> and C<MixedMap> entries in the TL database. - -C<updmap.cfg> is assumed to be found in -C<Master/texmf/web2c/updmap.cfg>, where C<Master/> is C<../..> of -C<$0>. - -The new file is written to C<updmap.cfg.new> in that same directory, if -there are any changes. A diff is also shown, and the exit status is one. - -Exit status is zero if no differences. - -No repository actions are performed in any case. - -=head1 AUTHORS AND COPYRIGHT - -This script and its documentation were written for the TeX Live -distribution (L<http://tug.org/texlive>) and both are licensed under the -GNU General Public License Version 2 or later. - -=cut - -### Local Variables: -### perl-indent-level: 2 -### tab-width: 2 -### indent-tabs-mode: nil -### End: -# vim:set tabstop=2: # |