[Bast-commits] r4334 - DBIx-Class/0.08/trunk

matthewt at dev.catalyst.perl.org matthewt at dev.catalyst.perl.org
Mon May 5 21:32:59 BST 2008


Author: matthewt
Date: 2008-05-05 21:32:58 +0100 (Mon, 05 May 2008)
New Revision: 4334

Modified:
   DBIx-Class/0.08/trunk/Changes
   DBIx-Class/0.08/trunk/Makefile.PL
Log:
improvements to the META.yml magic

Modified: DBIx-Class/0.08/trunk/Changes
===================================================================
--- DBIx-Class/0.08/trunk/Changes	2008-05-05 20:22:17 UTC (rev 4333)
+++ DBIx-Class/0.08/trunk/Changes	2008-05-05 20:32:58 UTC (rev 4334)
@@ -1,5 +1,6 @@
 Revision history for DBIx::Class
 
+        - make ash's build_requires/META.yml fixes work better
         - is_deferable support on relations used by the SQL::Translator
           parser (Anders Nor Berle)
         - Refactored DBIx::Class::Schema::Versioned

Modified: DBIx-Class/0.08/trunk/Makefile.PL
===================================================================
--- DBIx-Class/0.08/trunk/Makefile.PL	2008-05-05 20:22:17 UTC (rev 4333)
+++ DBIx-Class/0.08/trunk/Makefile.PL	2008-05-05 20:32:58 UTC (rev 4334)
@@ -1,5 +1,9 @@
 use inc::Module::Install 0.67;
+use strict;
+use warnings;
 
+use 5.006001; # delete this line if you want to send patches for earlier.
+
 name     'DBIx-Class';
 perl_version '5.006001';
 all_from 'lib/DBIx/Class.pm';
@@ -34,11 +38,19 @@
 tests "t/*.t t/*/*.t";
 
 # re-build README and require CDBI modules for testing if we're in a checkout
-if( -e 'inc/.author' ) {
-  build_requires 'DBIx::ContextualFetch';
-  build_requires 'Class::Trigger';
-  build_requires 'Time::Piece';
 
+my @force_build_requires_if_author = qw(
+  DBIx::ContextualFetch
+  Class::Trigger
+  Time::Piece
+);
+
+if ($Module::Install::AUTHOR) {
+
+  foreach my $module (@force_build_requires_if_author) {
+    build_requires $module;
+  }
+
   system('pod2text lib/DBIx/Class.pm > README');
 }
 
@@ -52,16 +64,23 @@
 if ($Module::Install::AUTHOR) {
   # Need to do this _after_ WriteAll else it looses track of them
   Meta->{values}{build_requires} = [ grep {
-    $_->[0] !~ /
-      DBIx::ContextualFetch |
-      Class::Trigger |
-      Time::Piece
-    /x;
+    my $ok = 1;
+    foreach my $module (@force_build_requires_if_author) {
+      if ($_->[0] =~ /$module/) {
+        $ok = 0;
+        last;
+      }
+    }
+    $ok;
   } @{Meta->{values}{build_requires}} ];
 
   my @scalar_keys = Module::Install::Metadata::Meta_TupleKeys();
-  sub Module::Install::Metadata::Meta_TupleKeys {
-    return @scalar_keys, 'resources';
+  my $cr = Module::Install::Metadata->can("Meta_TupleKeys");
+  {
+    no warnings 'redefine';
+    *Module::Install::Metadata::Meta_TupleKeys = sub {
+      return $cr->(@_), 'resources';
+    };
   }
   Meta->{values}{resources} = [ 
     [ 'MailingList', 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class' ],




More information about the Bast-commits mailing list