Hello community, here is the log from the commit of package perl-Clone-PP for openSUSE:Factory checked in at 2014-03-09 18:34:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Clone-PP (Old) and /work/SRC/openSUSE:Factory/.perl-Clone-PP.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Clone-PP" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Clone-PP/perl-Clone-PP.changes 2011-11-18 15:47:11.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Clone-PP.new/perl-Clone-PP.changes 2014-03-09 18:34:54.000000000 +0100 @@ -1,0 +2,18 @@ +Fri Mar 7 08:52:13 UTC 2014 - [email protected] + +- updated to 1.05 + - Added github repo to metadata (thanks dsteinbrunner) + - Added github repo to doc + - I had erroneously listed Test::Array as a test prereq, + but the package is defined in 01array.t where it's used. + RT#93082 - thanks to Dagfinn Ilmari Mannsaker. + - Added Changes file + - Fixed typos from dsteinbrunner in RT#86337 + - Added "use warnings" and in the process fixed RT#17121 + - Min perl version 5.6.0 in code and metadata + - Added license type to metadata and renamed L&C section in pod + - Expanded the SEE ALSO section + - Added prereqs to PREREQ_PM in Makefile.PL + - Added test prereqs in TEST_REQUIRES + +------------------------------------------------------------------- Old: ---- Clone-PP-1.02.tar.gz New: ---- Clone-PP-1.05.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Clone-PP.spec ++++++ --- /var/tmp/diff_new_pack.YjPl57/_old 2014-03-09 18:34:55.000000000 +0100 +++ /var/tmp/diff_new_pack.YjPl57/_new 2014-03-09 18:34:55.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package perl-Clone-PP # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,21 +16,19 @@ # - Name: perl-Clone-PP -Version: 1.02 -Release: 1 -License: GPL-1.0+ or Artistic-1.0 +Version: 1.05 +Release: 0 %define cpan_name Clone-PP Summary: Recursively copy Perl datatypes -Url: http://search.cpan.org/dist/Clone-PP/ +License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl -Source: http://www.cpan.org/authors/id/E/EV/EVO/%{cpan_name}-%{version}.tar.gz -NoSource: 0 +Url: http://search.cpan.org/dist/Clone-PP/ +Source: http://www.cpan.org/authors/id/N/NE/NEILB/%{cpan_name}-%{version}.tar.gz +BuildArch: noarch +BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildArch: noarch %{perl_requires} %description @@ -72,11 +70,8 @@ %perl_process_packlist %perl_gen_filelist -%clean -%{__rm} -rf %{buildroot} - %files -f %{name}.files -%defattr(644,root,root,755) -%doc README +%defattr(-,root,root,755) +%doc Changes README %changelog ++++++ Clone-PP-1.02.tar.gz -> Clone-PP-1.05.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Clone-PP-1.02/Changes new/Clone-PP-1.05/Changes --- old/Clone-PP-1.02/Changes 1970-01-01 01:00:00.000000000 +0100 +++ new/Clone-PP-1.05/Changes 2014-02-18 00:44:46.000000000 +0100 @@ -0,0 +1,27 @@ +Revision history for Perl module Clone::PP + +1.05 2014-02-17 NEILB + - Added github repo to metadata (thanks dsteinbrunner) + - Added github repo to doc + +1.04 2014-02-17 NEILB + - I had erroneously listed Test::Array as a test prereq, + but the package is defined in 01array.t where it's used. + RT#93082 - thanks to Dagfinn Ilmari Mannsaker. + +1.03 2014-02-16 NEILB + - Added Changes file + - Fixed typos from dsteinbrunner in RT#86337 + - Added "use warnings" and in the process fixed RT#17121 + - Min perl version 5.6.0 in code and metadata + - Added license type to metadata and renamed L&C section in pod + - Expanded the SEE ALSO section + - Added prereqs to PREREQ_PM in Makefile.PL + - Added test prereqs in TEST_REQUIRES + +1.02 2003-08-28 + +1.01 2003-08-27 + +1.00 2003-08-25 + - First release to CPAN diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Clone-PP-1.02/MANIFEST new/Clone-PP-1.05/MANIFEST --- old/Clone-PP-1.02/MANIFEST 2003-08-28 06:16:23.000000000 +0200 +++ new/Clone-PP-1.05/MANIFEST 2014-02-18 00:47:05.000000000 +0100 @@ -1,6 +1,7 @@ +Changes MANIFEST Makefile.PL -PP.pm +lib/Clone/PP.pm t/01array.t t/02hash.t t/03scalar.t @@ -11,3 +12,5 @@ t/dump.pl t/tied.pl README +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/Clone-PP-1.02/META.json new/Clone-PP-1.05/META.json --- old/Clone-PP-1.02/META.json 1970-01-01 01:00:00.000000000 +0100 +++ new/Clone-PP-1.05/META.json 2014-02-18 00:47:05.000000000 +0100 @@ -0,0 +1,59 @@ +{ + "abstract" : "unknown", + "author" : [ + "unknown" + ], + "dynamic_config" : 1, + "generated_by" : "ExtUtils::MakeMaker version 6.86, CPAN::Meta::Converter version 2.133380", + "license" : [ + "perl_5" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "Clone-PP", + "no_index" : { + "directory" : [ + "t", + "inc" + ] + }, + "prereqs" : { + "build" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "runtime" : { + "requires" : { + "Exporter" : "0", + "perl" : "5.006", + "strict" : "0", + "vars" : "0", + "warnings" : "0" + } + }, + "test" : { + "requires" : { + "Benchmark" : "0", + "Carp" : "0", + "Data::Dumper" : "0" + } + } + }, + "release_status" : "stable", + "resources" : { + "repository" : { + "type" : "git", + "url" : "git://github.com/neilbowers/Clone-PP.git", + "web" : "https://github.com/neilbowers/Clone-PP" + } + }, + "version" : "1.05" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Clone-PP-1.02/META.yml new/Clone-PP-1.05/META.yml --- old/Clone-PP-1.02/META.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/Clone-PP-1.05/META.yml 2014-02-18 00:47:05.000000000 +0100 @@ -0,0 +1,31 @@ +--- +abstract: unknown +author: + - unknown +build_requires: + Benchmark: 0 + Carp: 0 + Data::Dumper: 0 + ExtUtils::MakeMaker: 0 +configure_requires: + ExtUtils::MakeMaker: 0 +dynamic_config: 1 +generated_by: 'ExtUtils::MakeMaker version 6.86, CPAN::Meta::Converter version 2.133380' +license: perl +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 +name: Clone-PP +no_index: + directory: + - t + - inc +requires: + Exporter: 0 + perl: 5.006 + strict: 0 + vars: 0 + warnings: 0 +resources: + repository: git://github.com/neilbowers/Clone-PP.git +version: 1.05 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Clone-PP-1.02/Makefile.PL new/Clone-PP-1.05/Makefile.PL --- old/Clone-PP-1.02/Makefile.PL 2003-08-24 02:36:23.000000000 +0200 +++ new/Clone-PP-1.05/Makefile.PL 2014-02-18 00:43:32.000000000 +0100 @@ -1,6 +1,55 @@ use ExtUtils::MakeMaker; + +my $mm_ver = $ExtUtils::MakeMaker::VERSION; +if ($mm_ver =~ /_/) { # dev version + $mm_ver = eval $mm_ver; + die $@ if $@; +} + WriteMakefile( 'NAME' => 'Clone::PP', - 'VERSION_FROM' => 'PP.pm', + 'VERSION_FROM' => 'lib/Clone/PP.pm', + + PREREQ_PM => { + 'Exporter' => 0, + 'strict' => 0, + 'warnings' => 0, + 'vars' => 0, + }, + + ($mm_ver >= 6.48 + ? (MIN_PERL_VERSION => 5.006) + : () + ), + + ($mm_ver >= 6.31 + ? (LICENSE => 'perl_5') + : () + ), + + ($mm_ver >= 6.64 + ? (TEST_REQUIRES => { + 'Data::Dumper' => 0, + 'Benchmark' => 0, + 'Carp' => 0, + }) + : () + ), + + ($mm_ver <= 6.45 + ? () + : (META_MERGE => { + 'meta-spec' => { version => 2 }, + resources => { + bugtracker => 'http://rt.cpan.org/Public/Dist/Display.html?Name=Clone-PP', + repository => { + type => 'git', + web => 'https://github.com/neilbowers/Clone-PP', + url => 'git://github.com/neilbowers/Clone-PP.git', + }, + }, + }) + ), + ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Clone-PP-1.02/PP.pm new/Clone-PP-1.05/PP.pm --- old/Clone-PP-1.02/PP.pm 2003-08-28 20:06:40.000000000 +0200 +++ new/Clone-PP-1.05/PP.pm 1970-01-01 01:00:00.000000000 +0100 @@ -1,173 +0,0 @@ -package Clone::PP; - -use strict; -use vars qw($VERSION @EXPORT_OK); -use Exporter; - -$VERSION = 1.02; - -@EXPORT_OK = qw( clone ); -sub import { goto &Exporter::import } # lazy Exporter - -# These methods can be temporarily overriden to work with a given class. -use vars qw( $CloneSelfMethod $CloneInitMethod ); -$CloneSelfMethod ||= 'clone_self'; -$CloneInitMethod ||= 'clone_init'; - -# Used to detect looped networks and avoid infinite recursion. -use vars qw( %CloneCache ); - -# Generic cloning function -sub clone { - my $source = shift; - - # Optional depth limit: after a given number of levels, do shallow copy. - my $depth = shift; - return $source if ( defined $depth and $depth -- < 1 ); - - # Maintain a shared cache during recursive calls, then clear it at the end. - local %CloneCache = ( undef => undef ) unless ( exists $CloneCache{undef} ); - - return $CloneCache{ $source } if ( exists $CloneCache{ $source } ); - - # Non-reference values are copied shallowly - my $ref_type = ref $source or return $source; - - # Extract both the structure type and the class name of referent - my $class_name; - if ( "$source" =~ /^\Q$ref_type\E\=([A-Z]+)\(0x[0-9a-f]+\)$/ ) { - $class_name = $ref_type; - $ref_type = $1; - # Some objects would prefer to clone themselves; check for clone_self(). - return $CloneCache{ $source } = $source->$CloneSelfMethod() - if $source->can($CloneSelfMethod); - } - - # To make a copy: - # - Prepare a reference to the same type of structure; - # - Store it in the cache, to avoid looping it it refers to itself; - # - Tie in to the same class as the original, if it was tied; - # - Assign a value to the reference by cloning each item in the original; - - my $copy; - if ($ref_type eq 'HASH') { - $CloneCache{ $source } = $copy = {}; - if ( my $tied = tied( %$source ) ) { tie %$copy, ref $tied } - %$copy = map { ! ref($_) ? $_ : clone($_, $depth) } %$source; - } elsif ($ref_type eq 'ARRAY') { - $CloneCache{ $source } = $copy = []; - if ( my $tied = tied( @$source ) ) { tie @$copy, ref $tied } - @$copy = map { ! ref($_) ? $_ : clone($_, $depth) } @$source; - } elsif ($ref_type eq 'REF' or $ref_type eq 'SCALAR') { - $CloneCache{ $source } = $copy = \( my $var = "" ); - if ( my $tied = tied( $$source ) ) { tie $$copy, ref $tied } - $$copy = clone($$source, $depth); - } else { - # Shallow copy anything else; this handles a reference to code, glob, regex - $CloneCache{ $source } = $copy = $source; - } - - # - Bless it into the same class as the original, if it was blessed; - # - If it has a post-cloning initialization method, call it. - if ( $class_name ) { - bless $copy, $class_name; - $copy->$CloneInitMethod() if $copy->can($CloneInitMethod); - } - - return $copy; -} - -1; - -__END__ - -=head1 NAME - -Clone::PP - Recursively copy Perl datatypes - -=head1 SYNOPSIS - - use Clone::PP qw(clone); - - $item = { 'foo' => 'bar', 'move' => [ 'zig', 'zag' ] }; - $copy = clone( $item ); - - $item = [ 'alpha', 'beta', { 'gamma' => 'vlissides' } ]; - $copy = clone( $item ); - - $item = Foo->new(); - $copy = clone( $item ); - -Or as an object method: - - require Clone::PP; - push @Foo::ISA, 'Clone::PP'; - - $item = Foo->new(); - $copy = $item->clone(); - -=head1 DESCRIPTION - -This module provides a general-purpose clone function to make deep -copies of Perl data structures. It calls itself recursively to copy -nested hash, array, scalar and reference types, including tied -variables and objects. - -The clone() function takes a scalar argument to copy. To duplicate -arrays or hashes, pass them in by reference: - - my $copy = clone(\@array); my @copy = @{ clone(\@array) }; - my $copy = clone(\%hash); my %copy = %{ clone(\%hash) }; - -The clone() function also accepts an optional second parameter that -can be used to limit the depth of the copy. If you pass a limit of -0, clone will return the same value you supplied; for a limit of -1, a shallow copy is constructed; for a limit of 2, two layers of -copying are done, and so on. - - my $shallow_copy = clone( $item, 1 ); - -To allow objects to intervene in the way they are copied, the -clone() function checks for a couple of optional methods. If an -object provides a method named C<clone_self>, it is called and the -result returned without further processing. Alternately, if an -object provides a method named C<clone_init>, it is called on the -copied object before it is returned. - -=head1 BUGS - -Some data types, such as globs, regexes, and code refs, are always copied shallowly. - -References to hash elements are not properly duplicated. (This is why two tests in t/dclone.t that are marked "todo".) For example, the following test should succeed but does not: - - my $hash = { foo => 1 }; - $hash->{bar} = \{ $hash->{foo} }; - my $copy = clone( \%hash ); - $hash->{foo} = 2; - $copy->{foo} = 2; - ok( $hash->{bar} == $copy->{bar} ); - -To report bugs via the CPAN web tracking system, go to -C<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Clone-PP> or send mail -to C<Dist=Clone-PP#rt.cpan.org>, replacing C<#> with C<@>. - -=head1 SEE ALSO - -For a faster implementation in XS, see L<Clone/clone>, L<Util/clone>, or <Storable/dclone>. - -=head1 CREDITS AND COPYRIGHT - -Developed by Matthew Simon Cavalletto at Evolution Softworks. -More free Perl software is available at C<www.evoscript.org>. - -Copyright 2003 Matthew Simon Cavalletto. You may contact the author -directly at C<[email protected]> or C<[email protected]>. - -Code initially derived from Ref.pm. Portions Copyright 1994 David Muir Sharnoff. - -Interface based by Clone by Ray Finch with contributions from chocolateboy. -Portions Copyright 2001 Ray Finch. Portions Copyright 2001 chocolateboy. - -You may use, modify, and distribute this software under the same terms as Perl. - -=cut diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Clone-PP-1.02/lib/Clone/PP.pm new/Clone-PP-1.05/lib/Clone/PP.pm --- old/Clone-PP-1.02/lib/Clone/PP.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/Clone-PP-1.05/lib/Clone/PP.pm 2014-02-18 00:46:41.000000000 +0100 @@ -0,0 +1,193 @@ +package Clone::PP; + +use 5.006; +use strict; +use warnings; +use vars qw($VERSION @EXPORT_OK); +use Exporter; + +$VERSION = 1.05; + +@EXPORT_OK = qw( clone ); +sub import { goto &Exporter::import } # lazy Exporter + +# These methods can be temporarily overridden to work with a given class. +use vars qw( $CloneSelfMethod $CloneInitMethod ); +$CloneSelfMethod ||= 'clone_self'; +$CloneInitMethod ||= 'clone_init'; + +# Used to detect looped networks and avoid infinite recursion. +use vars qw( %CloneCache ); + +# Generic cloning function +sub clone { + my $source = shift; + + return undef if not defined($source); + + # Optional depth limit: after a given number of levels, do shallow copy. + my $depth = shift; + return $source if ( defined $depth and $depth -- < 1 ); + + # Maintain a shared cache during recursive calls, then clear it at the end. + local %CloneCache = ( undef => undef ) unless ( exists $CloneCache{undef} ); + + return $CloneCache{ $source } if ( defined $CloneCache{ $source } ); + + # Non-reference values are copied shallowly + my $ref_type = ref $source or return $source; + + # Extract both the structure type and the class name of referent + my $class_name; + if ( "$source" =~ /^\Q$ref_type\E\=([A-Z]+)\(0x[0-9a-f]+\)$/ ) { + $class_name = $ref_type; + $ref_type = $1; + # Some objects would prefer to clone themselves; check for clone_self(). + return $CloneCache{ $source } = $source->$CloneSelfMethod() + if $source->can($CloneSelfMethod); + } + + # To make a copy: + # - Prepare a reference to the same type of structure; + # - Store it in the cache, to avoid looping if it refers to itself; + # - Tie in to the same class as the original, if it was tied; + # - Assign a value to the reference by cloning each item in the original; + + my $copy; + if ($ref_type eq 'HASH') { + $CloneCache{ $source } = $copy = {}; + if ( my $tied = tied( %$source ) ) { tie %$copy, ref $tied } + %$copy = map { ! ref($_) ? $_ : clone($_, $depth) } %$source; + } elsif ($ref_type eq 'ARRAY') { + $CloneCache{ $source } = $copy = []; + if ( my $tied = tied( @$source ) ) { tie @$copy, ref $tied } + @$copy = map { ! ref($_) ? $_ : clone($_, $depth) } @$source; + } elsif ($ref_type eq 'REF' or $ref_type eq 'SCALAR') { + $CloneCache{ $source } = $copy = \( my $var = "" ); + if ( my $tied = tied( $$source ) ) { tie $$copy, ref $tied } + $$copy = clone($$source, $depth); + } else { + # Shallow copy anything else; this handles a reference to code, glob, regex + $CloneCache{ $source } = $copy = $source; + } + + # - Bless it into the same class as the original, if it was blessed; + # - If it has a post-cloning initialization method, call it. + if ( $class_name ) { + bless $copy, $class_name; + $copy->$CloneInitMethod() if $copy->can($CloneInitMethod); + } + + return $copy; +} + +1; + +__END__ + +=head1 NAME + +Clone::PP - Recursively copy Perl datatypes + +=head1 SYNOPSIS + + use Clone::PP qw(clone); + + $item = { 'foo' => 'bar', 'move' => [ 'zig', 'zag' ] }; + $copy = clone( $item ); + + $item = [ 'alpha', 'beta', { 'gamma' => 'vlissides' } ]; + $copy = clone( $item ); + + $item = Foo->new(); + $copy = clone( $item ); + +Or as an object method: + + require Clone::PP; + push @Foo::ISA, 'Clone::PP'; + + $item = Foo->new(); + $copy = $item->clone(); + +=head1 DESCRIPTION + +This module provides a general-purpose clone function to make deep +copies of Perl data structures. It calls itself recursively to copy +nested hash, array, scalar and reference types, including tied +variables and objects. + +The clone() function takes a scalar argument to copy. To duplicate +arrays or hashes, pass them in by reference: + + my $copy = clone(\@array); my @copy = @{ clone(\@array) }; + my $copy = clone(\%hash); my %copy = %{ clone(\%hash) }; + +The clone() function also accepts an optional second parameter that +can be used to limit the depth of the copy. If you pass a limit of +0, clone will return the same value you supplied; for a limit of +1, a shallow copy is constructed; for a limit of 2, two layers of +copying are done, and so on. + + my $shallow_copy = clone( $item, 1 ); + +To allow objects to intervene in the way they are copied, the +clone() function checks for a couple of optional methods. If an +object provides a method named C<clone_self>, it is called and the +result returned without further processing. Alternately, if an +object provides a method named C<clone_init>, it is called on the +copied object before it is returned. + +=head1 BUGS + +Some data types, such as globs, regexes, and code refs, are always copied shallowly. + +References to hash elements are not properly duplicated. (This is why two tests in t/dclone.t that are marked "todo".) For example, the following test should succeed but does not: + + my $hash = { foo => 1 }; + $hash->{bar} = \{ $hash->{foo} }; + my $copy = clone( \%hash ); + $hash->{foo} = 2; + $copy->{foo} = 2; + ok( $hash->{bar} == $copy->{bar} ); + +To report bugs via the CPAN web tracking system, go to +C<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Clone-PP> or send mail +to C<Dist=Clone-PP#rt.cpan.org>, replacing C<#> with C<@>. + +=head1 SEE ALSO + +L<Clone> - a baseclass which provides a C<clone()> method. + +L<MooseX::Clone> - find-grained cloning for Moose objects. + +The C<dclone()> function in L<Storable>. + +L<Data::Clone> - +polymorphic data cloning (see its documentation for what that means). + +L<Clone::Any> - use whichever of the cloning methods is available. + +=head1 REPOSITORY + +L<https://github.com/neilbowers/Clone-PP> + +=head1 AUTHOR AND CREDITS + +Developed by Matthew Simon Cavalletto at Evolution Softworks. +More free Perl software is available at C<www.evoscript.org>. + + +=head1 COPYRIGHT AND LICENSE + +Copyright 2003 Matthew Simon Cavalletto. You may contact the author +directly at C<[email protected]> or C<[email protected]>. + +Code initially derived from Ref.pm. Portions Copyright 1994 David Muir Sharnoff. + +Interface based by Clone by Ray Finch with contributions from chocolateboy. +Portions Copyright 2001 Ray Finch. Portions Copyright 2001 chocolateboy. + +You may use, modify, and distribute this software under the same terms as Perl. + +=cut -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
