summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-rw-r--r--Master/tlpkg/dev/multi-updmap.pl35
1 files changed, 30 insertions, 5 deletions
diff --git a/Master/tlpkg/dev/multi-updmap.pl b/Master/tlpkg/dev/multi-updmap.pl
index 9704570bad9..a56b611e2a0 100644
--- a/Master/tlpkg/dev/multi-updmap.pl
+++ b/Master/tlpkg/dev/multi-updmap.pl
@@ -9,7 +9,7 @@
# Original shell script (C) 2002 Thomas Esser
# first perl variant (C) Fabrice Popineau
# later adaptions by Reinhard Kotucha and Karl Berry
-# the original version were licensed under the following agreement:
+# the original versions were licensed under the following agreement:
# Anyone may freely use, modify, and/or distribute this file, without
# limitation.
#
@@ -810,11 +810,36 @@ sub locateMap {
sub processOptions {
# first process the stupid setoption= s@{1,2} which is not accepted
my $oldconfig = Getopt::Long::Configure(qw(pass_through));
- my @setoptions;
- my @enable;
- GetOptions("setoption=s{1,2}" => \@setoptions,
- "enable=s{1,2}" => \@enable) or
+ our @setoptions;
+ our @enable;
+ #GetOptions("setoption=s{1,2}" => \@setoptions,
+ # "enable=s{1,2}" => \@enable) or
+ # die "Try \"$prg --help\" for more information.\n";
+
+ # try to work around missing s{1,2} support in older perls
+ sub read_one_or_two {
+ my ($opt, $val) = @_;
+ our @setoptions;
+ our @enable;
+ # check if = occirs in $val, if not, get the next argument
+ if ($val =~ m/=/) {
+ if ($opt eq "setoption") {
+ push @setoptions, $val;
+ } else {
+ push @enable, $val;
+ }
+ } else {
+ if ($opt eq "setoption") {
+ push @setoptions, "$val=" . shift @ARGV;
+ } else {
+ push @enable, "$val=" . shift @ARGV;
+ }
+ }
+ }
+ GetOptions("setoption=s@" => \&read_one_or_two,
+ "enable=s@" => \&read_one_or_two) or
die "Try \"$prg --help\" for more information.\n";
+
Getopt::Long::Configure($oldconfig);
# now revamp the @setoptions that they have the proper style