Fix FTBFS with Geopt::Long::Descriptive ≥ 0.99 (#1189458)

Upstream references:
- https://github.com/gfx/mousex-getopt/issues/5
- https://github.com/gfx/mousex-getopt/pull/6
This commit is contained in:
Paul Howarth 2015-02-05 15:01:49 +00:00
parent a3213d0a0b
commit 7b9021153b
2 changed files with 73 additions and 1 deletions

View File

@ -0,0 +1,61 @@
--- t/104_override_usage.t
+++ t/104_override_usage.t
@@ -43,10 +43,17 @@ use Test::Exception;
my $exp = [
'Unknown option: q
',
+ $Getopt::Long::Descriptive::VERSION < 0.099 ?
qq{usage: 104_override_usage.t [-?] [long options...]
\t-? --usage --help Prints this usage information.
\t--foo A foo
}
+ :
+ qq{usage: 104_override_usage.t [-?] [long options...]
+\t-? --usage --help Prints this usage information.
+\t--foo INT A foo
+}
+
];
is_deeply \@MyScript::exception, $exp;
--- t/107_no_auto_help.t
+++ t/107_no_auto_help.t
@@ -60,7 +60,7 @@ END {
warning_like {
throws_ok { Class->new_with_options }
#usage: 107_no_auto_help.t [-?] [long options...]
- qr/^usage: [\d\w]+\Q.t [-?] [long options...]\E.\s+\Q-? --usage --help Prints this usage information.\E.\s+--configfile/ms,
+ qr/^usage: [\d\w]+\Q.t [-?] [long options...]\E.\s+\Q-? --usage --help\E\s+\QPrints this usage information.\E.\s+--configfile/ms,
'usage information looks good';
}
qr/^Specified configfile \'this_value_unimportant\' does not exist, is empty, or is not readable$/,
--- t/109_help_flag.t
+++ t/109_help_flag.t
@@ -40,7 +40,7 @@ foreach my $args ( ['--help'], ['--usage
local @ARGV = @$args;
throws_ok { MyClass->new_with_options() }
- qr/^usage: (?:[\d\w]+)\Q.t [-?] [long options...]\E.^\t\Q-? --usage --help Prints this usage information.\E$/ms,
+ qr/^usage: (?:[\d\w]+)\Q.t [-?] [long options...]\E.^\t\Q-? --usage --help\E\s+\QPrints this usage information.\E$/ms,
'Help request detected; usage information properly printed';
}
--- t/110_sort_usage_by_attr_order.t
+++ t/110_sort_usage_by_attr_order.t
@@ -34,6 +34,16 @@ usage: 110_sort_usage_by_attr_order.t [-
--bar Documentation for "bar"
--baz Documentation for "baz"
USAGE
+if ( $Getopt::Long::Descriptive::VERSION >= 0.099 )
+{
+$expected = <<'USAGE';
+usage: 110_sort_usage_by_attr_order.t [-?] [long options...]
+ -? --usage --help Prints this usage information.
+ --foo STR Documentation for "foo"
+ --bar STR Documentation for "bar"
+ --baz STR Documentation for "baz"
+USAGE
+}
$expected =~ s/^[ ]{4}/\t/xmsg;
is($obj->usage->text, $expected, 'Usage text has nicely sorted options');

View File

@ -1,12 +1,13 @@
Name: perl-MouseX-Getopt
Summary: Mouse role for processing command line options
Version: 0.35
Release: 6%{?dist}
Release: 7%{?dist}
License: GPL+ or Artistic
# Hotfix release with different case, expected to revert to normal in subsequent releases
#URL: http://search.cpan.org/dist/MouseX-Getopt/
URL: http://search.cpan.org/dist/mousex-getopt/
Source0: http://search.cpan.org/CPAN/authors/id/T/TO/TOKUHIROM/mousex-getopt-%{version}.tar.gz
Patch0: mousex-getopt-0.35-G:L:D-0.099.patch
BuildArch: noarch
# Module Build
BuildRequires: perl
@ -53,6 +54,11 @@ objects using parameters passed in from the command line.
%prep
%setup -q -n mousex-getopt-%{version}
# Fix FTBFS with Geopt::Long::Descriptive ≥ 0.99 (#1189458)
# https://github.com/gfx/mousex-getopt/issues/5
# https://github.com/gfx/mousex-getopt/pull/6
%patch0
%build
perl Build.PL --installdirs=vendor
./Build
@ -80,6 +86,11 @@ perl Build.PL --installdirs=vendor
%{_mandir}/man3/MouseX::Getopt::Strict.3*
%changelog
* Thu Feb 5 2015 Paul Howarth <paul@city-fan.org> - 0.35-7
- Fix FTBFS with Geopt::Long::Descriptive 0.99 (#1189458)
https://github.com/gfx/mousex-getopt/issues/5
https://github.com/gfx/mousex-getopt/pull/6
* Sun Sep 07 2014 Jitka Plesnikova <jplesnik@redhat.com> - 0.35-6
- Perl 5.20 re-rebuild of bootstrapped packages