Bug#864544: libgetopt-long-descriptive-perl: option value : and :+ processing are very broken
Joel Roth
joelz at pobox.com
Sat Jun 10 12:44:17 UTC 2017
On Sat, Jun 10, 2017 at 12:35:55PM +0100, Graham Cobb wrote:
> Package: libgetopt-long-descriptive-perl
> Version: 0.100-1
> Severity: important
>
> Dear Maintainer,
>
> I have just realised that a long-established cron job is not doing what it should as
> Getopt::Long processing of option values is broken. I do not know when this happened.
> It used to work but it no longer does so, and I notice that Getopt::Long in debian
> seems to have been replaced by Getopt::Long::Descriptive. I assume that
> Getopt::Long::Descriptive is the problem but I have not gone back and tested with the
> CPAN version of Getopt::Long to be sure.
Getopt::Long is provided by perl core. It does not need to
be installed separately.
$ dpkg -l libgetopt-long-perl
dpkg-query: no packages found matching libgetopt-long-perl
$ /usr/bin/perl -MGetopt::Long -e 1
(returns with no error)
> The problem is that the implementation of ":i" and ":+" is wrong, compared with the
> documentation of (and earlier behaviour of) Getopt::Long.
If this is a bug, I believe it needs to be filed against the 'perl'
package.
> The examples below use the following test script (getopt-test.pl):
>
> #!/usr/bin/perl
> use strict;
> use warnings;
> use Getopt::Long 2.33 qw(:config gnu_getopt auto_help auto_version);
> my $VERBOSITY = 0;
> my $HISTORY = 0;
> GetOptions(
> "verbose|v:+" => \$VERBOSITY,
> "history|h:1" => \$HISTORY
> );
> print "VERBOSITY = $VERBOSITY\n";
> print "HISTORY = $HISTORY\n";
>
> The first problem is that ":1" does not allow the value to be set except using "=".
> For example, none of the following commands set the value of $HISTORY:
>
> getopt-test.pl -h
> getopt-test.pl -h 2
> getopt-test.pl -h2
> getopt-test.pl --history
> getopt-test.pl --history 2
>
> The second problem is that ":+" does not increment the value.
> For example, none of the following commands set the value of $VERBOSITY:
>
> getopt-test.pl -v
> getopt-test.pl -vvvv
> getopt-test.pl -v3
> getopt-test.pl --verbose
> getopt-test.pl --verbose 2
>
> Extracts from the documentation of Getopt::Long:
>
> : number [ desttype ]
> Like :i, but if the value is omitted, the number will be assigned.
> : + [ desttype ]
> Like :i, but if the value is omitted, the current value for the option will be incremented.
>
> If this bug is in the upstream version of Getopt::Long::Descriptive and cannot be fixed,
> then debian should revert to packaging Getopt::Long.
>
> -- System Information:
> Debian Release: 9.0
> APT prefers testing
> APT policy: (500, 'testing')
> Architecture: amd64
> (x86_64)
> Foreign Architectures: i386
>
> Kernel: Linux 4.9.0-3-amd64 (SMP w/8 CPU cores)
> Locale: LANG=en_IE.utf8, LC_CTYPE=en_IE.utf8 (charmap=UTF-8) (ignored: LC_ALL set to en_IE.utf8)
> Shell: /bin/sh linked to /bin/bash
> Init: systemd (via /run/systemd/system)
>
> Versions of packages libgetopt-long-descriptive-perl depends on:
> ii libio-stringy-perl 2.111-2
> ii libparams-validate-perl 1.26-1
> ii libsub-exporter-perl 0.986-1
> ii perl 5.24.1-2
>
> libgetopt-long-descriptive-perl recommends no packages.
>
> libgetopt-long-descriptive-perl suggests no packages.
>
> -- no debconf information
>
> _______________________________________________
> pkg-perl-maintainers mailing list
> pkg-perl-maintainers at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-maintainers
--
Joel Roth
More information about the pkg-perl-maintainers
mailing list