autoconf-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Autoconf source repository branch, master, updated. v2.68-115-


From: Stefano Lattarini
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.68-115-gc3797b8
Date: Sun, 15 Jan 2012 17:08:05 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=c3797b86ccbd96c7353254fc0a36611cfdc4379b

The branch, master has been updated
       via  c3797b86ccbd96c7353254fc0a36611cfdc4379b (commit)
      from  75a5ef5c889bc7db3d560034338e99b2fc88f846 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c3797b86ccbd96c7353254fc0a36611cfdc4379b
Author: Stefano Lattarini <address@hidden>
Date:   Sun Jan 15 09:54:22 2012 +0100

    getopt: remove hack for special handling of "-" argument
    
    Older versions of Getopt::Long acted bogusly and died when they
    where configured with the 'bundling' flag and an argument '-' was
    seen on the command line they were parsing.  That is no longer
    the case though, and has not been for quite a long time: the bug
    is no longer present in the 5.6.2 version of perl and the 2.25
    version of Getopt::Long (and today, the latest versions of perl
    and Getopt::Long are respectively 5.14.2 and 2.38).  The obsolete
    workaround for that Getopt::Long bug can thus be removed from our
    'getopt' function.
    
    It is also worth noting that such a workaround was quite buggy
    and brittle itself; for example, a command like this:
      "autom4te --output -"
    would have caused the incorrect diagnostic:
      "autom4te: option `--output' requires an argument"
    Much worse, a command like this:
      "autom4te --language=autoconf --output - configure.ac"
    would have caused the standard input of autom4te to be processed
    and copied into the 'configure.ac' file, deleting its pre-existing
    content!  Surely not what a user would have expected.
    
    After this change, a command like this:
      autom4te --language=autoconf --output - - <configure.ac >out
    works as expected, processing the input from 'configure.ac' and
    writing it to the 'out' file.
    
    * lib/Autom4te/General.pm (use): Require perl version 5.6.2.
    (getopt): Remove the old workaround.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog               |   33 +++++++++++++++++++++++++++++++++
 lib/Autom4te/General.pm |   10 +---------
 2 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2ab830e..4adfc58 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,36 @@
+2011-01-15  Stefano Lattarini  <address@hidden>
+
+       getopt: remove hack for special handling of "-" argument
+
+       Older versions of Getopt::Long acted bogusly and died when they
+       where configured with the 'bundling' flag and an argument '-' was
+       seen on the command line they were parsing.  That is no longer
+       the case though, and has not been for quite a long time: the bug
+       is no longer present in the 5.6.2 version of perl and the 2.25
+       version of Getopt::Long (and today, the latest versions of perl
+       and Getopt::Long are respectively 5.14.2 and 2.38).  The obsolete
+       workaround for that Getopt::Long bug can thus be removed from our
+       'getopt' function.
+
+       It is also worth noting that such a workaround was quite buggy
+       and brittle itself; for example, a command like this:
+         "autom4te --output -"
+       would have caused the incorrect diagnostic:
+         "autom4te: option `--output' requires an argument"
+       Much worse, a command like this:
+         "autom4te --language=autoconf --output - configure.ac"
+       would have caused the standard input of autom4te to be processed
+       and copied into the 'configure.ac' file, deleting its pre-existing
+       content!  Surely not what a user would have expected.
+
+       After this change, a command like this:
+         autom4te --language=autoconf --output - - <configure.ac >out
+       works as expected, processing the input from 'configure.ac' and
+       writing it to the 'out' file.
+
+       * lib/Autom4te/General.pm (use): Require perl version 5.6.2.
+       (getopt): Remove the old workaround.
+
 2012-01-15  Jim Meyering  <address@hidden>
 
        avoid new warning about undefined $ARGV[0]
diff --git a/lib/Autom4te/General.pm b/lib/Autom4te/General.pm
index 2379ce3..e427aa7 100644
--- a/lib/Autom4te/General.pm
+++ b/lib/Autom4te/General.pm
@@ -32,7 +32,7 @@ used in several executables of the Autoconf and Automake 
packages.
 
 =cut
 
-use 5.005_03;
+use 5.006_002;
 use Exporter;
 use Autom4te::ChannelDefs;
 use Autom4te::Channels;
@@ -244,16 +244,11 @@ rejecting it as a broken option.
 # getopt (%OPTION)
 # ----------------
 # Handle the %OPTION, plus all the common options.
-# Work around Getopt bugs wrt `-'.
 sub getopt (%)
 {
   my (%option) = @_;
   use Getopt::Long;
 
-  # F*k.  Getopt seems bogus and dies when given `-' with `bundling'.
-  # If fixed some day, use this: '' => sub { push @ARGV, "-" }
-  my $stdin = grep /^-$/, @ARGV;
-  @ARGV = grep !/^-$/, @ARGV;
   %option = ("h|help"     => sub { print $help; exit 0 },
             "V|version"  => sub { print $version; exit 0 },
 
@@ -297,9 +292,6 @@ sub getopt (%)
        }
     }
 
-  push @ARGV, '-'
-    if $stdin;
-
   setup_channel 'note', silent => !$verbose;
   setup_channel 'verb', silent => !$verbose;
 }


hooks/post-receive
-- 
GNU Autoconf source repository



reply via email to

[Prev in Thread] Current Thread [Next in Thread]