r40060 - in /branches/upstream/libdbix-searchbuilder-perl/current: ./ SearchBuilder/Handle/ inc/Module/ inc/Module/Install/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Fri Jul 17 15:16:51 UTC 2009


Author: jawnsy-guest
Date: Fri Jul 17 15:16:46 2009
New Revision: 40060

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=40060
Log:
[svn-upgrade] Integrating new upstream version, libdbix-searchbuilder-perl (1.56)

Modified:
    branches/upstream/libdbix-searchbuilder-perl/current/Changes
    branches/upstream/libdbix-searchbuilder-perl/current/META.yml
    branches/upstream/libdbix-searchbuilder-perl/current/SIGNATURE
    branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder.pm
    branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/Oracle.pm
    branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/Pg.pm
    branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/SQLite.pm
    branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/mysql.pm
    branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/AutoInstall.pm
    branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install.pm
    branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/AutoInstall.pm
    branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Base.pm
    branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Include.pm
    branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Makefile.pm
    branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Metadata.pm

Modified: branches/upstream/libdbix-searchbuilder-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbix-searchbuilder-perl/current/Changes?rev=40060&op=diff
==============================================================================
--- branches/upstream/libdbix-searchbuilder-perl/current/Changes (original)
+++ branches/upstream/libdbix-searchbuilder-perl/current/Changes Fri Jul 17 15:16:46 2009
@@ -1,4 +1,11 @@
 Revision history for Perl extension DBIx::SearchBuilder.
+
+1.56 Fri Jul 17 02:05:32 MSD 2009
+
+* Don't use LOWER/ILIKE with dates, heuristic is used, but shouldn't
+  harm other things
+* Don't apply DISTINCT on queries with group by, COUNT(DISTINCT x) is
+  different and covered in Column method
 
 1.55 Thu May  7 19:44:47 MSD 2009
 
@@ -17,8 +24,6 @@
 * When aborting transactions, we need to flush our cache,
   because SQLite is reusing the primary id for later inserts and the cache
   can otherwise become inconsistent.
-
-
 
 1.53 Tue Apr  2 03:06:56 UTC 2008
 

Modified: branches/upstream/libdbix-searchbuilder-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbix-searchbuilder-perl/current/META.yml?rev=40060&op=diff
==============================================================================
--- branches/upstream/libdbix-searchbuilder-perl/current/META.yml (original)
+++ branches/upstream/libdbix-searchbuilder-perl/current/META.yml Fri Jul 17 15:16:46 2009
@@ -10,7 +10,7 @@
 configure_requires:
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
-generated_by: 'Module::Install version 0.85'
+generated_by: 'Module::Install version 0.91'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -30,4 +30,4 @@
   Want: 0
 resources:
   license: http://dev.perl.org/licenses/
-version: 1.55
+version: 1.56

Modified: branches/upstream/libdbix-searchbuilder-perl/current/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbix-searchbuilder-perl/current/SIGNATURE?rev=40060&op=diff
==============================================================================
--- branches/upstream/libdbix-searchbuilder-perl/current/SIGNATURE (original)
+++ branches/upstream/libdbix-searchbuilder-perl/current/SIGNATURE Fri Jul 17 15:16:46 2009
@@ -14,21 +14,21 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-SHA1 a6d87fcf148ef11e769aaf26412148880b492264 Changes
+SHA1 89fb198cd5cb5e21c4ac5160bdc9201eb9f0e026 Changes
 SHA1 ddd4097470d90cd802af26e3da85db40645906b7 MANIFEST
-SHA1 c4d523f038279f020c87130599ced59d0ce9270c META.yml
+SHA1 6a3d6b05206b520c2c3c24de4bf6734c19efa280 META.yml
 SHA1 7f3870fd1159dc9ad4c1666a58d89feb0cbfae3a Makefile.PL
 SHA1 d7a41642c368f2a587587e09f9e815d434feebff README
 SHA1 5a53d12d5cccd94845a6a7cc105cd9be34e20f1c ROADMAP
-SHA1 d4a4301baadc675a3fd75abcd770098962a93626 SearchBuilder.pm
+SHA1 6053ab0e5916a3cc1a7012124612a3ad5d2fe6aa SearchBuilder.pm
 SHA1 a19c8ecdc762bcd6f5c34f4d92b66af11d41889b SearchBuilder/Handle.pm
 SHA1 55d337e6dd1ab5aecc39d2ae491bffb12e9ca449 SearchBuilder/Handle/Informix.pm
 SHA1 4efdcaefa5f94d994b052d1b343d2f5164ef4b52 SearchBuilder/Handle/ODBC.pm
-SHA1 23999d3eeea59a589a35bae83ad4d61ad174af34 SearchBuilder/Handle/Oracle.pm
-SHA1 d44219edc07ab29588163d8d622ef7247bc34672 SearchBuilder/Handle/Pg.pm
-SHA1 a15df795395ddaf78314d593776fc3d09e9da992 SearchBuilder/Handle/SQLite.pm
+SHA1 2adeee67cfaaccc3728ca27f5aee9de91d6f2ee7 SearchBuilder/Handle/Oracle.pm
+SHA1 2fac7a7c99acdf2ab0a17bf1a1188e043f75a044 SearchBuilder/Handle/Pg.pm
+SHA1 33300f29f601f259cd483e7cba69938bc133f833 SearchBuilder/Handle/SQLite.pm
 SHA1 ec3fbc03b27c008d93a52b6b7fb0076529e5fcc8 SearchBuilder/Handle/Sybase.pm
-SHA1 1f945f4c96676977adccf3a4288cff7fc9e819ad SearchBuilder/Handle/mysql.pm
+SHA1 1ca13e69a8f02944469f448e72604e5cc9dad162 SearchBuilder/Handle/mysql.pm
 SHA1 877685aaff265e36fa37298c372aa56864f68aa5 SearchBuilder/Handle/mysqlPP.pm
 SHA1 5dd029a91e72614d7aaf201b277a668c540e7dff SearchBuilder/Record.pm
 SHA1 1680fe8c21ca1667c55501c5f0e9b7bef434647f SearchBuilder/Record/Cachable.pm
@@ -38,13 +38,13 @@
 SHA1 e7c7c7c91025072d25da78c93cefa2bc0aaf2b35 ex/Example/Model/Address.pm
 SHA1 f821661849153c21ad99393b6a3ea6720fdaf581 ex/Example/Model/Employee.pm
 SHA1 9689368197327e7b38af7f3d1f863e918ed4fa98 ex/create_tables.pl
-SHA1 6cc7c33dbf3e1635f38ac2acc983c410cd0da679 inc/Module/AutoInstall.pm
-SHA1 18fcb6b27722fad5e465689f9622b03fd6b7d51c inc/Module/Install.pm
-SHA1 f70c42b0ad50721e6480a41346ccb6781e2e2706 inc/Module/Install/AutoInstall.pm
-SHA1 65bc57bf8257e3b66ec571850570626283ca659c inc/Module/Install/Base.pm
-SHA1 2eef5f385c92c0768b347324d2850fce5a3a39aa inc/Module/Install/Include.pm
-SHA1 c45b2672d8ae49d710343f39f68d00c28cba4b43 inc/Module/Install/Makefile.pm
-SHA1 82e172b951d97f74315af04cb7b909afa546fc07 inc/Module/Install/Metadata.pm
+SHA1 e5fb92ac217988bfc7a6af739b0459627020a27e inc/Module/AutoInstall.pm
+SHA1 fd5f3c4f0418efee3b9b16cf8c3902e8374909df inc/Module/Install.pm
+SHA1 5c529e96420d964b192f011b121283a4916f7331 inc/Module/Install/AutoInstall.pm
+SHA1 7cd7c349afdf3f012e475507b1017bdfa796bfbd inc/Module/Install/Base.pm
+SHA1 219da5a95c290312a81477b226f005997d97dcfd inc/Module/Install/Include.pm
+SHA1 3e83972921d54198d1246f7278f08664006cd65d inc/Module/Install/Makefile.pm
+SHA1 12bf1867955480d47d5171a9e9c6a96fabe0b58f inc/Module/Install/Metadata.pm
 SHA1 e59ea21b9407644714a5f67c7132a11916c25133 t/00.load.t
 SHA1 a7ed1ee359ebe2842b354b5652a441403e802080 t/01basics.t
 SHA1 2b2dc6f72370f60e1d233f2f8c12bb87414e825c t/01nocap_api.t
@@ -66,7 +66,7 @@
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.9 (Darwin)
 
-iEYEARECAAYFAkoDVlsACgkQvH6dkeDZaS93/QCZAXt9w3MMBFRtG6fI/sYmGM6B
-iBIAn1wsPk14pK1q+yrS4fVQrj6PiXOG
-=rsbS
+iEYEARECAAYFAkpfp7EACgkQvH6dkeDZaS/LZQCfQVojaygS3LlAWfKwOT/CCdYk
+XGUAn3/IDepSeoKjBcWX7XBxSWIxC0Ds
+=EYtQ
 -----END PGP SIGNATURE-----

Modified: branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder.pm?rev=40060&op=diff
==============================================================================
--- branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder.pm (original)
+++ branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder.pm Fri Jul 17 15:16:46 2009
@@ -4,7 +4,7 @@
 use strict;
 use warnings;
 
-our $VERSION = "1.55";
+our $VERSION = "1.56";
 
 use Clone qw();
 use Encode qw();
@@ -430,11 +430,19 @@
       if ( $self->_isLimited > 0 );
 
     # DISTINCT query only required for multi-table selects
-    if ($self->_isJoined) {
+    # when we have group by clause then the result set is distinct as
+    # it must contain only columns we group by or results of aggregate
+    # functions which give one result per group, so we can skip DISTINCTing
+    if ( my $clause = $self->_GroupClause ) {
+        $QueryString = "SELECT main.* FROM $QueryString";
+        $QueryString .= $clause;
+        $QueryString .= $self->_OrderClause;
+    }
+    elsif ($self->_isJoined) {
         $self->_DistinctQuery(\$QueryString);
-    } else {
+    }
+    else {
         $QueryString = "SELECT main.* FROM $QueryString";
-        $QueryString .= $self->_GroupClause;
         $QueryString .= $self->_OrderClause;
     }
 

Modified: branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/Oracle.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/Oracle.pm?rev=40060&op=diff
==============================================================================
--- branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/Oracle.pm (original)
+++ branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/Oracle.pm Fri Jul 17 15:16:46 2009
@@ -246,16 +246,6 @@
     my $statementref = shift;
     my $sb = shift;
 
-    # when we have group by clause then the result set is distinct as
-    # it must contain only columns we group by or results of aggregate
-    # functions which give one result per group, so we can skip DISTINCTing
-    if ( my $group = $sb->_GroupClause ) {
-        $$statementref = "SELECT main.* FROM $$statementref";
-        $$statementref .= $group;
-        $$statementref .= $sb->_OrderClause;
-        return;
-    }
-
     my $table = $sb->Table;
 
     if ($sb->_OrderClause =~ /(?<!main)\./) {

Modified: branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/Pg.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/Pg.pm?rev=40060&op=diff
==============================================================================
--- branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/Pg.pm (original)
+++ branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/Pg.pm Fri Jul 17 15:16:46 2009
@@ -188,8 +188,8 @@
     my $operator = shift;
     my $value    = shift;
 
-
-    if ($value =~ /^['"]?\d+['"]?$/) { # we don't need to downcase numeric values
+    # we don't need to downcase numeric values and dates
+    if ($value =~ /^['"]?[-\d: ]+['"]?$/) {
         	return ( $field, $operator, $value);
     }
 
@@ -228,7 +228,7 @@
     my $table = $sb->Table;
 
     return $self->SUPER::DistinctQuery( $statementref, $sb, @_ )
-        if $sb->_GroupClause || $sb->_OrderClause !~ /(?<!main)\./;
+        if $sb->_OrderClause !~ /(?<!main)\./;
 
     # If we are ordering by something not in 'main', we need to GROUP
     # BY and adjust the ORDER_BY accordingly

Modified: branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/SQLite.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/SQLite.pm?rev=40060&op=diff
==============================================================================
--- branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/SQLite.pm (original)
+++ branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/SQLite.pm Fri Jul 17 15:16:46 2009
@@ -102,7 +102,7 @@
     my $sb = shift;
 
     return $self->SUPER::DistinctQuery( $statementref, $sb, @_ )
-        if $sb->_GroupClause || $sb->_OrderClause !~ /(?<!main)\./;
+        if $sb->_OrderClause !~ /(?<!main)\./;
 
     local $sb->{'group_by'} = [{FIELD => 'id'}];
     local $sb->{'order_by'} = [

Modified: branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/mysql.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/mysql.pm?rev=40060&op=diff
==============================================================================
--- branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/mysql.pm (original)
+++ branches/upstream/libdbix-searchbuilder-perl/current/SearchBuilder/Handle/mysql.pm Fri Jul 17 15:16:46 2009
@@ -82,7 +82,7 @@
     my $sb = shift;
 
     return $self->SUPER::DistinctQuery( $statementref, $sb, @_ )
-        if $sb->_GroupClause || $sb->_OrderClause !~ /(?<!main)\./;
+        if $sb->_OrderClause !~ /(?<!main)\./;
 
     if ( substr($self->DatabaseVersion, 0, 1) == 4 ) {
         local $sb->{'group_by'} = [{FIELD => 'id'}];

Modified: branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/AutoInstall.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/AutoInstall.pm?rev=40060&op=diff
==============================================================================
--- branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/AutoInstall.pm (original)
+++ branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/AutoInstall.pm Fri Jul 17 15:16:46 2009
@@ -18,7 +18,9 @@
 
 # various lexical flags
 my ( @Missing, @Existing,  %DisabledTests, $UnderCPAN,     $HasCPANPLUS );
-my ( $Config,  $CheckOnly, $SkipInstall,   $AcceptDefault, $TestOnly );
+my (
+    $Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly, $AllDeps
+);
 my ( $PostambleActions, $PostambleUsed );
 
 # See if it's a testing or non-interactive session
@@ -72,6 +74,9 @@
         }
         elsif ( $arg =~ /^--test(?:only)?$/ ) {
             $TestOnly = 1;
+        }
+        elsif ( $arg =~ /^--all(?:deps)?$/ ) {
+            $AllDeps = 1;
         }
     }
 }
@@ -115,7 +120,12 @@
         )[0]
     );
 
-    $UnderCPAN = _check_lock(1);    # check for $UnderCPAN
+    # We want to know if we're under CPAN early to avoid prompting, but
+    # if we aren't going to try and install anything anyway then skip the
+    # check entirely since we don't want to have to load (and configure)
+    # an old CPAN just for a cosmetic message
+
+    $UnderCPAN = _check_lock(1) unless $SkipInstall;
 
     while ( my ( $feature, $modules ) = splice( @args, 0, 2 ) ) {
         my ( @required, @tests, @skiptests );
@@ -165,15 +175,24 @@
             }
 
             # XXX: check for conflicts and uninstalls(!) them.
-            if (
-                defined( my $cur = _version_check( _load($mod), $arg ||= 0 ) ) )
+            my $cur = _load($mod);
+            if (_version_cmp ($cur, $arg) >= 0)
             {
                 print "loaded. ($cur" . ( $arg ? " >= $arg" : '' ) . ")\n";
                 push @Existing, $mod => $arg;
                 $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
             }
             else {
-                print "missing." . ( $arg ? " (would need $arg)" : '' ) . "\n";
+                if (not defined $cur)   # indeed missing
+                {
+                    print "missing." . ( $arg ? " (would need $arg)" : '' ) . "\n";
+                }
+                else
+                {
+                    # no need to check $arg as _version_cmp ($cur, undef) would satisfy >= above
+                    print "too old. ($cur < $arg)\n";
+                }
+
                 push @required, $mod => $arg;
             }
         }
@@ -187,6 +206,7 @@
             and (
                 $CheckOnly
                 or ($mandatory and $UnderCPAN)
+                or $AllDeps
                 or _prompt(
                     qq{==> Auto-install the }
                       . ( @required / 2 )
@@ -235,21 +255,38 @@
     *{'main::WriteMakefile'} = \&Write if caller(0) eq 'main';
 }
 
+sub _running_under {
+    my $thing = shift;
+    print <<"END_MESSAGE";
+*** Since we're running under ${thing}, I'll just let it take care
+    of the dependency's installation later.
+END_MESSAGE
+    return 1;
+}
+
 # Check to see if we are currently running under CPAN.pm and/or CPANPLUS;
 # if we are, then we simply let it taking care of our dependencies
 sub _check_lock {
     return unless @Missing or @_;
 
+    my $cpan_env = $ENV{PERL5_CPAN_IS_RUNNING};
+
     if ($ENV{PERL5_CPANPLUS_IS_RUNNING}) {
-        print <<'END_MESSAGE';
-
-*** Since we're running under CPANPLUS, I'll just let it take care
-    of the dependency's installation later.
-END_MESSAGE
-        return 1;
-    }
-
-    _load_cpan();
+        return _running_under($cpan_env ? 'CPAN' : 'CPANPLUS');
+    }
+
+    require CPAN;
+
+    if ($CPAN::VERSION > '1.89') {
+        if ($cpan_env) {
+            return _running_under('CPAN');
+        }
+        return; # CPAN.pm new enough, don't need to check further
+    }
+
+    # last ditch attempt, this -will- configure CPAN, very sorry
+
+    _load_cpan(1); # force initialize even though it's already loaded
 
     # Find the CPAN lock-file
     my $lock = MM->catfile( $CPAN::Config->{cpan_home}, ".lock" );
@@ -285,7 +322,7 @@
     while ( my ( $pkg, $ver ) = splice( @_, 0, 2 ) ) {
 
         # grep out those already installed
-        if ( defined( _version_check( _load($pkg), $ver ) ) ) {
+        if ( _version_cmp( _load($pkg), $ver ) >= 0 ) {
             push @installed, $pkg;
         }
         else {
@@ -324,7 +361,7 @@
 
     # see if we have successfully installed them
     while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
-        if ( defined( _version_check( _load($pkg), $ver ) ) ) {
+        if ( _version_cmp( _load($pkg), $ver ) >= 0 ) {
             push @installed, $pkg;
         }
         elsif ( $args{do_once} and open( FAILED, '>> .#autoinstall.failed' ) ) {
@@ -379,7 +416,7 @@
         my $success;
         my $obj = $modtree->{$pkg};
 
-        if ( $obj and defined( _version_check( $obj->{version}, $ver ) ) ) {
+        if ( $obj and _version_cmp( $obj->{version}, $ver ) >= 0 ) {
             my $pathname = $pkg;
             $pathname =~ s/::/\\W/;
 
@@ -472,7 +509,7 @@
         my $obj     = CPAN::Shell->expand( Module => $pkg );
         my $success = 0;
 
-        if ( $obj and defined( _version_check( $obj->cpan_version, $ver ) ) ) {
+        if ( $obj and _version_cmp( $obj->cpan_version, $ver ) >= 0 ) {
             my $pathname = $pkg;
             $pathname =~ s/::/\\W/;
 
@@ -536,7 +573,7 @@
     my $ver   = shift;
 
     return
-      if defined( _version_check( _load($class), $ver ) );  # no need to upgrade
+      if _version_cmp( _load($class), $ver ) >= 0;  # no need to upgrade
 
     if (
         _prompt( "==> A newer version of $class ($ver) is required. Install?",
@@ -633,7 +670,7 @@
 
 # Load CPAN.pm and it's configuration
 sub _load_cpan {
-    return if $CPAN::VERSION;
+    return if $CPAN::VERSION and $CPAN::Config and not @_;
     require CPAN;
     if ( $CPAN::HandleConfig::VERSION ) {
         # Newer versions of CPAN have a HandleConfig module
@@ -645,9 +682,11 @@
 }
 
 # compare two versions, either use Sort::Versions or plain comparison
-sub _version_check {
+# return values same as <=>
+sub _version_cmp {
     my ( $cur, $min ) = @_;
-    return unless defined $cur;
+    return -1 unless defined $cur;  # if 0 keep comparing
+    return 1 unless $min;
 
     $cur =~ s/\s+$//;
 
@@ -658,16 +697,13 @@
             ) {
 
             # use version.pm if it is installed.
-            return (
-                ( version->new($cur) >= version->new($min) ) ? $cur : undef );
+            return version->new($cur) <=> version->new($min);
         }
         elsif ( $Sort::Versions::VERSION or defined( _load('Sort::Versions') ) )
         {
 
             # use Sort::Versions as the sorting algorithm for a.b.c versions
-            return ( ( Sort::Versions::versioncmp( $cur, $min ) != -1 )
-                ? $cur
-                : undef );
+            return Sort::Versions::versioncmp( $cur, $min );
         }
 
         warn "Cannot reliably compare non-decimal formatted versions.\n"
@@ -676,7 +712,7 @@
 
     # plain comparison
     local $^W = 0;    # shuts off 'not numeric' bugs
-    return ( $cur >= $min ? $cur : undef );
+    return $cur <=> $min;
 }
 
 # nothing; this usage is deprecated.
@@ -766,4 +802,4 @@
 
 __END__
 
-#line 1004
+#line 1056

Modified: branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install.pm?rev=40060&op=diff
==============================================================================
--- branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install.pm (original)
+++ branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install.pm Fri Jul 17 15:16:46 2009
@@ -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.85';
+	$VERSION = '0.91';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -353,7 +353,7 @@
 	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]): $!";
@@ -384,7 +384,7 @@
 	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]): $!";

Modified: branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/AutoInstall.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/AutoInstall.pm?rev=40060&op=diff
==============================================================================
--- branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/AutoInstall.pm (original)
+++ branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/AutoInstall.pm Fri Jul 17 15:16:46 2009
@@ -2,13 +2,13 @@
 package Module::Install::AutoInstall;
 
 use strict;
-use Module::Install::Base;
+use Module::Install::Base ();
 
-use vars qw{$VERSION $ISCORE @ISA};
+use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.85';
+	$VERSION = '0.91';
+	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
-	@ISA     = qw{Module::Install::Base};
 }
 
 sub AutoInstall { $_[0] }

Modified: branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Base.pm?rev=40060&op=diff
==============================================================================
--- branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Base.pm (original)
+++ branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Base.pm Fri Jul 17 15:16:46 2009
@@ -4,7 +4,7 @@
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '0.85';
+	$VERSION = '0.91';
 }
 
 # Suspend handler for "redefined" warnings
@@ -13,42 +13,34 @@
 	$SIG{__WARN__} = sub { $w };
 }
 
-### This is the ONLY module that shouldn't have strict on
-# use strict;
-
-#line 45
+#line 42
 
 sub new {
-	my ($class, %args) = @_;
-
-	foreach my $method ( qw(call load) ) {
-		next if defined &{"$class\::$method"};
-		*{"$class\::$method"} = sub {
-			shift()->_top->$method(@_);
-		};
+	my $class = shift;
+	unless ( defined &{"${class}::call"} ) {
+		*{"${class}::call"} = sub { shift->_top->call(@_) };
 	}
-
-	bless( \%args, $class );
+	unless ( defined &{"${class}::load"} ) {
+		*{"${class}::load"} = sub { shift->_top->load(@_) };
+	}
+	bless { @_ }, $class;
 }
 
-#line 66
+#line 61
 
 sub AUTOLOAD {
-	my $self = shift;
 	local $@;
-	my $autoload = eval {
-		$self->_top->autoload
-	} or return;
-	goto &$autoload;
+	my $func = eval { shift->_top->autoload } or return;
+	goto &$func;
 }
 
-#line 83
+#line 75
 
 sub _top {
 	$_[0]->{_top};
 }
 
-#line 98
+#line 90
 
 sub admin {
 	$_[0]->_top->{admin}
@@ -56,7 +48,7 @@
 	Module::Install::Base::FakeAdmin->new;
 }
 
-#line 114
+#line 106
 
 sub is_admin {
 	$_[0]->admin->VERSION;
@@ -83,4 +75,4 @@
 
 1;
 
-#line 162
+#line 154

Modified: branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Include.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Include.pm?rev=40060&op=diff
==============================================================================
--- branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Include.pm (original)
+++ branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Include.pm Fri Jul 17 15:16:46 2009
@@ -2,13 +2,13 @@
 package Module::Install::Include;
 
 use strict;
-use Module::Install::Base;
+use Module::Install::Base ();
 
-use vars qw{$VERSION $ISCORE @ISA};
+use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.85';
+	$VERSION = '0.91';
+	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
-	@ISA     = qw{Module::Install::Base};
 }
 
 sub include {

Modified: branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Makefile.pm?rev=40060&op=diff
==============================================================================
--- branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Makefile.pm (original)
+++ branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Makefile.pm Fri Jul 17 15:16:46 2009
@@ -2,14 +2,14 @@
 package Module::Install::Makefile;
 
 use strict 'vars';
-use Module::Install::Base;
-use ExtUtils::MakeMaker ();
-
-use vars qw{$VERSION $ISCORE @ISA};
+use ExtUtils::MakeMaker   ();
+use Module::Install::Base ();
+
+use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.85';
+	$VERSION = '0.91';
+	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
-	@ISA     = qw{Module::Install::Base};
 }
 
 sub Makefile { $_[0] }

Modified: branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Metadata.pm?rev=40060&op=diff
==============================================================================
--- branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Metadata.pm (original)
+++ branches/upstream/libdbix-searchbuilder-perl/current/inc/Module/Install/Metadata.pm Fri Jul 17 15:16:46 2009
@@ -2,18 +2,17 @@
 package Module::Install::Metadata;
 
 use strict 'vars';
-use Module::Install::Base;
+use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.85';
-	@ISA     = qw{Module::Install::Base};
+	$VERSION = '0.91';
+	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
 
 my @boolean_keys = qw{
 	sign
-	mymeta
 };
 
 my @scalar_keys = qw{
@@ -440,21 +439,21 @@
 	/ixms ) {
 		my $license_text = $1;
 		my @phrases      = (
-			'under the same (?:terms|license) as perl itself' => 'perl',        1,
-			'GNU general public license'                      => 'gpl',         1,
-			'GNU public license'                              => 'gpl',         1,
-			'GNU lesser general public license'               => 'lgpl',        1,
-			'GNU lesser public license'                       => 'lgpl',        1,
-			'GNU library general public license'              => 'lgpl',        1,
-			'GNU library public license'                      => 'lgpl',        1,
-			'BSD license'                                     => 'bsd',         1,
-			'Artistic license'                                => 'artistic',    1,
-			'GPL'                                             => 'gpl',         1,
-			'LGPL'                                            => 'lgpl',        1,
-			'BSD'                                             => 'bsd',         1,
-			'Artistic'                                        => 'artistic',    1,
-			'MIT'                                             => 'mit',         1,
-			'proprietary'                                     => 'proprietary', 0,
+			'under the same (?:terms|license) as (?: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,
+			'GNU lesser public license'          => 'lgpl',        1,
+			'GNU library general public license' => 'lgpl',        1,
+			'GNU library public license'         => 'lgpl',        1,
+			'BSD license'                        => 'bsd',         1,
+			'Artistic license'                   => 'artistic',    1,
+			'GPL'                                => 'gpl',         1,
+			'LGPL'                               => 'lgpl',        1,
+			'BSD'                                => 'bsd',         1,
+			'Artistic'                           => 'artistic',    1,
+			'MIT'                                => 'mit',         1,
+			'proprietary'                        => 'proprietary', 0,
 		);
 		while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
 			$pattern =~ s{\s+}{\\s+}g;
@@ -506,17 +505,29 @@
 	}
 }
 
+sub test_requires_from {
+	my $self     = shift;
+	my $content  = Module::Install::_readperl($_[0]);
+	my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
+	while ( @requires ) {
+		my $module  = shift @requires;
+		my $version = shift @requires;
+		$self->test_requires( $module => $version );
+	}
+}
+
 # Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
 # numbers (eg, 5.006001 or 5.008009).
 # Also, convert double-part versions (eg, 5.8)
 sub _perl_version {
 	my $v = $_[-1];
-	$v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;	
+	$v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;
 	$v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e;
 	$v =~ s/(\.\d\d\d)000$/$1/;
 	$v =~ s/_.+$//;
 	if ( ref($v) ) {
-		$v = $v + 0; # Numify
+		# Numify
+		$v = $v + 0;
 	}
 	return $v;
 }
@@ -526,21 +537,56 @@
 
 
 ######################################################################
-# MYMETA.yml Support
+# MYMETA Support
 
 sub WriteMyMeta {
 	die "WriteMyMeta has been deprecated";
 }
 
-sub write_mymeta {
-	my $self = shift;
-	
-	# If there's no existing META.yml there is nothing we can do
-	return unless -f 'META.yml';
+sub write_mymeta_yaml {
+	my $self = shift;
 
 	# We need YAML::Tiny to write the MYMETA.yml file
 	unless ( eval { require YAML::Tiny; 1; } ) {
 		return 1;
+	}
+
+	# Generate the data
+	my $meta = $self->_write_mymeta_data or return 1;
+
+	# Save as the MYMETA.yml file
+	print "Writing MYMETA.yml\n";
+	YAML::Tiny::DumpFile('MYMETA.yml', $meta);
+}
+
+sub write_mymeta_json {
+	my $self = shift;
+
+	# We need JSON to write the MYMETA.json file
+	unless ( eval { require JSON; 1; } ) {
+		return 1;
+	}
+
+	# Generate the data
+	my $meta = $self->_write_mymeta_data or return 1;
+
+	# Save as the MYMETA.yml file
+	print "Writing MYMETA.json\n";
+	Module::Install::_write(
+		'MYMETA.json',
+		JSON->new->pretty(1)->canonical->encode($meta),
+	);
+}
+
+sub _write_mymeta_data {
+	my $self = shift;
+
+	# If there's no existing META.yml there is nothing we can do
+	return undef unless -f 'META.yml';
+
+	# We need Parse::CPAN::Meta to load the file
+	unless ( eval { require Parse::CPAN::Meta; 1; } ) {
+		return undef;
 	}
 
 	# Merge the perl version into the dependencies
@@ -558,7 +604,7 @@
 	}
 
 	# Load the advisory META.yml file
-	my @yaml = YAML::Tiny::LoadFile('META.yml');
+	my @yaml = Parse::CPAN::Meta::LoadFile('META.yml');
 	my $meta = $yaml[0];
 
 	# Overwrite the non-configure dependency hashs
@@ -572,9 +618,7 @@
 		$meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } };
 	}
 
-	# Save as the MYMETA.yml file
-	print "Writing MYMETA.yml\n";
-	YAML::Tiny::DumpFile('MYMETA.yml', $meta);	
+	return $meta;
 }
 
 1;




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