summaryrefslogtreecommitdiff
path: root/Build/source/texk/tetex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-09-04 17:11:12 +0000
committerKarl Berry <karl@freefriends.org>2011-09-04 17:11:12 +0000
commit75fee74312a8fc2c93b66e4e2ab9b95594c0f00f (patch)
tree0a5f325eef71fc9f68f880fe3abbe3b30ed24895 /Build/source/texk/tetex
parent60b4ec6f2bf1ba57aa206b2ac46c454d75f3bf93 (diff)
parse --setoption separately; from Norbert
git-svn-id: svn://tug.org/texlive/trunk@23807 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/tetex')
-rw-r--r--Build/source/texk/tetex/ChangeLog11
-rwxr-xr-xBuild/source/texk/tetex/updmap.pl44
2 files changed, 47 insertions, 8 deletions
diff --git a/Build/source/texk/tetex/ChangeLog b/Build/source/texk/tetex/ChangeLog
index bbb1aca2108..2f62821a816 100644
--- a/Build/source/texk/tetex/ChangeLog
+++ b/Build/source/texk/tetex/ChangeLog
@@ -1,3 +1,14 @@
+2011-09-04 Norbert Preining <preining@logic.at>
+
+ * updmap.pl (BEGIN): older versions are supported again.
+ (read_for_set_options): new fn.
+ (processOptions): call it, so we call getopt twice,
+ so we can avoid using the =s{1,2} specifier (for --setoption)
+ which needs perl 5.8.8.
+ Also, complain about non-option arguments.
+ http://tug.org/pipermail/tex-live/2011-July/029764.html
+ http://tug.org/pipermail/tex-k/2011-September/002329.html
+
2011-08-26 Karl Berry <karl@tug.org>
* texconfig-dialog: do not invoke tcdialog as fallback,
diff --git a/Build/source/texk/tetex/updmap.pl b/Build/source/texk/tetex/updmap.pl
index 045c2984270..63e9fc52eb9 100755
--- a/Build/source/texk/tetex/updmap.pl
+++ b/Build/source/texk/tetex/updmap.pl
@@ -1,16 +1,13 @@
#! /usr/bin/env perl
# updmap: utility to maintain map files for outline fonts.
#
-# Thomas Esser, (C) 2002.
-# Fabrice Popineau, for the Perl version.
+# Copyright 2002-2011 Thomas Esser.
+# Fabrice Popineau wrote the Perl version.
# Anyone may freely use, modify, and/or distribute this file, without
# limitation.
BEGIN {
$^W=1;
- if ($] < 5.008008) {
- die "$0: Perl version 5.8.8 or newer required. Aborting.\n";
- }
chomp($TEXMFROOT = `kpsewhich -var-value=TEXMFROOT`);
unshift (@INC, "$TEXMFROOT/tlpkg");
}
@@ -200,6 +197,32 @@ EOF
# process cmd line options
#
sub processOptions {
+ #
+ # We parse the command line twice. The first time is to handle
+ # --setoption, which might take either one or two following values.
+ # the second to handle everything else. The Getopt::Long feature to
+ # handle this is only supported in 5.8.8 (released in 2006) or later,
+ # and a few people run older perls.
+ #
+ my $oldconfig = Getopt::Long::Configure(qw(pass_through));
+ #
+ sub read_for_set_options {
+ my ($setopt, $val) = @_;
+ # check if = occurs in $val, if not, get the next argument
+ if ($val =~ m/=/) {
+ push (@setoptions, $val);
+ } else {
+ my $vv = shift @ARGV;
+ die "$0: --setoption $val given with no value; try --help.\n"
+ if !defined($vv);
+ push (@setoptions, "$val=$vv");
+ }
+ }
+ GetOptions("setoption=s@" => \&read_for_set_options)
+ || die "$0: could not read for --setoption; try --help.\n";
+
+ # restore old getopt config and read everything else.
+ Getopt::Long::Configure($oldconfig);
unless (&GetOptions (
"cnffile=s" => \$cnfFile,
"copy" => \$copy,
@@ -217,13 +240,18 @@ sub processOptions {
"outputdir=s" => \$outputdir,
"pdftexoutputdir=s" => \$pdftexoutputdir,
"q|quiet|silent" => \$quiet,
- "setoption=s{1,2}" => \@setoptions,
+ "setoption" =>
+ sub {die "$0: --setoption needs an option and value; try --help.\n"},
"showoptions=s" => \@showoptions,
"syncwithtrees" => \$syncwithtrees,
"version" => sub { print &version(); exit(0); },
"h|help" => \$opt_help)) {
die "Try \"$0 --help\" for more information.\n";
}
+
+ if (@ARGV) {
+ warn "$0: Ignoring unexpected non-option argument(s): @ARGV.\n";
+ }
if ($outputdir) {
$dvipsoutputdir = $outputdir if (! $dvipsoutputdir);
@@ -578,7 +606,7 @@ sub setOption {
if ($opt eq "LW35") {
if ($val !~ m/^(URWkb|URW|ADOBE|ADOBEkb)$/) {
- die "$0: Invalid value $val for option $opt.\n";
+ die "$0: Invalid value $val for option $opt; try --help.\n";
}
} elsif ($opt =~
m/^(dvipsPreferOutline|dvipsDownloadBase35|(pdftex|dvipdfm)DownloadBase14)$/) {
@@ -586,7 +614,7 @@ m/^(dvipsPreferOutline|dvipsDownloadBase35|(pdftex|dvipdfm)DownloadBase14)$/) {
die "$0: Invalid value $val for option $opt; should be \"true\" or \"false\".\n";
}
} else {
- die "$0: Unsupported option $opt.\n";
+ die "$0: Unsupported option $opt (value given: $val).\n";
}
# silently accept this old option name, just in case.