Hello community, here is the log from the commit of package perl-Safe-Isa for openSUSE:Factory checked in at 2016-11-10 13:27:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Safe-Isa (Old) and /work/SRC/openSUSE:Factory/.perl-Safe-Isa.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Safe-Isa" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Safe-Isa/perl-Safe-Isa.changes 2014-09-22 09:23:40.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Safe-Isa.new/perl-Safe-Isa.changes 2016-11-10 13:27:38.000000000 +0100 @@ -1,0 +2,11 @@ +Tue Nov 1 07:13:35 UTC 2016 - [email protected] + +- updated to 1.000006 + see /usr/share/doc/packages/perl-Safe-Isa/Changes + + 1.000006 - 2016-10-31 + - now falling back to $obj->isa if DOES/does is not implemented on the + object, to avoid fatal errors on perls too old to have their own DOES + (RT#100866) + +------------------------------------------------------------------- Old: ---- Safe-Isa-1.000005.tar.gz New: ---- Safe-Isa-1.000006.tar.gz cpanspec.yml ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Safe-Isa.spec ++++++ --- /var/tmp/diff_new_pack.tMq0kh/_old 2016-11-10 13:27:39.000000000 +0100 +++ /var/tmp/diff_new_pack.tMq0kh/_new 2016-11-10 13:27:39.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package perl-Safe-Isa # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2016 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 @@ -17,14 +17,15 @@ Name: perl-Safe-Isa -Version: 1.000005 +Version: 1.000006 Release: 0 %define cpan_name Safe-Isa Summary: Call isa, can, does and DOES safely on things that may not be objects License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Safe-Isa/ -Source: http://www.cpan.org/authors/id/E/ET/ETHER/%{cpan_name}-%{version}.tar.gz +Source0: http://www.cpan.org/authors/id/H/HA/HAARG/%{cpan_name}-%{version}.tar.gz +Source1: cpanspec.yml BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl @@ -62,13 +63,11 @@ Note that we don't handle trying class names, because many things are valid class names that you might not want to treat as one (like say "Matt") - the -'is_module_name' function from the Module::Runtime manpage is a good way to -check for something you might be able to call methods on if you want to do -that. +'is_module_name' function from Module::Runtime is a good way to check for +something you might be able to call methods on if you want to do that. %prep %setup -q -n %{cpan_name}-%{version} -find . -type f -print0 | xargs -0 chmod 644 %build %{__perl} Makefile.PL INSTALLDIRS=vendor ++++++ Safe-Isa-1.000005.tar.gz -> Safe-Isa-1.000006.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Safe-Isa-1.000005/Changes new/Safe-Isa-1.000006/Changes --- old/Safe-Isa-1.000005/Changes 2014-08-17 00:15:44.000000000 +0200 +++ new/Safe-Isa-1.000006/Changes 2016-10-31 23:08:01.000000000 +0100 @@ -1,5 +1,10 @@ Revision history for Safe-Isa +1.000006 - 2016-10-31 + - now falling back to $obj->isa if DOES/does is not implemented on the + object, to avoid fatal errors on perls too old to have their own DOES + (RT#100866) + 1.000005 - 2014-08-16 - comment blessed use so people who don't know perl stop trying to break it - add link to lightning talk given at YAPC::NA 2013 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Safe-Isa-1.000005/MANIFEST new/Safe-Isa-1.000006/MANIFEST --- old/Safe-Isa-1.000005/MANIFEST 2014-08-17 00:15:55.000000000 +0200 +++ new/Safe-Isa-1.000006/MANIFEST 2016-10-31 23:08:10.000000000 +0100 @@ -1,10 +1,9 @@ Changes lib/Safe/Isa.pm -maint/bump-version -maint/Makefile.include maint/Makefile.PL.include Makefile.PL MANIFEST This list of files +t/safe_does.t t/safe_isa.t META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Safe-Isa-1.000005/META.json new/Safe-Isa-1.000006/META.json --- old/Safe-Isa-1.000005/META.json 2014-08-17 00:15:55.000000000 +0200 +++ new/Safe-Isa-1.000006/META.json 2016-10-31 23:08:10.000000000 +0100 @@ -4,7 +4,7 @@ "mst - Matt S. Trout (cpan:MSTROUT) <[email protected]>" ], "dynamic_config" : 0, - "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142060", + "generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150005", "license" : [ "perl_5" ], @@ -20,6 +20,9 @@ ] }, "prereqs" : { + "build" : { + "requires" : {} + }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" @@ -50,5 +53,6 @@ "web" : "http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/Safe-Isa.git" } }, - "version" : "1.000005" + "version" : "1.000006", + "x_serialization_backend" : "JSON::PP version 2.27300" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Safe-Isa-1.000005/META.yml new/Safe-Isa-1.000006/META.yml --- old/Safe-Isa-1.000005/META.yml 2014-08-17 00:15:55.000000000 +0200 +++ new/Safe-Isa-1.000006/META.yml 2016-10-31 23:08:10.000000000 +0100 @@ -7,7 +7,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 -generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142060' +generated_by: 'ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150005' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -24,4 +24,5 @@ resources: bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Safe-Isa repository: git://git.shadowcat.co.uk/p5sagit/Safe-Isa.git -version: '1.000005' +version: '1.000006' +x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Safe-Isa-1.000005/Makefile.PL new/Safe-Isa-1.000006/Makefile.PL --- old/Safe-Isa-1.000005/Makefile.PL 2014-08-17 00:10:33.000000000 +0200 +++ new/Safe-Isa-1.000006/Makefile.PL 2016-10-17 17:37:55.000000000 +0200 @@ -2,7 +2,7 @@ use warnings FATAL => 'all'; use 5.008001; use ExtUtils::MakeMaker; -(do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; +(do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; my %WriteMakefileArgs = ( NAME => 'Safe::Isa', @@ -47,8 +47,6 @@ }, }, }, - - realclean => { FILES => [ 'Distar/', 'MANIFEST*' ] }, ); my $eumm_version = eval $ExtUtils::MakeMaker::VERSION; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Safe-Isa-1.000005/lib/Safe/Isa.pm new/Safe-Isa-1.000006/lib/Safe/Isa.pm --- old/Safe-Isa-1.000005/lib/Safe/Isa.pm 2014-08-17 00:14:04.000000000 +0200 +++ new/Safe-Isa-1.000006/lib/Safe/Isa.pm 2016-10-31 23:07:58.000000000 +0100 @@ -5,7 +5,7 @@ use Scalar::Util qw(blessed); use Exporter 5.57 qw(import); -our $VERSION = '1.000005'; +our $VERSION = '1.000006'; our @EXPORT = qw($_call_if_object $_isa $_can $_does $_DOES); @@ -15,6 +15,7 @@ # we gratuitously break modules like Scalar::Defer, which would be # un-perlish. return unless blessed($obj); + return $obj->isa(@_) if lc($method) eq 'does' and not $obj->can($method); return $obj->$method(@_); }; @@ -23,6 +24,11 @@ sub { my $obj = shift; $obj->$_call_if_object($method => @_) } } qw(isa can does DOES); +1; +__END__ + +=pod + =head1 NAME Safe::Isa - Call isa, can, does and DOES safely on things that may not be objects diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Safe-Isa-1.000005/maint/Makefile.include new/Safe-Isa-1.000006/maint/Makefile.include --- old/Safe-Isa-1.000005/maint/Makefile.include 2014-08-17 00:06:14.000000000 +0200 +++ new/Safe-Isa-1.000006/maint/Makefile.include 1970-01-01 01:00:00.000000000 +0100 @@ -1,11 +0,0 @@ -bump: - maint/bump-version - rm Makefile -bumpminor: - maint/bump-version minor - rm Makefile -bumpmajor: - maint/bump-version major - rm Makefile -upload: $(DISTVNAME).tar$(SUFFIX) - cpan-upload $< diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Safe-Isa-1.000005/maint/bump-version new/Safe-Isa-1.000006/maint/bump-version --- old/Safe-Isa-1.000005/maint/bump-version 2014-08-17 00:06:39.000000000 +0200 +++ new/Safe-Isa-1.000006/maint/bump-version 1970-01-01 01:00:00.000000000 +0100 @@ -1,39 +0,0 @@ -#!/usr/bin/env perl - -use 5.010; -use strict; -use warnings FATAL => 'all'; -use autodie; - -chomp(my $LATEST = qx(grep '^[0-9]' Changes | head -1 | awk '{print \$1}')); - -my @parts = map { m/(\d{1,3})/g } split /\./, $LATEST; -push @parts, 0, 0; - -my $OLD_DECIMAL = sprintf('%i.%03i%03i', @parts[0..2]); - -my %bump_part = (major => 0, minor => 1, bugfix => 2); - -my $bump_this = - $bump_part{$ARGV[0]||'bugfix'} - // die "no idea which part to bump - $ARGV[0] means nothing to me"; - -my @new_parts = @parts; - -$new_parts[$bump_this]++; - -my $NEW_DECIMAL = sprintf('%i.%03i%03i', @new_parts[0..2]); - -my @PM_FILES = ( 'lib/Safe/Isa.pm' ); - -foreach my $filename (@PM_FILES) { - warn "Bumping $OLD_DECIMAL -> $NEW_DECIMAL in $filename\n"; - - my $file = do { local (@ARGV, $/) = ($filename); <> }; - - $file =~ s/(?<=\$VERSION = ')${\quotemeta $OLD_DECIMAL}/${NEW_DECIMAL}/; - - open my $out, '>', $filename; - - print $out $file; -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Safe-Isa-1.000005/t/safe_does.t new/Safe-Isa-1.000006/t/safe_does.t --- old/Safe-Isa-1.000005/t/safe_does.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Safe-Isa-1.000006/t/safe_does.t 2016-10-17 17:37:55.000000000 +0200 @@ -0,0 +1,44 @@ +use strict; +use warnings; +use Test::More tests => 14; + +{ package Foo; sub new { bless({}, $_[0]) } } +{ package Bar; our @ISA = qw(Foo); sub bar { 1 } sub does { $_[0]->isa($_[1]) } } + +my $foo = Foo->new; +my $bar = Bar->new; +my $blam = [ 42 ]; +my $undef; + +# basic does, DOES usage - +# on perls >= 5.10.0, DOES falls back to isa. +# does must always be manually provided + +if (UNIVERSAL->can('DOES')) { + ok($foo->DOES('Foo'), 'foo DOES Foo'); + ok($bar->DOES('Foo'), 'bar DOES Foo'); +} +else { + ok(!eval { $foo->DOES('Foo') }, 'DOES not available in UNIVERSAL'); + ok(!eval { $bar->DOES('Foo') }, 'DOES not available in UNIVERSAL'); +} + +ok(!eval { $foo->does('Foo') }, 'does not implemented on Foo'); +ok($bar->does('Foo'), 'bar does Foo'); +ok(!eval { $blam->DOES('Foo'); 1 }, 'blam goes blam'); +ok(!eval { $undef->DOES('Foo'); 1 }, 'undef goes poof'); + + +use Safe::Isa; + +ok($foo->$_DOES('Foo'), 'foo $_DOES Foo'); +ok($bar->$_DOES('Foo'), 'bar $_DOES Foo'); +ok(eval { $blam->$_DOES('Foo'); 1 }, 'no boom today'); +ok(eval { $undef->$_DOES('Foo'); 1 }, 'nor tomorrow either'); + + +ok($foo->$_call_if_object(DOES => 'Foo'), 'foo $_call_if_object(DOES => Foo)'); +ok($bar->$_call_if_object(DOES => 'Foo'), 'bar $_call_if_object(DOES => Foo)'); +ok(eval { $blam->$_call_if_object(DOES => 'Foo'); 1 }, 'no boom today'); +ok(eval { $undef->$_call_if_object(DOES => 'Foo'); 1 }, 'nor tomorrow either'); + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Safe-Isa-1.000005/t/safe_isa.t new/Safe-Isa-1.000006/t/safe_isa.t --- old/Safe-Isa-1.000005/t/safe_isa.t 2014-03-03 01:39:24.000000000 +0100 +++ new/Safe-Isa-1.000006/t/safe_isa.t 2016-10-17 17:37:55.000000000 +0200 @@ -1,6 +1,6 @@ use strict; -use warnings FATAL => 'all'; -use Test::More tests => 15; +use warnings; +use Test::More tests => 20; { package Foo; sub new { bless({}, $_[0]) } } { package Bar; our @ISA = qw(Foo); sub bar { 1 } } @@ -8,27 +8,34 @@ my $foo = Foo->new; my $bar = Bar->new; my $blam = [ 42 ]; +my $undef; # basic isa usage - ok($foo->isa('Foo'), 'foo isa Foo'); ok($bar->isa('Foo'), 'bar isa Foo'); ok(!eval { $blam->isa('Foo'); 1 }, 'blam goes blam'); +ok(!eval { $undef->isa('Foo'); 1 }, 'undef goes poof'); + ok(!$foo->can('bar'), 'foo !can bar'); ok($bar->can('bar'), 'bar can bar'); ok(!eval { $blam->can('bar'); 1 }, 'blam goes blam'); +ok(!eval { $undef->can('bar'); 1 }, 'undef goes poof'); use Safe::Isa; ok($foo->$_isa('Foo'), 'foo $_isa Foo'); ok($bar->$_isa('Foo'), 'bar $_isa Foo'); ok(eval { $blam->$_isa('Foo'); 1 }, 'no boom today'); +ok(eval { $undef->$_isa('Foo'); 1 }, 'nor tomorrow either'); ok(!$foo->$_can('bar'), 'foo !$_can bar'); ok($bar->$_can('bar'), 'bar $_can bar'); ok(eval { $blam->$_can('bar'); 1 }, 'no boom today'); +ok(eval { $undef->$_can('bar'); 1 }, 'nor tomorrow either'); ok($foo->$_call_if_object(isa => 'Foo'), 'foo $_call_if_object(isa => Foo)'); ok($bar->$_call_if_object(isa => 'Foo'), 'bar $_call_if_object(isa => Foo)'); ok(eval { $blam->$_call_if_object(isa => 'Foo'); 1 }, 'no boom today'); +ok(eval { $undef->$_call_if_object(isa => 'Foo'); 1 }, 'nor tomorrow either'); ++++++ cpanspec.yml ++++++ --- #description_paragraphs: 3 #description: |- # override description from CPAN #summary: override summary from CPAN #no_testing: broken upstream #sources: # - source1 # - source2 #patches: # foo.patch: -p1 # bar.patch: #preamble: |- # BuildRequires: gcc-c++ #post_prep: |- # hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s, *,,g'` # sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL #post_build: |- # rm unused.files #post_install: |- # sed on %{name}.files #license: SUSE-NonFree #skip_noarch: 1 #custom_build: |- #./Build build flags=%{?_smp_mflags} --myflag #custom_test: |- #startserver && make test #ignore_requires: Bizarre::Module
