Hello community, here is the log from the commit of package perl-Import-Into for openSUSE:Factory checked in at 2014-07-26 09:42:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Import-Into (Old) and /work/SRC/openSUSE:Factory/.perl-Import-Into.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Import-Into" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Import-Into/perl-Import-Into.changes 2014-03-25 13:25:34.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Import-Into.new/perl-Import-Into.changes 2014-07-26 09:42:09.000000000 +0200 @@ -1,0 +2,13 @@ +Fri Jul 25 09:31:59 UTC 2014 - [email protected] + +- updated to 1.002004 + - fix prerequisite declarations for older toolchain + + 1.002003 - 2014-07-09 + - module loading is now done while importing, making it unnecessary to load + them beforehand (RT#96995, Christian Walde) + + 1.002002 - 2014-05-06 + - minor metadata updates + +------------------------------------------------------------------- Old: ---- Import-Into-1.002001.tar.gz New: ---- Import-Into-1.002004.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Import-Into.spec ++++++ --- /var/tmp/diff_new_pack.Ilod5X/_old 2014-07-26 09:42:10.000000000 +0200 +++ /var/tmp/diff_new_pack.Ilod5X/_new 2014-07-26 09:42:10.000000000 +0200 @@ -17,18 +17,20 @@ Name: perl-Import-Into -Version: 1.002001 +Version: 1.002004 Release: 0 %define cpan_name Import-Into -Summary: import packages into other packages +Summary: Import packages into other packages License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Import-Into/ -Source: http://www.cpan.org/authors/id/H/HA/HAARG/%{cpan_name}-%{version}.tar.gz +Source: http://www.cpan.org/authors/id/E/ET/ETHER/%{cpan_name}-%{version}.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros +BuildRequires: perl(Module::Runtime) +Requires: perl(Module::Runtime) %{perl_requires} %description @@ -44,6 +46,7 @@ %prep %setup -q -n %{cpan_name}-%{version} +find . -type f -print0 | xargs -0 chmod 644 %build %{__perl} Makefile.PL INSTALLDIRS=vendor ++++++ Import-Into-1.002001.tar.gz -> Import-Into-1.002004.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Import-Into-1.002001/Changes new/Import-Into-1.002004/Changes --- old/Import-Into-1.002001/Changes 2014-03-04 20:49:58.000000000 +0100 +++ new/Import-Into-1.002004/Changes 2014-07-09 18:25:28.000000000 +0200 @@ -1,5 +1,15 @@ Revision history for Import-Into +1.002004 - 2014-07-09 + - fix prerequisite declarations for older toolchain + +1.002003 - 2014-07-09 + - module loading is now done while importing, making it unnecessary to load + them beforehand (RT#96995, Christian Walde) + +1.002002 - 2014-05-06 + - minor metadata updates + 1.002001 - 2014-03-04 - fix tests and Makefile.PL to support perl 5.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Import-Into-1.002001/MANIFEST new/Import-Into-1.002004/MANIFEST --- old/Import-Into-1.002001/MANIFEST 2014-03-04 20:50:06.000000000 +0100 +++ new/Import-Into-1.002004/MANIFEST 2014-07-09 18:25:40.000000000 +0200 @@ -1,5 +1,7 @@ Changes lib/Import/Into.pm +maint/bump-version +maint/Makefile.include maint/Makefile.PL.include Makefile.PL MANIFEST This list of files diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Import-Into-1.002001/META.json new/Import-Into-1.002004/META.json --- old/Import-Into-1.002001/META.json 2014-03-04 20:50:06.000000000 +0100 +++ new/Import-Into-1.002004/META.json 2014-07-09 18:25:39.000000000 +0200 @@ -1,10 +1,10 @@ { - "abstract" : "import packages into other packages", + "abstract" : "Import packages into other packages", "author" : [ "mst - Matt S. Trout (cpan:MSTROUT) <[email protected]>" ], "dynamic_config" : 0, - "generated_by" : "ExtUtils::MakeMaker version 6.9, CPAN::Meta::Converter version 2.133380", + "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.141520", "license" : [ "perl_5" ], @@ -20,18 +20,20 @@ ] }, "prereqs" : { - "build" : { + "runtime" : { "requires" : { - "ExtUtils::MakeMaker" : "0" + "Module::Runtime" : "0", + "perl" : "5.006", + "strict" : "0", + "warnings" : "0" } }, - "configure" : { + "test" : { "requires" : { - "ExtUtils::MakeMaker" : "0" + "Exporter" : "0", + "Test::More" : "0", + "base" : "0" } - }, - "runtime" : { - "requires" : {} } }, "release_status" : "stable", @@ -46,5 +48,5 @@ "web" : "http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/Import-Into.git" } }, - "version" : "1.002001" + "version" : "1.002004" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Import-Into-1.002001/META.yml new/Import-Into-1.002004/META.yml --- old/Import-Into-1.002001/META.yml 2014-03-04 20:50:06.000000000 +0100 +++ new/Import-Into-1.002004/META.yml 2014-07-09 18:25:39.000000000 +0200 @@ -1,13 +1,13 @@ --- -abstract: 'import packages into other packages' +abstract: 'Import packages into other packages' author: - 'mst - Matt S. Trout (cpan:MSTROUT) <[email protected]>' build_requires: - ExtUtils::MakeMaker: '0' -configure_requires: - ExtUtils::MakeMaker: '0' + Exporter: '0' + Test::More: '0' + base: '0' dynamic_config: 0 -generated_by: 'ExtUtils::MakeMaker version 6.9, CPAN::Meta::Converter version 2.133380' +generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.141520' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -17,8 +17,12 @@ directory: - t - inc -requires: {} +requires: + Module::Runtime: '0' + perl: '5.006' + strict: '0' + warnings: '0' resources: bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Import-Into repository: git://git.shadowcat.co.uk/p5sagit/Import-Into.git -version: '1.002001' +version: '1.002004' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Import-Into-1.002001/Makefile.PL new/Import-Into-1.002004/Makefile.PL --- old/Import-Into-1.002001/Makefile.PL 2014-03-04 15:22:15.000000000 +0100 +++ new/Import-Into-1.002004/Makefile.PL 2014-07-09 18:10:52.000000000 +0200 @@ -3,7 +3,7 @@ use ExtUtils::MakeMaker; (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; -WriteMakefile( +my %WriteMakefileArgs = ( NAME => 'Import::Into', VERSION_FROM => 'lib/Import/Into.pm', PREREQ_PM => { }, @@ -24,6 +24,59 @@ web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Import-Into', }, }, + }, + META_ADD => { + prereqs => { + runtime => { + requires => { + 'strict' => '0', + 'warnings' => '0', + 'Module::Runtime' => '0', + 'perl' => '5.006', + }, + }, + test => { + requires => { + 'Exporter' => '0', + 'base' => '0', + 'Test::More' => '0', + }, + }, + }, }, + + realclean => { FILES => [ 'Distar/', 'MANIFEST*' ] }, ); + +my $eumm_version = eval $ExtUtils::MakeMaker::VERSION; + +for (qw(configure build test runtime)) { + my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES'; + next unless exists $WriteMakefileArgs{META_ADD}{prereqs}{$_} + or exists $WriteMakefileArgs{$key}; + my $r = $WriteMakefileArgs{$key} = { + %{$WriteMakefileArgs{META_ADD}{prereqs}{$_}{requires} || {}}, + %{delete $WriteMakefileArgs{$key} || {}}, + }; + defined $r->{$_} or delete $r->{$_} for keys %$r; +} + +# dynamic prereqs get added here. + +$WriteMakefileArgs{MIN_PERL_VERSION} = delete $WriteMakefileArgs{PREREQ_PM}{perl} || 0; + +$WriteMakefileArgs{BUILD_REQUIRES} = { + %{$WriteMakefileArgs{BUILD_REQUIRES} || {}}, + %{delete $WriteMakefileArgs{TEST_REQUIRES}} +} if $eumm_version < 6.63_03; + +$WriteMakefileArgs{PREREQ_PM} = { + %{$WriteMakefileArgs{PREREQ_PM}}, + %{delete $WriteMakefileArgs{BUILD_REQUIRES}} +} if $eumm_version < 6.55_01; + +delete $WriteMakefileArgs{CONFIGURE_REQUIRES} + if $eumm_version < 6.51_03; + +WriteMakefile(%WriteMakefileArgs); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Import-Into-1.002001/README new/Import-Into-1.002004/README --- old/Import-Into-1.002001/README 2014-03-04 20:50:06.000000000 +0100 +++ new/Import-Into-1.002004/README 2014-07-09 18:25:40.000000000 +0200 @@ -1,14 +1,11 @@ NAME - Import::Into - import packages into other packages + Import::Into - Import packages into other packages SYNOPSIS package My::MultiExporter; use Import::Into; - use Thing1 (); - use Thing2 (); - # simple sub import { Thing1->import::into(scalar caller); @@ -60,8 +57,9 @@ METHODS $package->import::into( $target, @arguments ); - A global method, callable on any package. Imports the given package into - $target. @arguments are passed along to the package's import method. + A global method, callable on any package. Loads and imports the given + package into $target. @arguments are passed along to the package's + import method. $target can be an package name to export to, an integer for the caller level to export to, or a hashref with the following options: @@ -134,7 +132,8 @@ So, a solution for that is: - my $sub = eval "package $target; sub { shift->import(\@_) }"; + use Module::Runtime; + my $sub = eval "package $target; sub { use_module(shift)->import(\@_) }"; $sub->($thing, @import_args); which means that import is called from the right place for pragmas to @@ -152,12 +151,12 @@ my $sub = eval qq{ package $target; #line $line "$file" - sub { shift->import(\@_) } + sub { use_module(shift)->import(\@_) } }; $sub->($thing, @import_args); And you need to switch between these implementations depending on if you - are targetting a specific package, or something in your call stack. + are targeting a specific package, or something in your call stack. Remembering all this, however, is excessively irritating. So I wrote a module so I didn't have to anymore. Loading Import::Into creates a @@ -196,17 +195,12 @@ <http://shadow.cat/blog/matt-s-trout/madness-with-methods> which covers coderef abuse and the "${\...}" syntax. - Final note: You do still need to ensure that you already loaded $thing - - if you're receiving this from a parameter, I recommend using - Module::Runtime: - - use Import::Into; - use Module::Runtime qw(use_module); - - use_module($thing)->import::into($target, @import_args); - And that's it. +SEE ALSO + I gave a lightning talk on this module (and curry and Safe::Isa) at + YAPC::NA 2013 <https://www.youtube.com/watch?v=wFXWV2yY7gE&t=46m05s>. + ACKNOWLEDGEMENTS Thanks to Getty for asking "how can I get "use strict; use warnings;" turned on for all consumers of my code?" and then "why is this not a @@ -218,6 +212,8 @@ CONTRIBUTORS haarg - Graham Knop (cpan:HAARG) <[email protected]> + Mithaldu - Christian Walde (cpan:MITHALDU) <[email protected]> + COPYRIGHT Copyright (c) 2012 the Import::Into "AUTHOR" and "CONTRIBUTORS" as listed above. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Import-Into-1.002001/lib/Import/Into.pm new/Import-Into-1.002004/lib/Import/Into.pm --- old/Import-Into-1.002001/lib/Import/Into.pm 2014-03-04 20:48:36.000000000 +0100 +++ new/Import-Into-1.002004/lib/Import/Into.pm 2014-07-09 18:14:56.000000000 +0200 @@ -2,8 +2,9 @@ use strict; use warnings FATAL => 'all'; +use Module::Runtime; -our $VERSION = '1.002001'; # 1.2.1 +our $VERSION = '1.002004'; sub _prelude { my $target = shift; @@ -24,8 +25,9 @@ sub _make_action { my ($action, $target) = @_; my $version = ref $target && $target->{version}; - my $ver_check = $version ? '$_[0]->VERSION($version);' : ''; - eval _prelude($target).qq{sub { $ver_check shift->$action(\@_) }} + my $ver_check = $version ? ', $version' : ''; + eval _prelude($target) + . qq{sub { Module::Runtime::use_module( shift$ver_check )->$action(\@_) }} or die "Failed to build action sub to ${action} for ${target}: $@"; } @@ -45,7 +47,7 @@ =head1 NAME -Import::Into - import packages into other packages +Import::Into - Import packages into other packages =head1 SYNOPSIS @@ -53,9 +55,6 @@ use Import::Into; - use Thing1 (); - use Thing2 (); - # simple sub import { Thing1->import::into(scalar caller); @@ -109,8 +108,8 @@ =head2 $package->import::into( $target, @arguments ); -A global method, callable on any package. Imports the given package into -C<$target>. C<@arguments> are passed along to the package's import method. +A global method, callable on any package. Loads and imports the given package +into C<$target>. C<@arguments> are passed along to the package's import method. C<$target> can be an package name to export to, an integer for the caller level to export to, or a hashref with the following options: @@ -192,7 +191,8 @@ So, a solution for that is: - my $sub = eval "package $target; sub { shift->import(\@_) }"; + use Module::Runtime; + my $sub = eval "package $target; sub { use_module(shift)->import(\@_) }"; $sub->($thing, @import_args); which means that import is called from the right place for pragmas to take @@ -209,12 +209,12 @@ my $sub = eval qq{ package $target; #line $line "$file" - sub { shift->import(\@_) } + sub { use_module(shift)->import(\@_) } }; $sub->($thing, @import_args); And you need to switch between these implementations depending on if you are -targetting a specific package, or something in your call stack. +targeting a specific package, or something in your call stack. Remembering all this, however, is excessively irritating. So I wrote a module so I didn't have to anymore. Loading L<Import::Into> creates a global method @@ -252,15 +252,12 @@ L<http://shadow.cat/blog/matt-s-trout/madness-with-methods> which covers coderef abuse and the C<${\...}> syntax. -Final note: You do still need to ensure that you already loaded C<$thing> - if -you're receiving this from a parameter, I recommend using L<Module::Runtime>: - - use Import::Into; - use Module::Runtime qw(use_module); +And that's it. - use_module($thing)->import::into($target, @import_args); +=head1 SEE ALSO -And that's it. +I gave a lightning talk on this module (and L<curry> and L<Safe::Isa>) at +L<YAPC::NA 2013|https://www.youtube.com/watch?v=wFXWV2yY7gE&t=46m05s>. =head1 ACKNOWLEDGEMENTS @@ -276,6 +273,8 @@ haarg - Graham Knop (cpan:HAARG) <[email protected]> +Mithaldu - Christian Walde (cpan:MITHALDU) <[email protected]> + =head1 COPYRIGHT Copyright (c) 2012 the Import::Into L</AUTHOR> and L</CONTRIBUTORS> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Import-Into-1.002001/maint/Makefile.include new/Import-Into-1.002004/maint/Makefile.include --- old/Import-Into-1.002001/maint/Makefile.include 1970-01-01 01:00:00.000000000 +0100 +++ new/Import-Into-1.002004/maint/Makefile.include 2014-07-04 03:32:13.000000000 +0200 @@ -0,0 +1,11 @@ +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/Import-Into-1.002001/maint/bump-version new/Import-Into-1.002004/maint/bump-version --- old/Import-Into-1.002001/maint/bump-version 1970-01-01 01:00:00.000000000 +0100 +++ new/Import-Into-1.002004/maint/bump-version 2014-07-09 02:05:59.000000000 +0200 @@ -0,0 +1,39 @@ +#!/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); + +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); + +my @PM_FILES = ( 'lib/Import/Into.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/Import-Into-1.002001/t/import_into.t new/Import-Into-1.002004/t/import_into.t --- old/Import-Into-1.002001/t/import_into.t 2014-03-04 15:32:06.000000000 +0100 +++ new/Import-Into-1.002004/t/import_into.t 2014-07-09 01:52:45.000000000 +0200 @@ -12,6 +12,8 @@ sub thing { 'thing' } + $INC{"MyExporter.pm"} = 1; + package MultiExporter; use Import::Into; @@ -84,3 +86,7 @@ is $checkcaller[1], 'explicit-file.pl', 'import with hash has correct file'; is $checkcaller[2], 42, 'import with hash has correct line'; is $checkversion, 219, 'import with hash has correct version'; + +ok( !IPC::Open3->can("open3"), "IPC::Open3 is unloaded" ); +IPC::Open3->import::into("TestPackage"); +ok( TestPackage->can("open3"), "IPC::Open3 was use'd and import::into'd" ); -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
