Hello community,

here is the log from the commit of package perl-Package-Variant for 
openSUSE:Factory checked in at 2014-03-18 14:16:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Package-Variant (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Package-Variant.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Package-Variant"

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/perl-Package-Variant/perl-Package-Variant.changes    
    2013-08-06 11:43:37.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.perl-Package-Variant.new/perl-Package-Variant.changes
   2014-03-18 14:16:31.000000000 +0100
@@ -1,0 +2,9 @@
+Mon Mar 17 13:12:22 UTC 2014 - [email protected]
+
+- updated to 1.002000
+  - add build_variant method on variable packages, to allow avoiding
+    importing a generator sub
+  - fix pragmas applied by modules listed in "importing" from leaking out
+    into unexpected scopes
+
+-------------------------------------------------------------------

Old:
----
  Package-Variant-1.001004.tar.gz

New:
----
  Package-Variant-1.002000.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Package-Variant.spec ++++++
--- /var/tmp/diff_new_pack.JLvX4X/_old  2014-03-18 14:16:33.000000000 +0100
+++ /var/tmp/diff_new_pack.JLvX4X/_new  2014-03-18 14:16:33.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-Package-Variant
 #
-# Copyright (c) 2013 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
@@ -17,14 +17,14 @@
 
 
 Name:           perl-Package-Variant
-Version:        1.001004
+Version:        1.002000
 Release:        0
 %define cpan_name Package-Variant
 Summary:        Parameterizable packages
 License:        Artistic-1.0 or GPL-1.0+
 Group:          Development/Libraries/Perl
 Url:            http://search.cpan.org/dist/Package-Variant/
-Source:         
http://www.cpan.org/authors/id/E/ET/ETHER/%{cpan_name}-%{version}.tar.gz
+Source:         
http://www.cpan.org/authors/id/H/HA/HAARG/%{cpan_name}-%{version}.tar.gz
 BuildArch:      noarch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  perl
@@ -33,15 +33,6 @@
 BuildRequires:  perl(Module::Runtime) >= 0.013
 BuildRequires:  perl(Test::Fatal)
 BuildRequires:  perl(strictures) >= 1
-#BuildRequires: perl(Distar)
-#BuildRequires: perl(Moo)
-#BuildRequires: perl(Moo::Role)
-#BuildRequires: perl(My::Role::OnOff)
-#BuildRequires: perl(Package::Variant)
-#BuildRequires: perl(Sub::Name)
-#BuildRequires: perl(TestArrayImports)
-#BuildRequires: perl(TestSingleImport)
-#BuildRequires: perl(TestVariable)
 Requires:       perl(Import::Into) >= 1
 Requires:       perl(Module::Runtime) >= 0.013
 Requires:       perl(strictures) >= 1
@@ -52,7 +43,7 @@
 depending on what parameters are given.
 
 Users of your package will receive a subroutine able to take parameters and
-return the name of a suitable variant package. The implmenetation does not
+return the name of a suitable variant package. The implementation does not
 care about what kind of package it builds.
 
 %prep

++++++ Package-Variant-1.001004.tar.gz -> Package-Variant-1.002000.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Package-Variant-1.001004/Changes 
new/Package-Variant-1.002000/Changes
--- old/Package-Variant-1.001004/Changes        2013-05-04 18:42:35.000000000 
+0200
+++ new/Package-Variant-1.002000/Changes        2013-12-10 20:45:21.000000000 
+0100
@@ -1,20 +1,27 @@
+Revision history for Package-Variant
 
-1.001004 - 2013-05-04
+1.002000   2013-12-10
+  - add build_variant method on variable packages, to allow avoiding
+    importing a generator sub
+  - fix pragmas applied by modules listed in "importing" from leaking out
+    into unexpected scopes
+
+1.001004   2013-05-04
   - fix documentation of "build_variant_of" method (RT#84554 -- thanks,
     Scott Miller!)
 
-1.001003 - 2013-03-25
+1.001003   2013-03-25
   - fix NAME in Makefile.PL (RT#84209)
 
-1.001002 - 2012-09-19
+1.001002   2012-09-19
   - Declare the Test::Fatal build dependency
 
-1.001001 - 2012-05-12
+1.001001   2012-05-12
   - Actually declare the Import::Into dependency (stupid mst)
 
-1.001000 - 2012-05-12
+1.001000   2012-05-12
   - Switch to Import::Into for exporting other things
   - Use Sub::Name to name installed things if available
 
-1.000000 - 2012-01-23
+1.000000   2012-01-23
   - initial release
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Package-Variant-1.001004/MANIFEST 
new/Package-Variant-1.002000/MANIFEST
--- old/Package-Variant-1.001004/MANIFEST       2013-05-04 18:43:01.000000000 
+0200
+++ new/Package-Variant-1.002000/MANIFEST       2013-12-10 20:48:16.000000000 
+0100
@@ -7,6 +7,7 @@
 t/10argument-types.t
 t/11dynamic-build.t
 t/20moo-param-role.t
+t/30-pragma-leak.t
 META.yml                                 Module YAML meta-data (added by 
MakeMaker)
 META.json                                Module JSON meta-data (added by 
MakeMaker)
 README                                   README file (added by Distar)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Package-Variant-1.001004/META.json 
new/Package-Variant-1.002000/META.json
--- old/Package-Variant-1.001004/META.json      2013-05-04 18:43:01.000000000 
+0200
+++ new/Package-Variant-1.002000/META.json      2013-12-10 20:48:16.000000000 
+0100
@@ -4,7 +4,7 @@
       "mst - Matt S. Trout (cpan:MSTROUT) <[email protected]>"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter 
version 2.130880",
+   "generated_by" : "ExtUtils::MakeMaker version 6.82, CPAN::Meta::Converter 
version 2.132830",
    "license" : [
       "perl_5"
    ],
@@ -17,6 +17,9 @@
       "directory" : [
          "t",
          "inc"
+      ],
+      "package" : [
+         "string"
       ]
    },
    "prereqs" : {
@@ -25,11 +28,6 @@
             "Test::Fatal" : "0"
          }
       },
-      "configure" : {
-         "requires" : {
-            "ExtUtils::MakeMaker" : "6.55_01"
-         }
-      },
       "runtime" : {
          "requires" : {
             "Carp" : "0",
@@ -41,10 +39,15 @@
    },
    "release_status" : "stable",
    "resources" : {
-      "homepage" : 
"http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/Package-Variant.git";,
+      "bugtracker" : {
+         "mailto" : "[email protected]",
+         "web" : 
"https://rt.cpan.org/Public/Dist/Display.html?Name=Package-Variant";
+      },
       "repository" : {
-         "url" : "git://git.shadowcat.co.uk/p5sagit/Package-Variant.git"
+         "type" : "git",
+         "url" : "git://git.shadowcat.co.uk/p5sagit/Package-Variant.git",
+         "web" : 
"http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/Package-Variant.git";
       }
    },
-   "version" : "1.001004"
+   "version" : "1.002000"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Package-Variant-1.001004/META.yml 
new/Package-Variant-1.002000/META.yml
--- old/Package-Variant-1.001004/META.yml       2013-05-04 18:43:01.000000000 
+0200
+++ new/Package-Variant-1.002000/META.yml       2013-12-10 20:48:16.000000000 
+0100
@@ -4,10 +4,8 @@
   - 'mst - Matt S. Trout (cpan:MSTROUT) <[email protected]>'
 build_requires:
   Test::Fatal: 0
-configure_requires:
-  ExtUtils::MakeMaker: 6.55_01
 dynamic_config: 0
-generated_by: 'ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 
2.130880'
+generated_by: 'ExtUtils::MakeMaker version 6.82, CPAN::Meta::Converter version 
2.132830'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -17,12 +15,14 @@
   directory:
     - t
     - inc
+  package:
+    - string
 requires:
   Carp: 0
   Import::Into: 1
   Module::Runtime: 0.013
   strictures: 1
 resources:
-  homepage: 
http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/Package-Variant.git
+  bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Package-Variant
   repository: git://git.shadowcat.co.uk/p5sagit/Package-Variant.git
-version: 1.001004
+version: 1.002000
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Package-Variant-1.001004/Makefile.PL 
new/Package-Variant-1.002000/Makefile.PL
--- old/Package-Variant-1.001004/Makefile.PL    2013-03-26 05:12:16.000000000 
+0100
+++ new/Package-Variant-1.002000/Makefile.PL    2013-12-04 13:32:48.000000000 
+0100
@@ -19,12 +19,21 @@
   },
 
   META_MERGE => {
+    'meta-spec' => { version => 2 },
     dynamic_config => 0,
 
     resources => {
       # r/w: [email protected]:Package-Variant.git
-      repository => 'git://git.shadowcat.co.uk/p5sagit/Package-Variant.git',
-      homepage => 
'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/Package-Variant.git',
+      repository => {
+        url => 'git://git.shadowcat.co.uk/p5sagit/Package-Variant.git',
+        web => 
'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/Package-Variant.git',
+        type => 'git',
+      },
+      bugtracker => {
+          mailto => '[email protected]',
+          web => 
'https://rt.cpan.org/Public/Dist/Display.html?Name=Package-Variant',
+      },
     },
+    no_index => { package => [ 'string' ] },
   },
 );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Package-Variant-1.001004/README 
new/Package-Variant-1.002000/README
--- old/Package-Variant-1.001004/README 2013-05-04 18:43:01.000000000 +0200
+++ new/Package-Variant-1.002000/README 2013-12-10 20:48:16.000000000 +0100
@@ -40,7 +40,7 @@
     variations depending on what parameters are given.
 
     Users of your package will receive a subroutine able to take parameters
-    and return the name of a suitable variant package. The implmenetation
+    and return the name of a suitable variant package. The implementation
     does not care about what kind of package it builds.
 
   Declaring a variable package
@@ -154,7 +154,7 @@
     An array reference of strings listing the names of subroutines that
     should be proxied. These subroutines are expected to be installed into
     the new variant package by the modules imported with "importing".
-    Subroutines with the same name will be availabe in your declaration
+    Subroutines with the same name will be available in your declaration
     package, and will proxy through to the newly created package when used
     within "make_variant".
 
@@ -190,6 +190,14 @@
         Exports the generator subroutine under a different name than the
         default.
 
+  build_variant
+      use Some::Variant::Package ();
+      my $variant_package = Some::Variant::Package->build_variant( @arguments 
);
+
+    This method is provided for you. It will generate a variant package and
+    return its name, just like the generator sub provided by "import". This
+    allows you to avoid importing anything into the consuming package.
+
 "Package::Variant" METHODS
     These methods are available on "Package::Variant" itself.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Package-Variant-1.001004/lib/Package/Variant.pm 
new/Package-Variant-1.002000/lib/Package/Variant.pm
--- old/Package-Variant-1.001004/lib/Package/Variant.pm 2013-05-04 
18:41:59.000000000 +0200
+++ new/Package-Variant-1.002000/lib/Package/Variant.pm 2013-12-10 
20:06:47.000000000 +0100
@@ -2,10 +2,10 @@
 
 use strictures 1;
 use Import::Into;
-use Module::Runtime qw(use_module);
+use Module::Runtime qw(require_module);
 use Carp qw(croak);
 
-our $VERSION = '1.001004'; # 1.1.4
+our $VERSION = '1.002000'; # 1.2.0
 
 $VERSION = eval $VERSION;
 
@@ -54,11 +54,10 @@
 } || sub { $_[-1] };
 
 sub import {
-  my $target = caller;
+  my $variable = caller;
   my $me = shift;
-  my $last = (split '::', $target)[-1];
+  my $last = (split '::', $variable)[-1];
   my $anon = 'A000';
-  my $variable = $target;
   my %args = @_;
   no strict 'refs';
   $Variable{$variable} = {
@@ -71,7 +70,7 @@
       map +($_ => sub {}), @{$args{subs}||[]},
     },
   };
-  *{"${target}::import"} = sub {
+  *{"${variable}::import"} = sub {
     my $target = caller;
     my (undef, %arg) = @_;
     my $as = defined($arg{as}) ? $arg{as} : $last;
@@ -82,13 +81,17 @@
   };
   my $subs = $Variable{$variable}{subs};
   foreach my $name (keys %$subs) {
-    *{"${target}::${name}"} = sub {
+    *{"${variable}::${name}"} = sub {
       goto &{$subs->{$name}}
     };
   }
-  *{"${target}::install"} = sub {
+  *{"${variable}::install"} = sub {
     goto &{$Variable{$variable}{install}};
-  }
+  };
+  *{"${variable}::build_variant"} = sub {
+    shift;
+    $me->build_variant_of($variable, @_);
+  };
 }
 
 sub build_variant_of {
@@ -96,7 +99,9 @@
   my $variant_name = "${variable}::_Variant_".++$Variable{$variable}{anon};
   foreach my $to_import (@{$Variable{$variable}{args}{importing}}) {
     my ($pkg, $args) = @$to_import;
-    use_module($pkg)->import::into($variant_name, @{$args});
+    require_module $pkg;
+    eval q{ BEGIN { $pkg->import::into($variant_name, @{$args}) }; 1; }
+      or die $@;
   }
   my $subs = $Variable{$variable}{subs};
   local @{$subs}{keys %$subs} = map $variant_name->can($_), keys %$subs;
@@ -161,7 +166,7 @@
 depending on what parameters are given.
 
 Users of your package will receive a subroutine able to take parameters
-and return the name of a suitable variant package. The implmenetation does
+and return the name of a suitable variant package. The implementation does
 not care about what kind of package it builds.
 
 =head2 Declaring a variable package
@@ -285,7 +290,7 @@
 An array reference of strings listing the names of subroutines that should
 be proxied. These subroutines are expected to be installed into the new
 variant package by the modules imported with L</importing>. Subroutines
-with the same name will be availabe in your declaration package, and will
+with the same name will be available in your declaration package, and will
 proxy through to the newly created package when used within
 L</make_variant>.
 
@@ -327,6 +332,16 @@
 
 =back
 
+=head2 build_variant
+
+  use Some::Variant::Package ();
+  my $variant_package = Some::Variant::Package->build_variant( @arguments );
+
+This method is provided for you.  It will generate a variant package
+and return its name, just like the generator sub provided by
+L</import>.  This allows you to avoid importing anything into the
+consuming package.
+
 =head1 C<Package::Variant> METHODS
 
 These methods are available on C<Package::Variant> itself.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Package-Variant-1.001004/t/01simple.t 
new/Package-Variant-1.002000/t/01simple.t
--- old/Package-Variant-1.001004/t/01simple.t   2013-03-26 05:10:17.000000000 
+0100
+++ new/Package-Variant-1.002000/t/01simple.t   2013-12-04 13:32:48.000000000 
+0100
@@ -100,6 +100,13 @@
 is_deeply [@imported], [qw( TestImportableA )],
   'scalar import works';
 
+@imported = ();
+
+TestSingleImport::->build_variant;
+
+is_deeply [@imported], [qw( TestImportableA )],
+  'build_variant works';
+
 like exception {
   Package::Variant->import(
     importing => \'foo', subs => [qw( foo )],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Package-Variant-1.001004/t/30-pragma-leak.t 
new/Package-Variant-1.002000/t/30-pragma-leak.t
--- old/Package-Variant-1.001004/t/30-pragma-leak.t     1970-01-01 
01:00:00.000000000 +0100
+++ new/Package-Variant-1.002000/t/30-pragma-leak.t     2013-12-04 
13:32:48.000000000 +0100
@@ -0,0 +1,32 @@
+use strictures 1;
+use Test::More;
+use Test::Fatal;
+use Package::Variant ();
+
+BEGIN {
+  package TestPragma;
+  use Package::Variant
+    importing => [ 'strict' ];
+  sub make_variant { }
+  $INC{'TestPragma.pm'} = __FILE__;
+}
+
+is exception {
+  eval q{
+    no strict;
+    use TestPragma;
+    $var = $var;
+    1;
+  } or die $@;
+}, undef, 'pragmas not applied where PV package used';
+
+is exception {
+  eval q{
+    no strict;
+    BEGIN { my $p = TestPragma(); }
+    $var2 = $var2;
+    1;
+  } or die $@;
+}, undef, 'pragmas not applied where PV generator used';
+
+done_testing;

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to