Hello community,
here is the log from the commit of package perl-Devel-Hide for openSUSE:Factory
checked in at 2020-02-14 16:38:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Devel-Hide (Old)
and /work/SRC/openSUSE:Factory/.perl-Devel-Hide.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Devel-Hide"
Fri Feb 14 16:38:31 2020 rev:5 rq:774206 version:0.0011
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Devel-Hide/perl-Devel-Hide.changes
2018-06-20 15:34:01.976250611 +0200
+++
/work/SRC/openSUSE:Factory/.perl-Devel-Hide.new.26092/perl-Devel-Hide.changes
2020-02-14 16:38:44.743631593 +0100
@@ -1,0 +2,12 @@
+Thu Feb 13 03:08:47 UTC 2020 - <[email protected]>
+
+- updated to 0.0011
+ see /usr/share/doc/packages/perl-Devel-Hide/Changes
+
+ 0.0011 2020-02-12
+
+ - Fix https://rt.cpan.org/Public/Bug/Display.html?id=120220
+ - Fix https://rt.cpan.org/Public/Bug/Display.html?id=120221
+ - Add -quiet option to suppress some notices
+
+-------------------------------------------------------------------
Old:
----
Devel-Hide-0.0010.tar.gz
New:
----
Devel-Hide-0.0011.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Devel-Hide.spec ++++++
--- /var/tmp/diff_new_pack.6tSYwp/_old 2020-02-14 16:38:45.487632007 +0100
+++ /var/tmp/diff_new_pack.6tSYwp/_new 2020-02-14 16:38:45.491632010 +0100
@@ -1,7 +1,7 @@
#
# spec file for package perl-Devel-Hide
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,19 +12,19 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: perl-Devel-Hide
-Version: 0.0010
+Version: 0.0011
Release: 0
%define cpan_name Devel-Hide
Summary: Forces the unavailability of specified Perl modules (for
testing)
License: Artistic-1.0 OR GPL-1.0-or-later
Group: Development/Libraries/Perl
-Url: http://search.cpan.org/dist/Devel-Hide/
-Source0:
https://cpan.metacpan.org/authors/id/F/FE/FERREIRA/%{cpan_name}-%{version}.tar.gz
+Url: https://metacpan.org/release/%{cpan_name}
+Source0:
https://cpan.metacpan.org/authors/id/D/DC/DCANTRELL/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -39,7 +39,7 @@
They _die_ with a message like:
- Can't locate Module/ToHide.pm (hidden)
+ Can't locate Module/ToHide.pm in @INC (hidden)
The original intent of this module is to allow Perl developers to test for
alternative behavior when some modules are not available. In a Perl
@@ -76,20 +76,28 @@
* import()
-Optionally, you can propagate the list of hidden modules to your process'
-child processes, by passing '-from:children' as the first option when you
-use() this module. This works by populating 'PERL5OPT', and is incompatible
-with Taint mode, as explained in perlrun.
+Optionally, you can provide some arguments *before* the list of modules:
+
+* -from:children
+
+propagate the list of hidden modules to your process' child processes. This
+works by populating 'PERL5OPT', and is incompatible with Taint mode, as
+explained in perlrun.
+
+* -quiet
+
+suppresses diagnostic output. You will still get told about errors. This is
+passed to child processes if -from:children is in effect.
%prep
%setup -q -n %{cpan_name}-%{version}
%build
-%{__perl} Makefile.PL INSTALLDIRS=vendor
-%{__make} %{?_smp_mflags}
+perl Makefile.PL INSTALLDIRS=vendor
+make %{?_smp_mflags}
%check
-%{__make} test
+make test
%install
%perl_make_install
++++++ Devel-Hide-0.0010.tar.gz -> Devel-Hide-0.0011.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Hide-0.0010/Changes
new/Devel-Hide-0.0011/Changes
--- old/Devel-Hide-0.0010/Changes 2018-06-15 18:14:29.000000000 +0200
+++ new/Devel-Hide-0.0011/Changes 2020-02-13 00:50:15.000000000 +0100
@@ -1,5 +1,11 @@
Revision history for Perl extension Devel::Hide.
+0.0011 2020-02-12
+
+ - Fix https://rt.cpan.org/Public/Bug/Display.html?id=120220
+ - Fix https://rt.cpan.org/Public/Bug/Display.html?id=120221
+ - Add -quiet option to suppress some notices
+
0.0010 2018-06-15 09:12:54-07:00 America/Los_Angeles
- Makefile.PL: better prereqs declaration
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Hide-0.0010/MANIFEST
new/Devel-Hide-0.0011/MANIFEST
--- old/Devel-Hide-0.0010/MANIFEST 2018-06-15 18:15:03.000000000 +0200
+++ new/Devel-Hide-0.0011/MANIFEST 2020-02-13 00:55:52.000000000 +0100
@@ -10,11 +10,13 @@
t/005lib.t
t/006before.t
t/050child-processes.t Tests -from:children
-t/child.pl
+t/child.pl script run from
t/050child-processes.t
t/090pod.t Tests POD for errors
t/098pod-coverage.t Tests for POD coverage
+t/quiet.t Test that -quiet suppresses (some)
warnings
+t/too-late-quiet.t Test that -quiet doesn't suppress
warnings about not hiding stuff
-t/P.pm Dummy module used in tests (002-006,
050)
+t/P.pm Dummy module used in tests
t/Q.pm "
t/R.pm "
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Hide-0.0010/META.json
new/Devel-Hide-0.0011/META.json
--- old/Devel-Hide-0.0010/META.json 2018-06-15 18:15:03.000000000 +0200
+++ new/Devel-Hide-0.0011/META.json 2020-02-13 00:55:51.000000000 +0100
@@ -4,13 +4,13 @@
"Adriano Ferreira <[email protected]>"
],
"dynamic_config" : 0,
- "generated_by" : "ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter
version 2.150010",
+ "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter
version 2.150010",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
- "version" : "2"
+ "version" : 2
},
"name" : "Devel-Hide",
"no_index" : {
@@ -56,6 +56,6 @@
"web" : "https://github.com/aferreira/cpan-Devel-Hide"
}
},
- "version" : "0.0010",
- "x_serialization_backend" : "JSON::PP version 2.27300"
+ "version" : "0.0011",
+ "x_serialization_backend" : "JSON::PP version 4.02"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Hide-0.0010/META.yml
new/Devel-Hide-0.0011/META.yml
--- old/Devel-Hide-0.0010/META.yml 2018-06-15 18:15:03.000000000 +0200
+++ new/Devel-Hide-0.0011/META.yml 2020-02-13 00:55:51.000000000 +0100
@@ -8,7 +8,7 @@
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 0
-generated_by: 'ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter
version 2.150010'
+generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version
2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -23,5 +23,5 @@
perl: '5.006001'
resources:
repository: https://github.com/aferreira/cpan-Devel-Hide.git
-version: '0.0010'
-x_serialization_backend: 'CPAN::Meta::YAML version 0.012'
+version: '0.0011'
+x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Hide-0.0010/lib/Devel/Hide.pm
new/Devel-Hide-0.0011/lib/Devel/Hide.pm
--- old/Devel-Hide-0.0010/lib/Devel/Hide.pm 2018-06-15 17:54:12.000000000
+0200
+++ new/Devel-Hide-0.0011/lib/Devel/Hide.pm 2020-02-13 00:47:41.000000000
+0100
@@ -4,7 +4,7 @@
use strict;
use warnings;
-our $VERSION = '0.0010';
+our $VERSION = '0.0011';
# blech! package variables
use vars qw( @HIDDEN $VERBOSE );
@@ -67,7 +67,7 @@
}
# Pushes a list to the set of hidden modules/filenames
-# warns about the modules which could not be hidden
+# warns about the modules which could not be hidden (always)
# and about the ones that were successfully hidden (if $VERBOSE)
#
# It works as a batch producing warning messages
@@ -86,7 +86,7 @@
$IS_HIDDEN{$_}++;
}
}
- if ( $VERBOSE && @too_late ) {
+ if ( @too_late ) {
warn __PACKAGE__, ': Too late to hide ', join( ', ', @too_late ), "\n";
}
if ( $VERBOSE && keys %IS_HIDDEN ) {
@@ -113,37 +113,10 @@
}
-# works for perl 5.8.0, uses in-core files
-sub _scalar_as_io8 {
- open my $io, '<', \$_[0]
- or die $!; # this should not happen (perl 5.8 should support this)
- return $io;
-}
-
-# works for perl >= 5.6.1, uses File::Temp
-sub _scalar_as_io6 {
- my $scalar = shift;
- require File::Temp;
- my $io = File::Temp::tempfile();
- print {$io} $scalar;
- seek $io, 0, 0; # rewind the handle
- return $io;
-}
-
-BEGIN {
-
- *_scalar_as_io = ( $] >= 5.008 ) ? \&_scalar_as_io8 : \&_scalar_as_io6;
-
- # _scalar_as_io is one of the two sub's above
-
-}
-
sub _dont_load {
my $filename = shift;
- my $oops;
my $hidden_by = $VERBOSE ? 'hidden' : 'hidden by ' . __PACKAGE__;
- $oops = qq{die "Can't locate $filename ($hidden_by)\n"};
- return _scalar_as_io($oops);
+ die "Can't locate $filename in \@INC ($hidden_by)\n";
}
sub _is_hidden {
@@ -192,21 +165,31 @@
$ENV{PERL5OPT} = join( ' ',
defined($ENV{PERL5OPT}) ? $ENV{PERL5OPT} : (),
- 'MDevel::Hide=' . join(',', @_)
+ '-MDevel::Hide=' . join(',', @_)
);
}
sub import {
shift;
- if( @_ && $_[0] eq '-from:children' ) {
- $HIDE_FROM{children} = 1;
+ while(@_ && $_[0] =~ /^-/) {
+ if( $_[0] eq '-from:children' ) {
+ $HIDE_FROM{children} = 1;
+ } elsif( $_[0] eq '-quiet' ) {
+ $VERBOSE = 0;
+ $HIDE_FROM{children_quietly} = 1;
+ } else {
+ die("Devel::Hide: don't recognize $_[0]\n");
+ }
shift;
}
if (@_) {
_push_hidden(@_);
if ($HIDE_FROM{children}) {
- _append_to_perl5opt(@_);
+ _append_to_perl5opt(
+ ($HIDE_FROM{children_quietly} ? '-quiet' : ()),
+ @_
+ );
}
}
@@ -277,7 +260,7 @@
They I<die> with a message like:
- Can't locate Module/ToHide.pm (hidden)
+ Can't locate Module/ToHide.pm in @INC (hidden)
The original intent of this module is to allow Perl developers
to test for alternative behavior when some modules are not
@@ -330,12 +313,25 @@
=back
-Optionally, you can propagate the list of hidden modules to your
-process' child processes, by passing '-from:children' as the
-first option when you use() this module. This works by populating
+Optionally, you can provide some arguments *before* the
+list of modules:
+
+=over
+
+=item -from:children
+
+propagate the list of hidden modules to your
+process' child processes. This works by populating
C<PERL5OPT>, and is incompatible with Taint mode, as
explained in L<perlrun>.
+=item -quiet
+
+suppresses diagnostic output. You will still get told about
+errors. This is passed to child processes if -from:children
+is in effect.
+
+=back
=head2 CAVEATS
@@ -397,6 +393,8 @@
Copyright (C) 2005-2007, 2018 by Adriano R. Ferreira
+Some parts copyright (C) 2020 by David Cantrell
+
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Hide-0.0010/t/002basic.t
new/Devel-Hide-0.0011/t/002basic.t
--- old/Devel-Hide-0.0010/t/002basic.t 2018-06-15 03:49:25.000000000 +0200
+++ new/Devel-Hide-0.0011/t/002basic.t 2020-02-13 00:40:39.000000000 +0100
@@ -1,18 +1,38 @@
-
use strict;
-use Test::More tests => 5;
-
-use_ok('lib', 't');
-
-# this script tests the standard use statement
-
-use_ok('Devel::Hide', 'Q.pm', 'R');
-
-eval { require P };
-ok(!$@, "P was loaded (as it should)");
+use warnings;
+use Test::More tests => 14;
-eval { require Q };
-like($@, qr/^Can't locate Q\.pm/, "Q not found (as it should)");
+use lib 't';
-eval { require R };
-like($@, qr/^Can't locate R\.pm/, "R not found (as it should)");
+my @expected_warnings;
+BEGIN {
+ push @expected_warnings,
+ 'Devel::Hide hides Q.pm, R.pm';
+ $SIG{__WARN__} = sub {
+ ok($_[0] eq shift(@expected_warnings)."\n",
+ "got expected warning: $_[0]");
+ }
+}
+END { ok(!@expected_warnings, "got all expected warnings") }
+
+use Devel::Hide qw(Q.pm R);
+
+# do this twice, see https://rt.cpan.org/Ticket/Display.html?id=120220
+foreach my $pass (1, 2) {
+ eval { require P };
+ ok(!$@, "nothing moaned about loading P".
+ ($pass == 2 ? ' again' : ''));
+ ok(exists($INC{"P.pm"}), "P is loaded");
+
+ eval { require Q };
+ like($@, qr/^Can't locate Q\.pm in \@INC/,
+ "correctly moaned about loading Q".
+ ($pass == 2 ? ' again' : ''));
+ ok(!exists($INC{"Q.pm"}), "correctly didn't load Q");
+
+ eval { require R };
+ like($@, qr/^Can't locate R\.pm in \@INC/,
+ "correctly moaned about loading Q".
+ ($pass == 2 ? ' again' : ''));
+ ok(!exists($INC{"R.pm"}), "correctly didn't load R");
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Hide-0.0010/t/006before.t
new/Devel-Hide-0.0011/t/006before.t
--- old/Devel-Hide-0.0010/t/006before.t 2018-06-15 03:49:25.000000000 +0200
+++ new/Devel-Hide-0.0011/t/006before.t 2020-02-07 17:48:57.000000000 +0100
@@ -1,13 +1,26 @@
-
use strict;
-use Test::More tests => 4;
+use warnings;
+use Test::More tests => 7;
-use_ok('lib', 't');
+use lib 't';
-# this script tests that already loaded modules can't be hidden
+my @expected_warnings;
+BEGIN {
+ push @expected_warnings,
+ 'Devel::Hide: Too late to hide P.pm',
+ 'Devel::Hide hides Q.pm';
+ $SIG{__WARN__} = sub {
+ ok($_[0] eq shift(@expected_warnings)."\n",
+ "got expected warning: $_[0]");
+ }
+}
+END { ok(!@expected_warnings, "got all expected warnings") }
use_ok('P'); # loads P
-use_ok('Devel::Hide', 'P'); # too late to hide
+use_ok('Devel::Hide', 'P', 'Q'); # too late to hide P
eval { require P };
ok(!$@, "P was loaded (as it should)");
+
+eval { require Q };
+ok($@, "Q was not loaded");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Hide-0.0010/t/050child-processes.t
new/Devel-Hide-0.0011/t/050child-processes.t
--- old/Devel-Hide-0.0010/t/050child-processes.t 2018-06-15
03:49:25.000000000 +0200
+++ new/Devel-Hide-0.0011/t/050child-processes.t 2020-02-11
22:07:18.000000000 +0100
@@ -1,11 +1,19 @@
-
use strict;
-use Devel::Hide qw(-from:children Q.pm R);
+use warnings;
+use Devel::Hide qw(-quiet -from:children Q.pm R);
# Mlib=t is to get around 'use lib' etc being annoying
-$ENV{PERL5OPT} = 'Mlib=t '.$ENV{PERL5OPT};
+$ENV{PERL5OPT} = '-Mblib '.$ENV{PERL5OPT}
+ if($INC{'blib.pm'});
+$ENV{PERL5OPT} = '-Mlib=t '.$ENV{PERL5OPT};
-my $ans = system( $^X, 't/child.pl' );
+# run this script and tell it to:
+# try to load P, Q and R;
+# expect only P to succeed;
+# moan about Q and R
+my $ans = system( $^X, qw(
+ t/child.pl try:PQR succeed:P moan:QR
+) );
exit( $ans >> 8 );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Hide-0.0010/t/child.pl
new/Devel-Hide-0.0011/t/child.pl
--- old/Devel-Hide-0.0010/t/child.pl 2018-06-15 03:49:25.000000000 +0200
+++ new/Devel-Hide-0.0011/t/child.pl 2020-02-07 18:10:06.000000000 +0100
@@ -1,15 +1,31 @@
+use strict;
+use warnings;
-# invoked by "t/050child-processes.t"
+my $warnings;
+BEGIN { $SIG{__WARN__} = sub { $warnings++ } }
+my %args;
+BEGIN {
+ %args = map {
+ my($k, $v) = split(/:/, $_);
+ $k => [split(//, $v)]
+ } @ARGV;
+}
-use strict;
-use Test::More tests => 4;
+# the command line had -MDevel::Hide=-quiet so
+# the warning this generates should be suppressed
+use Devel::Hide 'Q';
+
+use Test::More tests => 2 + @{$args{try}};
ok($ENV{PERL5OPT} =~ /\bMlib=t\b/, "PERL5OPT is added to, not overwritten:
$ENV{PERL5OPT}");
-eval { require P };
-ok(!$@, "P was loaded (as it should)");
-eval { require Q };
-like($@, qr/^Can't locate Q\.pm/, "Q not found (as it should)");
+foreach my $try (@{$args{try}}) {
+ eval "require $try";
+ if(!grep { $_ eq $try } @{$args{moan}}) {
+ ok(!$@, "nothing moaned about loading $try");
+ } else {
+ like($@, qr/^Can't locate $try\.pm/, "correctly moaned about loading
$try");
+ }
+}
-eval { require R };
-like($@, qr/^Can't locate R\.pm/, "R not found (as it should)");
+ok(!$warnings, "suppressed warnings");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Hide-0.0010/t/quiet.t
new/Devel-Hide-0.0011/t/quiet.t
--- old/Devel-Hide-0.0010/t/quiet.t 1970-01-01 01:00:00.000000000 +0100
+++ new/Devel-Hide-0.0011/t/quiet.t 2020-02-07 18:07:32.000000000 +0100
@@ -0,0 +1,15 @@
+use strict;
+use warnings;
+use Test::More tests => 2;
+
+use lib 't';
+
+my $warnings;
+BEGIN { $SIG{__WARN__} = sub { $warnings++ } }
+END { ok(!$warnings, "suppressed warnings"); }
+
+use Devel::Hide qw(-quiet Q);
+
+eval { require Q };
+like($@, qr/^Can't locate Q\.pm in \@INC/,
+ "correctly moaned about loading Q");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Hide-0.0010/t/too-late-quiet.t
new/Devel-Hide-0.0011/t/too-late-quiet.t
--- old/Devel-Hide-0.0010/t/too-late-quiet.t 1970-01-01 01:00:00.000000000
+0100
+++ new/Devel-Hide-0.0011/t/too-late-quiet.t 2020-02-07 17:46:41.000000000
+0100
@@ -0,0 +1,27 @@
+use strict;
+use warnings;
+use Test::More tests => 6;
+
+use lib 't';
+
+my @expected_warnings;
+BEGIN {
+ push @expected_warnings,
+ 'Devel::Hide: Too late to hide P.pm';
+ $SIG{__WARN__} = sub {
+ ok($_[0] eq shift(@expected_warnings)."\n",
+ "got expected warning: $_[0]");
+ }
+}
+END { ok(!@expected_warnings, "got all expected warnings") }
+
+use_ok('P'); # loads P
+
+# too late to hide P. Q will be hidden, but not mentioned
+use_ok('Devel::Hide', '-quiet', 'P', 'Q');
+
+eval { require P };
+ok(!$@, "P was loaded (as it should)");
+
+eval { require Q };
+ok($@, "Q was not loaded");