From: Gurusamy Sarathy Date: Fri, 10 Sep 1999 10:44:54 +0000 (+0000) Subject: upgrade to Getopt::Long v2.20 (from Johan Vromans X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1a505819a5b4ef1e8de31ef21c6ca7dafa3503dc;p=p5sagit%2Fp5-mst-13.2.git upgrade to Getopt::Long v2.20 (from Johan Vromans ) p4raw-id: //depot/perl@4118 --- diff --git a/Changes b/Changes index 2b3fc57..8f41f2f 100644 --- a/Changes +++ b/Changes @@ -79,6 +79,241 @@ Version 5.005_62 Development release working toward 5.006 ---------------- ____________________________________________________________________________ +[ 4117] By: jhi on 1999/09/09 18:24:30 + Log: Remove ill-designed %B introduced by change #4111. + Branch: cfgperl + ! sv.c t/op/sprintf.t +____________________________________________________________________________ +[ 4116] By: jhi on 1999/09/09 15:56:52 + Log: perldeltify change #4115. + Branch: cfgperl + ! pod/perldelta.pod +____________________________________________________________________________ +[ 4115] By: jhi on 1999/09/09 15:48:56 + Log: From: "John L. Allen" + To: perl5-porters@perl.org + Subject: [ID 19990901.003] Time::Local should not croak on "out-of-range" days + Date: Wed, 1 Sep 1999 13:33:39 -0400 (EDT) + Message-Id: <199909011733.NAA17356@gateway.grumman.com> + Branch: cfgperl + ! lib/Time/Local.pm +____________________________________________________________________________ +[ 4114] By: jhi on 1999/09/09 15:42:30 + Log: From: "Daniel S. Lewart" + To: perl5-porters@perl.org + Subject: [ID 19990909.003] MAXINT redefined warning on HP-UX 10.20 + Date: Thu, 9 Sep 1999 10:33:37 -0500 (CDT) + Message-Id: <199909091533.KAA01242@www.cvm.uiuc.edu> + Branch: cfgperl + ! pp_sys.c +____________________________________________________________________________ +[ 4113] By: jhi on 1999/09/09 10:17:45 + Log: From: paul.marquess@bt.com + To: gsar@ActiveState.com + Cc: perl5-porters@perl.org + Subject: [PATCH 5.005_61] DB_File 1.71 + Date: Thu, 9 Sep 1999 11:20:13 +0100 + Message-ID: <5104D4DBC598D211B5FE0000F8FE7EB202D49BBE@mbtlipnt02.btlabs.bt.co.uk> + Branch: cfgperl + + ext/DB_File/version.c + ! MANIFEST ext/DB_File/Changes ext/DB_File/DB_File.pm + ! ext/DB_File/Makefile.PL ext/DB_File/dbinfo ext/DB_File/typemap + ! t/lib/db-btree.t +____________________________________________________________________________ +[ 4112] By: jhi on 1999/09/09 09:05:32 + Log: From: Ilya Zakharevich + To: perl5-porters@perl.org (Mailing list Perl5) + Subject: [PATCH 5.005_58] Fix interaction of (?p{}) and (?>) + Date: Thu, 9 Sep 1999 04:40:11 -0400 (EDT) + Message-Id: <199909090840.EAA26471@monk.mps.ohio-state.edu> + Branch: cfgperl + ! regexec.c t/op/pat.t +____________________________________________________________________________ +[ 4111] By: jhi on 1999/09/09 07:50:07 + Log: %#b in particular and %B in general were kaputt. + Branch: cfgperl + ! sv.c t/op/sprintf.t +____________________________________________________________________________ +[ 4110] By: jhi on 1999/09/09 07:29:17 + Log: Tidy up 64-bit situation in perldelta. + Branch: cfgperl + ! pod/perldelta.pod +____________________________________________________________________________ +[ 4109] By: jhi on 1999/09/09 07:26:53 + Log: Clear up PL_regcc issues. + + From: Ilya Zakharevich + To: perl5-porters@perl.org (Mailing list Perl5) + Subject: [PATCH 5.005_60] Another regexec.c unobfuscation + Date: Thu, 9 Sep 1999 02:49:49 -0400 (EDT) + Message-Id: <199909090649.CAA26119@monk.mps.ohio-state.edu> + Branch: cfgperl + ! regexec.c +____________________________________________________________________________ +[ 4108] By: gsar on 1999/09/08 20:52:51 + Log: avoid ass_u_ming uppercase types are not user objects (spotted + by Kurt Starsinic) + Branch: perl + ! ext/Data/Dumper/Dumper.pm +____________________________________________________________________________ +[ 4107] By: gsar on 1999/09/08 20:35:18 + Log: From: akim@epita.fr (DEMAILLE Akim) + Date: Wed, 8 Sep 1999 18:18:44 +0200 (CEST) + Message-Id: + Subject: [ID 19990908.014] s2p does not quote @ + Branch: perl + ! x2p/s2p.PL +____________________________________________________________________________ +[ 4106] By: gsar on 1999/09/08 20:25:12 + Log: integrate cfgperl contents into mainline + Branch: perl + !> (integrate 30 files) +____________________________________________________________________________ +[ 4105] By: jhi on 1999/09/08 09:02:37 + Log: Minor touches at the [:class:] description. + Branch: cfgperl + ! pod/perlre.pod +____________________________________________________________________________ +[ 4104] By: jhi on 1999/09/08 08:57:58 + Log: From: Ilya Zakharevich + To: Mailing list Perl5 + Subject: [PATCH 5.005_58] Fix debugging output for REx + Date: Wed, 8 Sep 1999 05:02:02 -0400 + Message-ID: <19990908050201.A17682@monk.mps.ohio-state.edu> + Branch: cfgperl + ! regcomp.c +____________________________________________________________________________ +[ 4103] By: gsar on 1999/09/08 00:53:50 + Log: fix memory leak in C + Branch: perl + ! pp.c +____________________________________________________________________________ +[ 4102] By: gsar on 1999/09/08 00:52:50 + Log: fix memory leak in C + Branch: perl + ! cop.h pp_hot.c +____________________________________________________________________________ +[ 4101] By: gsar on 1999/09/07 17:25:07 + Log: various fixups for windows + Branch: perl + ! embed.h embed.pl objXSUB.h op.c perlapi.c proto.h + ! win32/Makefile win32/makefile.mk xsutils.c +____________________________________________________________________________ +[ 4100] By: jhi on 1999/09/07 12:49:15 + Log: Fix pointer casts. + + From: Robin Barker + To: perl5-porters@perl.org + Subject: [ID 19990907.004] [PATCH perl5.005_61] compiler warnings with + -Duse64bits + Date: Tue, 7 Sep 1999 12:30:18 +0100 (BST) + Message-Id: <199909071130.MAA11435@tempest.npl.co.uk> + Branch: cfgperl + ! doio.c dump.c ext/B/B.xs ext/B/typemap + ! ext/ByteLoader/bytecode.h ext/Devel/DProf/DProf.xs + ! ext/DynaLoader/dl_dlopen.xs ext/ODBM_File/ODBM_File.xs + ! ext/POSIX/POSIX.xs lib/ExtUtils/typemap malloc.c perl.h pp.c + ! pp_ctl.c pp_hot.c pp_sys.c sv.c +____________________________________________________________________________ +[ 4099] By: jhi on 1999/09/07 10:29:04 + Log: Add sig/pid/uid size and sign probes. + Branch: metaconfig + + U/typedefs/gidsign.U U/typedefs/gidsize.U U/typedefs/pidsign.U + + U/typedefs/pidsize.U U/typedefs/uidsign.U U/typedefs/uidsize.U +____________________________________________________________________________ +[ 4098] By: jhi on 1999/09/07 10:27:06 + Log: Band-aid until we've got %{Uid_t} or something similar + for sv_catpvfn(). + Branch: cfgperl + ! taint.c +____________________________________________________________________________ +[ 4097] By: jhi on 1999/09/07 09:41:23 + Log: Fix a printf thinko: now quads must have the ll L q prefix. + (in other words, a bare %d is an int/unsigned) + Branch: cfgperl + ! pp_sys.c sv.c t/op/64bit.t +____________________________________________________________________________ +[ 4096] By: jhi on 1999/09/07 07:36:17 + Log: HP-UX 10.20 and gcc 2.8.1 break UINT32_MAX. + + From: "Daniel S. Lewart" + To: perl5-porters@perl.org + Subject: [ID 19990906.007] Not OK: perl 5.00561 on PA-RISC1.1 10.20 + Date: Mon, 6 Sep 1999 21:18:12 -0500 (CDT) + Message-Id: <199909070218.VAA29232@www.cvm.uiuc.edu> + Branch: cfgperl + ! hints/hpux.sh perl.h +____________________________________________________________________________ +[ 4095] By: gsar on 1999/09/06 20:47:02 + Log: applied suggested patch with suitable test to detect MSVC + From: "Vishal Bhatia" + Date: Wed, 11 Aug 1999 01:43:28 -0700 + Message-ID: + Subject: compiler on win32 + Branch: perl + ! ext/B/B/C.pm +____________________________________________________________________________ +[ 4094] By: jhi on 1999/09/06 20:34:44 + Log: Integrate with Sarathy. + Branch: cfgperl + !> ext/B/B/Bytecode.pm lib/Test/Harness.pm t/TEST t/UTEST + !> t/harness t/pragma/sub_lval.t utils/Makefile utils/perlcc.PL +____________________________________________________________________________ +[ 4093] By: jhi on 1999/09/06 20:33:43 + Log: Fix UV_SIZEOF to UVSIZE; change the overflow tests + so that they overflow also on 64-bit platforms. + Branch: cfgperl + ! t/pragma/warn/toke t/pragma/warn/util toke.c util.c +____________________________________________________________________________ +[ 4092] By: gsar on 1999/09/06 20:16:58 + Log: support bytecode and C backends in perlcc (patch suggested + by Tom Hughes ); s/-opt/-noopt/ and make the + C backend the default; describe new switches in pod; introduce + PERLCC_OPTS and s/COMPILE_TIMEOUT/PERLCC_TIMEOUT/; + s/COMPILE_TEST/HARNESS_COMPILE_TEST/; document these %ENV + entries + Branch: perl + ! ext/B/B/Bytecode.pm lib/Test/Harness.pm t/TEST t/UTEST + ! t/harness utils/Makefile utils/perlcc.PL +____________________________________________________________________________ +[ 4091] By: jhi on 1999/09/06 19:10:41 + Log: Integrate with Sarathy. + Branch: cfgperl + +> t/pragma/sub_lval.t + !> (integrate 52 files) +____________________________________________________________________________ +[ 4090] By: gsar on 1999/09/06 19:09:06 + Log: propagate changed error text + Branch: perl + ! t/pragma/sub_lval.t +____________________________________________________________________________ +[ 4089] By: gsar on 1999/09/06 18:54:43 + Log: sprintf doc tweak (from Ian Phillipps ) + Branch: perl + ! pod/perlfunc.pod +____________________________________________________________________________ +[ 4088] By: gsar on 1999/09/06 18:52:10 + Log: From: paul.marquess@bt.com + Date: Sun, 5 Sep 1999 15:11:08 +0100 + Message-ID: <5104D4DBC598D211B5FE0000F8FE7EB202D49BAB@mbtlipnt02.btlabs.bt.co.uk> + Subject: [PATCH 5.005_61] Another patch for Lexical Warnings + Branch: perl + ! pp_sys.c t/pragma/warn/doio t/pragma/warn/op + ! t/pragma/warn/pp_hot t/pragma/warn/pp_sys + ! t/pragma/warn/regcomp t/pragma/warn/sv t/pragma/warn/toke + ! t/pragma/warn/universal t/pragma/warn/utf8 t/pragma/warn/util + ! toke.c +____________________________________________________________________________ +[ 4087] By: gsar on 1999/09/06 18:06:06 + Log: change#3612 is buggy when quotemeta argument matches target + (hope this is the last of the optimized-OP_SASSIGN bugs) + From: Ilya Zakharevich + Date: Sun, 5 Sep 1999 06:07:42 -0400 (EDT) + Message-Id: <199909051007.GAA06423@monk.mps.ohio-state.edu> + Subject: Re: [BUG: quotemeta] + Branch: perl + ! Changes op.c t/op/lex_assign.t +____________________________________________________________________________ [ 4086] By: gsar on 1999/09/06 17:57:52 Log: misc tweaks Branch: perl diff --git a/MANIFEST b/MANIFEST index 6bd774f..d54cb29 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1167,7 +1167,10 @@ t/lib/filepath.t See if File::Path works t/lib/filespec.t See if File::Spec works t/lib/findbin.t See if FindBin works t/lib/gdbm.t See if GDBM_File works -t/lib/getopt.t See if Getopt::Std and Getopt::Long works +t/lib/getopt.t See if Getopt::Std and Getopt::Long work +t/lib/gol-basic.t See if Getopt::Long works +t/lib/gol-compat.t See if Getopt::Long works +t/lib/gol-linkage.t See if Getopt::Long works t/lib/h2ph.h Test header file for h2ph t/lib/h2ph.pht Generated output from h2ph.h by h2ph, for comparison t/lib/h2ph.t See if h2ph works like it should diff --git a/lib/Getopt/Long.pm b/lib/Getopt/Long.pm index c125ccf..479efca 100644 --- a/lib/Getopt/Long.pm +++ b/lib/Getopt/Long.pm @@ -2,22 +2,23 @@ package Getopt::Long; -# RCS Status : $Id: GetoptLong.pl,v 2.18 1998-06-14 15:02:19+02 jv Exp $ +# RCS Status : $Id: GetoptLong.pl,v 2.21 1999-08-04 10:33:07+02 jv Exp $ # Author : Johan Vromans # Created On : Tue Sep 11 15:00:12 1990 # Last Modified By: Johan Vromans -# Last Modified On: Fri Jan 8 14:48:43 1999 -# Update Count : 707 +# Last Modified On: Wed Aug 4 10:08:50 1999 +# Update Count : 709 # Status : Released ################ Copyright ################ # This program is Copyright 1990,1999 by Johan Vromans. # This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# +# modify it under the terms of the Perl Artistic License or the +# GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any +# later version. +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -35,7 +36,7 @@ BEGIN { require 5.004; use Exporter (); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - $VERSION = "2.19"; + $VERSION = "2.20"; @ISA = qw(Exporter); @EXPORT = qw(&GetOptions $REQUIRE_ORDER $PERMUTE $RETURN_IN_ORDER); @@ -108,12 +109,12 @@ __END__ ################ AutoLoading subroutines ################ -# RCS Status : $Id: GetoptLongAl.pl,v 2.20 1998-06-14 15:02:19+02 jv Exp $ +# RCS Status : $Id: GetoptLongAl.pl,v 2.22 1999-07-07 12:57:05+02 jv Exp $ # Author : Johan Vromans # Created On : Fri Mar 27 11:50:30 1998 # Last Modified By: Johan Vromans -# Last Modified On: Sun Jun 14 13:54:35 1998 -# Update Count : 24 +# Last Modified On: Wed Jul 7 12:47:57 1999 +# Update Count : 28 # Status : Released sub GetOptions { @@ -137,7 +138,7 @@ sub GetOptions { print STDERR ("GetOpt::Long $Getopt::Long::VERSION ", "called from package \"$pkg\".", "\n ", - 'GetOptionsAl $Revision: 2.20 $ ', + 'GetOptionsAl $Revision: 2.22 $ ', "\n ", "ARGV: (@ARGV)", "\n ", @@ -164,7 +165,11 @@ sub GetOptions { # See if the first element of the optionlist contains option # starter characters. - if ( $optionlist[0] =~ /^\W+$/ ) { + # Be careful not to interpret '<>' as option starters. + if ( $optionlist[0] =~ /^\W+$/ + && !($optionlist[0] eq '<>' + && @optionlist > 0 + && ref($optionlist[1])) ) { $genprefix = shift (@optionlist); # Turn into regexp. Needs to be parenthesized! $genprefix =~ s/(\W)/\\$1/g; @@ -1118,11 +1123,14 @@ CONFIGURATION OPTIONS), options that start with "+" or "-" may also include their arguments, e.g. "+foo=bar". This is for compatiblity with older implementations of the GNU "getopt" routine. -If the first argument to GetOptions is a string consisting of only -non-alphanumeric characters, it is taken to specify the option starter -characters. Everything starting with one of these characters from the -starter will be considered an option. B +If the first argument to GetOptions (after the optional linkage +specification) is a string consisting of only non-alphanumeric +characters, it is taken to specify the option starter characters. +Everything starting with one of these characters from the starter will +be considered an option. GetOptions will not interpret a leading +"<>" as option starters if the next argument is a reference. To +force "<" and ">" as option starters, use "><". Confusing? Well, +B For convenience, option specifiers may have a leading B<-> or B<-->, so it is possible to write: @@ -1366,9 +1374,10 @@ Johan Vromans Ejvromans@squirrel.nlE This program is Copyright 1990,1999 by Johan Vromans. This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. +modify it under the terms of the Perl Artistic License or the +GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any +later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/t/lib/gol-basic.t b/t/lib/gol-basic.t new file mode 100755 index 0000000..4b25322 --- /dev/null +++ b/t/lib/gol-basic.t @@ -0,0 +1,24 @@ +#!./perl -w + +BEGIN { + chdir 't' if -d 't'; + unshift @INC, '../lib'; +} + +use Getopt::Long 2.17; + +print "1..9\n"; + +@ARGV = qw(-Foo -baR --foo bar); +Getopt::Long::Configure ("no_ignore_case"); +undef $opt_baR; +undef $opt_bar; +print "ok 1\n" if GetOptions ("foo", "Foo=s"); +print ((defined $opt_foo) ? "" : "not ", "ok 2\n"); +print (($opt_foo == 1) ? "" : "not ", "ok 3\n"); +print ((defined $opt_Foo) ? "" : "not ", "ok 4\n"); +print (($opt_Foo eq "-baR") ? "" : "not ", "ok 5\n"); +print ((@ARGV == 1) ? "" : "not ", "ok 6\n"); +print (($ARGV[0] eq "bar") ? "" : "not ", "ok 7\n"); +print (!(defined $opt_baR) ? "" : "not ", "ok 8\n"); +print (!(defined $opt_bar) ? "" : "not ", "ok 9\n"); diff --git a/t/lib/gol-compat.t b/t/lib/gol-compat.t new file mode 100755 index 0000000..a4f807c --- /dev/null +++ b/t/lib/gol-compat.t @@ -0,0 +1,25 @@ +#!./perl -w + +BEGIN { + chdir 't' if -d 't'; + unshift @INC, '../lib'; +} + +require "newgetopt.pl"; + +print "1..9\n"; + +@ARGV = qw(-Foo -baR --foo bar); +$newgetopt::ignorecase = 0; +$newgetopt::ignorecase = 0; +undef $opt_baR; +undef $opt_bar; +print "ok 1\n" if NGetOpt ("foo", "Foo=s"); +print ((defined $opt_foo) ? "" : "not ", "ok 2\n"); +print (($opt_foo == 1) ? "" : "not ", "ok 3\n"); +print ((defined $opt_Foo) ? "" : "not ", "ok 4\n"); +print (($opt_Foo eq "-baR") ? "" : "not ", "ok 5\n"); +print ((@ARGV == 1) ? "" : "not ", "ok 6\n"); +print (($ARGV[0] eq "bar") ? "" : "not ", "ok 7\n"); +print (!(defined $opt_baR) ? "" : "not ", "ok 8\n"); +print (!(defined $opt_bar) ? "" : "not ", "ok 9\n"); diff --git a/t/lib/gol-linkage.t b/t/lib/gol-linkage.t new file mode 100755 index 0000000..a1b2c05 --- /dev/null +++ b/t/lib/gol-linkage.t @@ -0,0 +1,37 @@ +#!./perl -w + +BEGIN { + chdir 't' if -d 't'; + unshift @INC, '../lib'; +} + +use Getopt::Long; + +print "1..18\n"; + +@ARGV = qw(-Foo -baR --foo bar); +Getopt::Long::Configure ("no_ignore_case"); +%lnk = (); +print "ok 1\n" if GetOptions (\%lnk, "foo", "Foo=s"); +print ((defined $lnk{foo}) ? "" : "not ", "ok 2\n"); +print (($lnk{foo} == 1) ? "" : "not ", "ok 3\n"); +print ((defined $lnk{Foo}) ? "" : "not ", "ok 4\n"); +print (($lnk{Foo} eq "-baR") ? "" : "not ", "ok 5\n"); +print ((@ARGV == 1) ? "" : "not ", "ok 6\n"); +print (($ARGV[0] eq "bar") ? "" : "not ", "ok 7\n"); +print (!(exists $lnk{baR}) ? "" : "not ", "ok 8\n"); + +@ARGV = qw(-Foo -baR --foo bar); +Getopt::Long::Configure ("default","no_ignore_case"); +%lnk = (); +my $foo; +print "ok 9\n" if GetOptions (\%lnk, "foo" => \$foo, "Foo=s"); +print ((defined $foo) ? "" : "not ", "ok 10\n"); +print (($foo == 1) ? "" : "not ", "ok 11\n"); +print ((defined $lnk{Foo}) ? "" : "not ", "ok 12\n"); +print (($lnk{Foo} eq "-baR") ? "" : "not ", "ok 13\n"); +print ((@ARGV == 1) ? "" : "not ", "ok 14\n"); +print (($ARGV[0] eq "bar") ? "" : "not ", "ok 15\n"); +print (!(exists $lnk{foo}) ? "" : "not ", "ok 16\n"); +print (!(exists $lnk{baR}) ? "" : "not ", "ok 17\n"); +print (!(exists $lnk{bar}) ? "" : "not ", "ok 18\n");