r53996 - in /trunk/libdevel-declare-perl: ./ debian/ inc/Module/ inc/Module/Install/ lib/Devel/ lib/Devel/Declare/MethodInstaller/ t/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Tue Mar 9 20:54:39 UTC 2010


Author: jawnsy-guest
Date: Tue Mar  9 20:54:33 2010
New Revision: 53996

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=53996
Log:
* New upstream release
* Standards-Version 3.8.4 (no changes)
* Drop unnecessary version dependencies

Added:
    trunk/libdevel-declare-perl/t/ctx-simple-like-mxms.t
      - copied unchanged from r53992, branches/upstream/libdevel-declare-perl/current/t/ctx-simple-like-mxms.t
Modified:
    trunk/libdevel-declare-perl/Changes
    trunk/libdevel-declare-perl/Declare.xs
    trunk/libdevel-declare-perl/MANIFEST
    trunk/libdevel-declare-perl/META.yml
    trunk/libdevel-declare-perl/debian/changelog
    trunk/libdevel-declare-perl/debian/control
    trunk/libdevel-declare-perl/inc/Module/Install.pm
    trunk/libdevel-declare-perl/inc/Module/Install/Base.pm
    trunk/libdevel-declare-perl/inc/Module/Install/MakeMaker.pm
    trunk/libdevel-declare-perl/inc/Module/Install/Makefile.pm
    trunk/libdevel-declare-perl/inc/Module/Install/Metadata.pm
    trunk/libdevel-declare-perl/lib/Devel/Declare.pm
    trunk/libdevel-declare-perl/lib/Devel/Declare/MethodInstaller/Simple.pm
    trunk/libdevel-declare-perl/t/debug.t
    trunk/libdevel-declare-perl/t/fail.t

Modified: trunk/libdevel-declare-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-declare-perl/Changes?rev=53996&op=diff
==============================================================================
--- trunk/libdevel-declare-perl/Changes (original)
+++ trunk/libdevel-declare-perl/Changes Tue Mar  9 20:54:33 2010
@@ -1,4 +1,7 @@
 Changes for Devel-Declare
+
+0.006000 - 09 Mar 2010
+  - Make things work on perl 5.11.2 and newer (Zefram).
 
 0.005011 - 14 Aug 2009
   - Add tests for not interpreting various things as barewords when they

Modified: trunk/libdevel-declare-perl/Declare.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-declare-perl/Declare.xs?rev=53996&op=diff
==============================================================================
--- trunk/libdevel-declare-perl/Declare.xs (original)
+++ trunk/libdevel-declare-perl/Declare.xs Tue Mar  9 20:54:33 2010
@@ -7,6 +7,12 @@
 #include <stdio.h>
 #include <string.h>
 
+#define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
+#define PERL_DECIMAL_VERSION \
+  PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
+#define PERL_VERSION_GE(r,v,s) \
+  (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
+
 #ifndef Newx
 # define Newx(v,n,t) New(0,v,n,t)
 #endif /* !Newx */
@@ -17,6 +23,8 @@
 #define DD_DEBUG_UPDATED_LINESTR (dd_debug & DD_DEBUGf_UPDATED_LINESTR)
 #define DD_DEBUG_TRACE (dd_debug & DD_DEBUGf_TRACE)
 static int dd_debug = 0;
+
+#define DD_CONST_VIA_RV2CV PERL_VERSION_GE(5,11,2)
 
 #define LEX_NORMAL    10
 #define LEX_INTERPNORMAL   9
@@ -224,41 +232,48 @@
   return s - base_s;
 }
 
+static void call_done_declare(pTHX) {
+  dSP;
+
+  if (DD_DEBUG_TRACE) {
+    printf("Deconstructing declare\n");
+    printf("PL_bufptr: %s\n", PL_bufptr);
+    printf("bufend at: %i\n", PL_bufend - PL_bufptr);
+    printf("linestr: %s\n", SvPVX(PL_linestr));
+    printf("linestr len: %i\n", PL_bufend - SvPVX(PL_linestr));
+  }
+
+  ENTER;
+  SAVETMPS;
+
+  PUSHMARK(SP);
+
+  call_pv("Devel::Declare::done_declare", G_VOID|G_DISCARD);
+
+  FREETMPS;
+  LEAVE;
+
+  if (DD_DEBUG_TRACE) {
+    printf("PL_bufptr: %s\n", PL_bufptr);
+    printf("bufend at: %i\n", PL_bufend - PL_bufptr);
+    printf("linestr: %s\n", SvPVX(PL_linestr));
+    printf("linestr len: %i\n", PL_bufend - SvPVX(PL_linestr));
+    printf("actual len: %i\n", strlen(PL_bufptr));
+  }
+}
+
+static int dd_handle_const(pTHX_ char *name);
+
 /* replacement PL_check rv2cv entry */
 
 STATIC OP *dd_ck_rv2cv(pTHX_ OP *o, void *user_data) {
-  dSP;
   OP* kid;
   int dd_flags;
 
   PERL_UNUSED_VAR(user_data);
 
   if (in_declare) {
-    if (DD_DEBUG_TRACE) {
-      printf("Deconstructing declare\n");
-      printf("PL_bufptr: %s\n", PL_bufptr);
-      printf("bufend at: %i\n", PL_bufend - PL_bufptr);
-      printf("linestr: %s\n", SvPVX(PL_linestr));
-      printf("linestr len: %i\n", PL_bufend - SvPVX(PL_linestr));
-    }
-
-    ENTER;
-    SAVETMPS;
-
-    PUSHMARK(SP);
-
-    call_pv("Devel::Declare::done_declare", G_VOID|G_DISCARD);
-
-    FREETMPS;
-    LEAVE;
-
-    if (DD_DEBUG_TRACE) {
-      printf("PL_bufptr: %s\n", PL_bufptr);
-      printf("bufend at: %i\n", PL_bufend - PL_bufptr);
-      printf("linestr: %s\n", SvPVX(PL_linestr));
-      printf("linestr len: %i\n", PL_bufend - SvPVX(PL_linestr));
-      printf("actual len: %i\n", strlen(PL_bufptr));
-    }
+    call_done_declare(aTHX);
     return o;
   }
 
@@ -283,6 +298,24 @@
     printf("dd_flags are: %i\n", dd_flags);
     printf("PL_tokenbuf: %s\n", PL_tokenbuf);
   }
+
+#if DD_CONST_VIA_RV2CV
+  if (PL_expect != XOPERATOR) {
+    if (!dd_handle_const(aTHX_ GvNAME(kGVOP_gv)))
+      return o;
+    CopLINE(PL_curcop) = PL_copline;
+    /* The parser behaviour that we're simulating depends on what comes
+       after the declarator. */
+    if (*skipspace(PL_bufptr + strlen(GvNAME(kGVOP_gv))) != '(') {
+      if (in_declare) {
+        call_done_declare(aTHX);
+      } else {
+        dd_linestr_callback(aTHX_ "rv2cv", GvNAME(kGVOP_gv));
+      }
+    }
+    return o;
+  }
+#endif /* DD_CONST_VIA_RV2CV */
 
   dd_linestr_callback(aTHX_ "rv2cv", GvNAME(kGVOP_gv));
 
@@ -341,33 +374,7 @@
   return count;
 }
 
-STATIC OP *dd_ck_const(pTHX_ OP *o, void *user_data) {
-  int dd_flags;
-  char* name;
-
-  PERL_UNUSED_VAR(user_data);
-
-  if (DD_HAVE_PARSER && PL_expect == XOPERATOR) {
-    return o;
-  }
-
-  /* if this is set, we just grabbed a delimited string or something,
-     not a bareword, so NO TOUCHY */
-
-  if (DD_HAVE_LEX_STUFF)
-    return o;
-
-  /* don't try and look this up if it's not a string const */
-  if (!SvPOK(cSVOPo->op_sv))
-    return o;
-
-  name = SvPVX(cSVOPo->op_sv);
-
-  dd_flags = dd_is_declarator(aTHX_ name);
-
-  if (dd_flags == -1)
-    return o;
-
+static int dd_handle_const(pTHX_ char *name) {
   switch (PL_lex_inwhat) {
     case OP_QR:
     case OP_MATCH:
@@ -375,14 +382,14 @@
     case OP_TRANS:
     case OP_BACKTICK:
     case OP_STRINGIFY:
-      return o;
+      return 0;
       break;
     default:
       break;
   }
 
   if (strnEQ(PL_bufptr, "->", 2)) {
-    return o;
+    return 0;
   }
 
   {
@@ -401,7 +408,7 @@
       sv_catpvn(inject, s, d - s);
 
       if ((PL_bufend - d) >= 2 && strnEQ(d, "=>", 2)) {
-        return o;
+        return 0;
       }
 
       sv_catpv(inject, d);
@@ -413,8 +420,44 @@
 
   dd_linestr_callback(aTHX_ "const", name);
 
+  return 1;
+}
+
+#if !DD_CONST_VIA_RV2CV
+
+STATIC OP *dd_ck_const(pTHX_ OP *o, void *user_data) {
+  int dd_flags;
+  char* name;
+
+  PERL_UNUSED_VAR(user_data);
+
+  if (DD_HAVE_PARSER && PL_expect == XOPERATOR) {
+    return o;
+  }
+
+  /* if this is set, we just grabbed a delimited string or something,
+     not a bareword, so NO TOUCHY */
+
+  if (DD_HAVE_LEX_STUFF)
+    return o;
+
+  /* don't try and look this up if it's not a string const */
+  if (!SvPOK(cSVOPo->op_sv))
+    return o;
+
+  name = SvPVX(cSVOPo->op_sv);
+
+  dd_flags = dd_is_declarator(aTHX_ name);
+
+  if (dd_flags == -1)
+    return o;
+
+  dd_handle_const(aTHX_ name);
+
   return o;
 }
+
+#endif /* !DD_CONST_VIA_RV2CV */
 
 static int initialized = 0;
 
@@ -428,7 +471,9 @@
   if (!initialized++) {
     hook_op_check(OP_RV2CV, dd_ck_rv2cv, NULL);
     hook_op_check(OP_ENTEREVAL, dd_ck_entereval, NULL);
+#if !DD_CONST_VIA_RV2CV
     hook_op_check(OP_CONST, dd_ck_const, NULL);
+#endif /* !DD_CONST_VIA_RV2CV */
   }
   filter_add(dd_filter_realloc, NULL);
 

Modified: trunk/libdevel-declare-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-declare-perl/MANIFEST?rev=53996&op=diff
==============================================================================
--- trunk/libdevel-declare-perl/MANIFEST (original)
+++ trunk/libdevel-declare-perl/MANIFEST Tue Mar  9 20:54:33 2010
@@ -16,6 +16,7 @@
 t/00load.t
 t/build_sub_installer.t
 t/combi.t
+t/ctx-simple-like-mxms.t
 t/ctx-simple.t
 t/debug.pl
 t/debug.t

Modified: trunk/libdevel-declare-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-declare-perl/META.yml?rev=53996&op=diff
==============================================================================
--- trunk/libdevel-declare-perl/META.yml (original)
+++ trunk/libdevel-declare-perl/META.yml Tue Mar  9 20:54:33 2010
@@ -11,7 +11,7 @@
   ExtUtils::Depends: 0.302
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
-generated_by: 'Module::Install version 0.91'
+generated_by: 'Module::Install version 0.92'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -30,4 +30,4 @@
 resources:
   license: http://dev.perl.org/licenses/
   repository: git://github.com/rafl/devel-declare.git
-version: 0.005011
+version: 0.006000

Modified: trunk/libdevel-declare-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-declare-perl/debian/changelog?rev=53996&op=diff
==============================================================================
--- trunk/libdevel-declare-perl/debian/changelog (original)
+++ trunk/libdevel-declare-perl/debian/changelog Tue Mar  9 20:54:33 2010
@@ -1,4 +1,9 @@
-libdevel-declare-perl (0.005011-3) UNRELEASED; urgency=low
+libdevel-declare-perl (0.006000-1) UNRELEASED; urgency=low
+
+  [ Jonathan Yu ]
+  * New upstream release
+  * Standards-Version 3.8.4 (no changes)
+  * Drop unnecessary version dependencies
 
   [ Ryan Niebur ]
   * Update ryan52's email address
@@ -7,7 +12,7 @@
   * Drop use-old-test-simple.patch now that #541342 is fixed, build depend on
     "perl (>= 5.10.1) | libtest-simple-perl (>= 0.88)". Drop quilt framework.
 
- -- Ryan Niebur <ryan at debian.org>  Fri, 25 Sep 2009 00:24:37 -0700
+ -- Jonathan Yu <jawnsy at cpan.org>  Tue, 09 Mar 2010 16:20:48 -0500
 
 libdevel-declare-perl (0.005011-2) unstable; urgency=low
 

Modified: trunk/libdevel-declare-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-declare-perl/debian/control?rev=53996&op=diff
==============================================================================
--- trunk/libdevel-declare-perl/debian/control (original)
+++ trunk/libdevel-declare-perl/debian/control Tue Mar  9 20:54:33 2010
@@ -2,15 +2,15 @@
 Section: perl
 Priority: optional
 Build-Depends: perl, debhelper (>= 7.0.50~),
- libextutils-depends-perl, libb-hooks-op-check-perl (>= 0.17),
- libb-hooks-endofscope-perl (>= 0.05), libsub-name-perl,
+ libextutils-depends-perl, libb-hooks-op-check-perl,
+ libb-hooks-endofscope-perl, libsub-name-perl,
  perl (>= 5.10.1) | libtest-simple-perl (>= 0.88)
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Jonathan Yu <jawnsy at cpan.org>,
  Ryan Niebur <ryan at debian.org>,
  Ansgar Burchardt <ansgar at 43-1.org>,
  Damyan Ivanov <dmn at debian.org>
-Standards-Version: 3.8.3
+Standards-Version: 3.8.4
 Homepage: http://search.cpan.org/dist/Devel-Declare/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libdevel-declare-perl/
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libdevel-declare-perl/
@@ -18,9 +18,8 @@
 Package: libdevel-declare-perl
 Architecture: any
 Depends: ${perl:Depends}, ${shlibs:Depends}, ${misc:Depends},
- libb-hooks-op-check-perl (>= 0.17), libb-hooks-endofscope-perl (>= 0.05),
- libsub-name-perl
-Description: Perl module to add new syntax to Perl
+ libb-hooks-op-check-perl, libb-hooks-endofscope-perl, libsub-name-perl
+Description: module to add new syntax to Perl
  Devel::Declare can install subroutines called declarators which locally take
  over control of Perl's parser, allowing the creation of new syntax, including
  keywords and other constructs that might not be, in themselves, valid Perl 5

Modified: trunk/libdevel-declare-perl/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-declare-perl/inc/Module/Install.pm?rev=53996&op=diff
==============================================================================
--- trunk/libdevel-declare-perl/inc/Module/Install.pm (original)
+++ trunk/libdevel-declare-perl/inc/Module/Install.pm Tue Mar  9 20:54:33 2010
@@ -28,7 +28,7 @@
 	# This is not enforced yet, but will be some time in the next few
 	# releases once we can make sure it won't clash with custom
 	# Module::Install extensions.
-	$VERSION = '0.91';
+	$VERSION = '0.92';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -348,17 +348,24 @@
 	return $call;
 }
 
+# Done in evals to avoid confusing Perl::MinimumVersion
+eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
 sub _read {
 	local *FH;
-	if ( $] >= 5.006 ) {
-		open( FH, '<', $_[0] ) or die "open($_[0]): $!";
-	} else {
-		open( FH, "< $_[0]"  ) or die "open($_[0]): $!";
-	}
+	open( FH, '<', $_[0] ) or die "open($_[0]): $!";
 	my $string = do { local $/; <FH> };
 	close FH or die "close($_[0]): $!";
 	return $string;
 }
+END_NEW
+sub _read {
+	local *FH;
+	open( FH, "< $_[0]"  ) or die "open($_[0]): $!";
+	my $string = do { local $/; <FH> };
+	close FH or die "close($_[0]): $!";
+	return $string;
+}
+END_OLD
 
 sub _readperl {
 	my $string = Module::Install::_read($_[0]);
@@ -379,18 +386,26 @@
 	return $string;
 }
 
+# Done in evals to avoid confusing Perl::MinimumVersion
+eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
 sub _write {
 	local *FH;
-	if ( $] >= 5.006 ) {
-		open( FH, '>', $_[0] ) or die "open($_[0]): $!";
-	} else {
-		open( FH, "> $_[0]"  ) or die "open($_[0]): $!";
-	}
+	open( FH, '>', $_[0] ) or die "open($_[0]): $!";
 	foreach ( 1 .. $#_ ) {
 		print FH $_[$_] or die "print($_[0]): $!";
 	}
 	close FH or die "close($_[0]): $!";
 }
+END_NEW
+sub _write {
+	local *FH;
+	open( FH, "> $_[0]"  ) or die "open($_[0]): $!";
+	foreach ( 1 .. $#_ ) {
+		print FH $_[$_] or die "print($_[0]): $!";
+	}
+	close FH or die "close($_[0]): $!";
+}
+END_OLD
 
 # _version is for processing module versions (eg, 1.03_05) not
 # Perl versions (eg, 5.8.1).
@@ -427,4 +442,4 @@
 
 1;
 
-# Copyright 2008 - 2009 Adam Kennedy.
+# Copyright 2008 - 2010 Adam Kennedy.

Modified: trunk/libdevel-declare-perl/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-declare-perl/inc/Module/Install/Base.pm?rev=53996&op=diff
==============================================================================
--- trunk/libdevel-declare-perl/inc/Module/Install/Base.pm (original)
+++ trunk/libdevel-declare-perl/inc/Module/Install/Base.pm Tue Mar  9 20:54:33 2010
@@ -4,7 +4,7 @@
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.92';
 }
 
 # Suspend handler for "redefined" warnings

Modified: trunk/libdevel-declare-perl/inc/Module/Install/MakeMaker.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-declare-perl/inc/Module/Install/MakeMaker.pm?rev=53996&op=diff
==============================================================================
--- trunk/libdevel-declare-perl/inc/Module/Install/MakeMaker.pm (original)
+++ trunk/libdevel-declare-perl/inc/Module/Install/MakeMaker.pm Tue Mar  9 20:54:33 2010
@@ -7,12 +7,12 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.92';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
 
-my $makefile;
+my $makefile = undef;
 
 sub WriteMakefile {
     my ($self, %args) = @_;
@@ -36,6 +36,12 @@
         }
     }
 
+    if (my $prereq = delete($args{BUILD_REQUIRES})) {
+        while (my($k,$v) = each %$prereq) {
+            $self->build_requires($k,$v);
+        }
+    }
+
     # put the remaining args to makemaker_args
     $self->makemaker_args(%args);
 }

Modified: trunk/libdevel-declare-perl/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-declare-perl/inc/Module/Install/Makefile.pm?rev=53996&op=diff
==============================================================================
--- trunk/libdevel-declare-perl/inc/Module/Install/Makefile.pm (original)
+++ trunk/libdevel-declare-perl/inc/Module/Install/Makefile.pm Tue Mar  9 20:54:33 2010
@@ -7,7 +7,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.92';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -34,6 +34,17 @@
 	}
 }
 
+# Store a cleaned up version of the MakeMaker version,
+# since we need to behave differently in a variety of
+# ways based on the MM version.
+my $makemaker = eval $ExtUtils::MakeMaker::VERSION;
+
+# If we are passed a param, do a "newer than" comparison.
+# Otherwise, just return the MakeMaker version.
+sub makemaker {
+	( @_ < 2 or $makemaker >= eval($_[1]) ) ? $makemaker : 0
+}
+
 sub makemaker_args {
 	my $self = shift;
 	my $args = ( $self->{makemaker_args} ||= {} );
@@ -44,7 +55,7 @@
 # For mm args that take multiple space-seperated args,
 # append an argument to the current list.
 sub makemaker_append {
-	my $self = sShift;
+	my $self = shift;
 	my $name = shift;
 	my $args = $self->makemaker_args;
 	$args->{name} = defined $args->{$name}
@@ -130,12 +141,13 @@
 		# an underscore, even though its own version may contain one!
 		# Hence the funny regexp to get rid of it.  See RT #35800
 		# for details.
-		$self->build_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
-		$self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
+		my $v = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/;
+		$self->build_requires(     'ExtUtils::MakeMaker' => $v );
+		$self->configure_requires( 'ExtUtils::MakeMaker' => $v );
 	} else {
 		# Allow legacy-compatibility with 5.005 by depending on the
 		# most recent EU:MM that supported 5.005.
-		$self->build_requires( 'ExtUtils::MakeMaker' => 6.42 );
+		$self->build_requires(     'ExtUtils::MakeMaker' => 6.42 );
 		$self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
 	}
 
@@ -152,42 +164,62 @@
 		$args->{ABSTRACT} = $self->abstract;
 		$args->{AUTHOR}   = $self->author;
 	}
-	if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
+	if ( $self->makemaker(6.10) ) {
 		$args->{NO_META} = 1;
 	}
-	if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
+	if ( $self->makemaker(6.17) and $self->sign ) {
 		$args->{SIGN} = 1;
 	}
 	unless ( $self->is_admin ) {
 		delete $args->{SIGN};
 	}
 
-	# Merge both kinds of requires into prereq_pm
 	my $prereq = ($args->{PREREQ_PM} ||= {});
 	%$prereq = ( %$prereq,
-		map { @$_ }
+		map { @$_ } # flatten [module => version]
 		map { @$_ }
 		grep $_,
-		($self->configure_requires, $self->build_requires, $self->requires)
+		($self->requires)
 	);
 
 	# Remove any reference to perl, PREREQ_PM doesn't support it
 	delete $args->{PREREQ_PM}->{perl};
 
-	# merge both kinds of requires into prereq_pm
+	# Merge both kinds of requires into BUILD_REQUIRES
+	my $build_prereq = ($args->{BUILD_REQUIRES} ||= {});
+	%$build_prereq = ( %$build_prereq,
+		map { @$_ } # flatten [module => version]
+		map { @$_ }
+		grep $_,
+		($self->configure_requires, $self->build_requires)
+	);
+
+	# Remove any reference to perl, BUILD_REQUIRES doesn't support it
+	delete $args->{BUILD_REQUIRES}->{perl};
+
+	# Delete bundled dists from prereq_pm
 	my $subdirs = ($args->{DIR} ||= []);
 	if ($self->bundles) {
 		foreach my $bundle (@{ $self->bundles }) {
 			my ($file, $dir) = @$bundle;
 			push @$subdirs, $dir if -d $dir;
-			delete $prereq->{$file};
+			delete $build_prereq->{$file}; #Delete from build prereqs only
 		}
+	}
+
+	unless ( $self->makemaker('6.55_03') ) {
+		%$prereq = (%$prereq,%$build_prereq);
+		delete $args->{BUILD_REQUIRES};
 	}
 
 	if ( my $perl_version = $self->perl_version ) {
 		eval "use $perl_version; 1"
 			or die "ERROR: perl: Version $] is installed, "
 			. "but we need version >= $perl_version";
+
+		if ( $self->makemaker(6.48) ) {
+			$args->{MIN_PERL_VERSION} = $perl_version;
+		}
 	}
 
 	$args->{INSTALLDIRS} = $self->installdirs;
@@ -265,4 +297,4 @@
 
 __END__
 
-#line 394
+#line 426

Modified: trunk/libdevel-declare-perl/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-declare-perl/inc/Module/Install/Metadata.pm?rev=53996&op=diff
==============================================================================
--- trunk/libdevel-declare-perl/inc/Module/Install/Metadata.pm (original)
+++ trunk/libdevel-declare-perl/inc/Module/Install/Metadata.pm Tue Mar  9 20:54:33 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.92';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -230,6 +230,8 @@
 		die("The path '$file' does not exist, or is not a file");
 	}
 
+    $self->{values}{all_from} = $file;
+
 	# Some methods pull from POD instead of code.
 	# If there is a matching .pod, use that instead
 	my $pod = $file;
@@ -385,11 +387,10 @@
 	}
 }
 
-sub perl_version_from {
-	my $self = shift;
+sub _extract_perl_version {
 	if (
-		Module::Install::_read($_[0]) =~ m/
-		^
+		$_[0] =~ m/
+		^\s*
 		(?:use|require) \s*
 		v?
 		([\d_\.]+)
@@ -398,6 +399,16 @@
 	) {
 		my $perl_version = $1;
 		$perl_version =~ s{_}{}g;
+		return $perl_version;
+	} else {
+		return;
+	}
+}
+
+sub perl_version_from {
+	my $self = shift;
+	my $perl_version=_extract_perl_version(Module::Install::_read($_[0]));
+	if ($perl_version) {
 		$self->perl_version($perl_version);
 	} else {
 		warn "Cannot determine perl version info from $_[0]\n";
@@ -425,13 +436,12 @@
 	}
 }
 
-sub license_from {
-	my $self = shift;
+sub _extract_license {
 	if (
-		Module::Install::_read($_[0]) =~ m/
+		$_[0] =~ m/
 		(
 			=head \d \s+
-			(?:licen[cs]e|licensing|copyright|legal)\b
+			(?:licen[cs]e|licensing|copyrights?|legal)\b
 			.*?
 		)
 		(=head\\d.*|=cut.*|)
@@ -439,7 +449,8 @@
 	/ixms ) {
 		my $license_text = $1;
 		my @phrases      = (
-			'under the same (?:terms|license) as (?:perl|the perl programming language) itself' => 'perl', 1,
+			'under the same (?:terms|license) as (?:perl|the perl programming language)' => 'perl', 1,
+			'under the terms of (?:perl|the perl programming language) itself' => 'perl', 1,
 			'GNU general public license'         => 'gpl',         1,
 			'GNU public license'                 => 'gpl',         1,
 			'GNU lesser general public license'  => 'lgpl',        1,
@@ -456,20 +467,32 @@
 			'proprietary'                        => 'proprietary', 0,
 		);
 		while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
-			$pattern =~ s{\s+}{\\s+}g;
+			$pattern =~ s#\s+#\\s+#gs;
 			if ( $license_text =~ /\b$pattern\b/i ) {
-				$self->license($license);
-				return 1;
+			        return $license;
 			}
 		}
-	}
-
-	warn "Cannot determine license info from $_[0]\n";
-	return 'unknown';
+	} else {
+	        return;
+	}
+}
+
+sub license_from {
+	my $self = shift;
+	if (my $license=_extract_license(Module::Install::_read($_[0]))) {
+		$self->license($license);
+	} else {
+		warn "Cannot determine license info from $_[0]\n";
+		return 'unknown';
+	}
 }
 
 sub _extract_bugtracker {
-	my @links   = $_[0] =~ m#L<(\Qhttp://rt.cpan.org/\E[^>]+)>#g;
+	my @links   = $_[0] =~ m#L<(
+	 \Qhttp://rt.cpan.org/\E[^>]+|
+	 \Qhttp://github.com/\E[\w_]+/[\w_]+/issues|
+	 \Qhttp://code.google.com/p/\E[\w_\-]+/issues/list
+	 )>#gx;
 	my %links;
 	@links{@links}=();
 	@links=keys %links;
@@ -485,7 +508,7 @@
 		return 0;
 	}
 	if ( @links > 1 ) {
-		warn "Found more than on rt.cpan.org link in $_[0]\n";
+		warn "Found more than one bugtracker link in $_[0]\n";
 		return 0;
 	}
 

Modified: trunk/libdevel-declare-perl/lib/Devel/Declare.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-declare-perl/lib/Devel/Declare.pm?rev=53996&op=diff
==============================================================================
--- trunk/libdevel-declare-perl/lib/Devel/Declare.pm (original)
+++ trunk/libdevel-declare-perl/lib/Devel/Declare.pm Tue Mar  9 20:54:33 2010
@@ -4,7 +4,7 @@
 use warnings;
 use 5.008001;
 
-our $VERSION = '0.005011';
+our $VERSION = '0.006000';
 
 use constant DECLARE_NAME => 1;
 use constant DECLARE_PROTO => 2;

Modified: trunk/libdevel-declare-perl/lib/Devel/Declare/MethodInstaller/Simple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-declare-perl/lib/Devel/Declare/MethodInstaller/Simple.pm?rev=53996&op=diff
==============================================================================
--- trunk/libdevel-declare-perl/lib/Devel/Declare/MethodInstaller/Simple.pm (original)
+++ trunk/libdevel-declare-perl/lib/Devel/Declare/MethodInstaller/Simple.pm Tue Mar  9 20:54:33 2010
@@ -7,7 +7,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '0.003005';
+our $VERSION = '0.006000';
 
 sub install_methodhandler {
   my $class = shift;

Modified: trunk/libdevel-declare-perl/t/debug.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-declare-perl/t/debug.t?rev=53996&op=diff
==============================================================================
--- trunk/libdevel-declare-perl/t/debug.t (original)
+++ trunk/libdevel-declare-perl/t/debug.t Tue Mar  9 20:54:33 2010
@@ -1,7 +1,13 @@
 use strict;
 use warnings;
 
-use Test::More tests => 1;
+use Test::More;
+
+BEGIN {
+  if($] eq "5.011002") {
+    plan skip_all => "line debugging broken on 5.11.2";
+  }
+}
 
 use Cwd qw/cwd/;
 use FindBin qw/$Bin/;
@@ -25,4 +31,5 @@
 
 like($output, qr/method new {}, sub {my \$self = shift;/,
   "replaced line string visible in debug lines");
-1;
+
+done_testing;

Modified: trunk/libdevel-declare-perl/t/fail.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-declare-perl/t/fail.t?rev=53996&op=diff
==============================================================================
--- trunk/libdevel-declare-perl/t/fail.t (original)
+++ trunk/libdevel-declare-perl/t/fail.t Tue Mar  9 20:54:33 2010
@@ -1,23 +1,31 @@
-use Devel::Declare;
+use strict;
+use warnings;
+use Test::More 'no_plan';
 
 use Devel::Declare::MethodInstaller::Simple;
-BEGIN { Devel::Declare::MethodInstaller::Simple->install_methodhandler(name => 'method', into => 'main') };
-
-use Test::More 'no_plan';
+BEGIN {
+    Devel::Declare::MethodInstaller::Simple->install_methodhandler(
+        name => 'method',
+        into => __PACKAGE__,
+    );
+}
 
 TODO: {
-    local $TODO='Method does not throw proper errors for bad parens yet';
+    local $TODO = 'Method does not throw proper errors for bad parens yet';
+
     eval 'method main ( { return "foo" }';
-    like($@,qr/Prototype\snot\sterminated/,'Missing end parens'); 
+    like($@, qr/Prototype\snot\sterminated/, 'Missing end parens');
 
     eval 'method main ) { return "foo" }';
-    like($@,qr/Illegal\sdeclaration\sof\ssubroutine/,'Missing start parens');
+    like($@, qr/Illegal\sdeclaration\sof\ssubroutine/, 'Missing start parens');
 };
 
 TODO: {
-    local $TODO='method does not disallow invalid sub names';
-    eval 'method 1main() { return "foo" }','Sub starting with a number';
-    like($@,qr/Illegal\sdeclaration\sof\sanonymous\ssubroutine/); 
-    eval 'method møø() { return "foo" }','Sub with unicode';
-    like($@,qr/Illegal\sdeclaration\sof\ssubroutine\smain\:\:m/); 
-};
+    local $TODO = 'method does not disallow invalid sub names';
+
+    eval 'method 1main() { return "foo" }';
+    like($@, qr/Illegal\sdeclaration\sof\sanonymous\ssubroutine/, 'starting with a number');
+
+    eval 'method møø() { return "foo" }';
+    like($@, qr/Illegal\sdeclaration\sof\ssubroutine\smain\:\:m/, 'with unicode');
+};




More information about the Pkg-perl-cvs-commits mailing list