r30843 - in /trunk/liborlite-perl: ./ debian/ inc/Module/ inc/Module/Install/ lib/ t/ t/lib/

bricas-guest at users.alioth.debian.org bricas-guest at users.alioth.debian.org
Wed Feb 18 13:59:47 UTC 2009


Author: bricas-guest
Date: Wed Feb 18 13:59:44 2009
New Revision: 30843

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=30843
Log:
New upstream release

Modified:
    trunk/liborlite-perl/Changes
    trunk/liborlite-perl/META.yml
    trunk/liborlite-perl/Makefile.PL
    trunk/liborlite-perl/README
    trunk/liborlite-perl/debian/changelog
    trunk/liborlite-perl/inc/Module/Install.pm
    trunk/liborlite-perl/inc/Module/Install/Base.pm
    trunk/liborlite-perl/inc/Module/Install/Can.pm
    trunk/liborlite-perl/inc/Module/Install/Fetch.pm
    trunk/liborlite-perl/inc/Module/Install/Makefile.pm
    trunk/liborlite-perl/inc/Module/Install/Metadata.pm
    trunk/liborlite-perl/inc/Module/Install/Win32.pm
    trunk/liborlite-perl/inc/Module/Install/With.pm
    trunk/liborlite-perl/inc/Module/Install/WriteAll.pm
    trunk/liborlite-perl/lib/ORLite.pm
    trunk/liborlite-perl/t/02_basics.t
    trunk/liborlite-perl/t/lib/Test.pm

Modified: trunk/liborlite-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/Changes?rev=30843&op=diff
==============================================================================
--- trunk/liborlite-perl/Changes (original)
+++ trunk/liborlite-perl/Changes Wed Feb 18 13:59:44 2009
@@ -1,4 +1,9 @@
 Changes for Perl extension ORLite
+
+1.20 Thu 12 Feb 2009
+	- Auto-create parent directory for ORLite files
+	- Add root method ->sqlite which returns the path to the
+	  sqlite file for that database.
 
 1.19 Tue  3 Feb 2009
 	- Adding support for using a CODE reference in the 'create'

Modified: trunk/liborlite-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/META.yml?rev=30843&op=diff
==============================================================================
--- trunk/liborlite-perl/META.yml (original)
+++ trunk/liborlite-perl/META.yml Wed Feb 18 13:59:44 2009
@@ -5,7 +5,7 @@
 build_requires:
   Test::More: 0.47
 distribution_type: module
-generated_by: 'Module::Install version 0.78'
+generated_by: 'Module::Install version 0.79'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -19,10 +19,13 @@
 requires:
   DBD::SQLite: 1.14
   DBI: 1.58
+  File::Basename: 0
+  File::Path: 2.04
   File::Spec: 0.80
   File::Temp: 0.20
   Params::Util: 0.33
   perl: 5.6.0
 resources:
   license: http://dev.perl.org/licenses/
-version: 1.19
+  repository: http://svn.ali.as/cpan/trunk/ORLite
+version: 1.20

Modified: trunk/liborlite-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/Makefile.PL?rev=30843&op=diff
==============================================================================
--- trunk/liborlite-perl/Makefile.PL (original)
+++ trunk/liborlite-perl/Makefile.PL Wed Feb 18 13:59:44 2009
@@ -1,11 +1,14 @@
-use inc::Module::Install 0.78;
+use inc::Module::Install 0.79;
 
 all_from      'lib/ORLite.pm';
-requires      'File::Spec'   => winlike() ? '3.2701' : '0.80';
-requires      'File::Temp'   => '0.20';
-requires      'Params::Util' => '0.33';
-requires      'DBI'          => '1.58';
-requires      'DBD::SQLite'  => '1.14';
-test_requires 'Test::More'   => '0.47';
+requires      'File::Spec'     => winlike() ? '3.2701' : '0.80';
+requires      'File::Temp'     => '0.20';
+requires      'File::Path'     => '2.04';
+requires      'File::Basename' => 0;
+requires      'Params::Util'   => '0.33';
+requires      'DBI'            => '1.58';
+requires      'DBD::SQLite'    => '1.14';
+test_requires 'Test::More'     => '0.47';
+repository    'http://svn.ali.as/cpan/trunk/ORLite';
 
 WriteAll;

Modified: trunk/liborlite-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/README?rev=30843&op=diff
==============================================================================
--- trunk/liborlite-perl/README (original)
+++ trunk/liborlite-perl/README Wed Feb 18 13:59:44 2009
@@ -3,10 +3,10 @@
 
 SYNOPSIS
       package Foo;
-  
+
       use strict;
       use ORLite 'data/sqlite.db';
-  
+
       my @awesome = Foo::Person->select(
          'where first_name = ?',
          'Adam',

Modified: trunk/liborlite-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/debian/changelog?rev=30843&op=diff
==============================================================================
--- trunk/liborlite-perl/debian/changelog (original)
+++ trunk/liborlite-perl/debian/changelog Wed Feb 18 13:59:44 2009
@@ -1,3 +1,9 @@
+liborlite-perl (1.20-1) UNRELEASED; urgency=low
+
+  * New upstream release
+
+ -- Brian Cassidy <brian.cassidy at gmail.com>  Wed, 18 Feb 2009 09:59:10 -0400
+
 liborlite-perl (1.19-1) unstable; urgency=low
 
   * New upstream release

Modified: trunk/liborlite-perl/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/inc/Module/Install.pm?rev=30843&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install.pm Wed Feb 18 13:59:44 2009
@@ -30,7 +30,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.78';
+	$VERSION = '0.79';
 
 	*inc::Module::Install::VERSION = *VERSION;
 	@inc::Module::Install::ISA     = __PACKAGE__;

Modified: trunk/liborlite-perl/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/inc/Module/Install/Base.pm?rev=30843&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install/Base.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install/Base.pm Wed Feb 18 13:59:44 2009
@@ -1,7 +1,7 @@
 #line 1
 package Module::Install::Base;
 
-$VERSION = '0.78';
+$VERSION = '0.79';
 
 # Suspend handler for "redefined" warnings
 BEGIN {

Modified: trunk/liborlite-perl/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/inc/Module/Install/Can.pm?rev=30843&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install/Can.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install/Can.pm Wed Feb 18 13:59:44 2009
@@ -11,7 +11,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.78';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: trunk/liborlite-perl/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/inc/Module/Install/Fetch.pm?rev=30843&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install/Fetch.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install/Fetch.pm Wed Feb 18 13:59:44 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.78';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: trunk/liborlite-perl/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/inc/Module/Install/Makefile.pm?rev=30843&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install/Makefile.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install/Makefile.pm Wed Feb 18 13:59:44 2009
@@ -7,7 +7,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.78';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: trunk/liborlite-perl/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/inc/Module/Install/Metadata.pm?rev=30843&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install/Metadata.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install/Metadata.pm Wed Feb 18 13:59:44 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.78';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
@@ -176,19 +176,15 @@
 		"Did not provide a value to perl_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)
-
-	$version =~ s/^(\d+)\.(\d+)(?:\.(\d+))?$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e;
-
-	$version =~ s/_.+$//;
-	$version = $version + 0; # Numify
+	# Normalize the version
+	$version = $self->_perl_version($version);
+
+	# We don't support the reall old versions
 	unless ( $version >= 5.005 ) {
 		die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
 	}
+
 	$self->{values}{perl_version} = $version;
-	return 1;
 }
 
 sub license {
@@ -480,4 +476,70 @@
 	return 1;
 }
 
+# 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?)\.(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
+	}
+	return $v;
+}
+
+
+
+
+
+######################################################################
+# MYMETA.yml Support
+
+sub WriteMyMeta {
+	$_[0]->write_mymeta;
+}
+
+sub write_mymeta {
+	my $self = shift;
+	
+	# If there's no existing META.yml there is nothing we can do
+	return unless -f 'META.yml';
+
+	# Merge the perl version into the dependencies
+	my $val  = $self->Meta->{values};
+	my $perl = delete $val->{perl_version};
+	if ( $perl ) {
+		$val->{requires} ||= [];
+		my $requires = $val->{requires};
+
+		# Canonize to three-dot version after Perl 5.6
+		if ( $perl >= 5.006 ) {
+			$perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e
+		}
+		unshift @$requires, [ perl => $perl ];
+	}
+
+	# Load the advisory META.yml file
+	require YAML::Tiny;
+	my @yaml = YAML::Tiny::LoadFile('META.yml');
+	my $meta = $yaml[0];
+
+	# Overwrite the non-configure dependency hashs
+	delete $meta->{requires};
+	delete $meta->{build_requires};
+	delete $meta->{recommends};
+	if ( exists $val->{requires} ) {
+		$meta->{requires} = { map { @$_ } @{ $val->{requires} } };
+	}
+	if ( exists $val->{build_requires} ) {
+		$meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } };
+	}
+
+	# Save as the MYMETA.yml file
+	YAML::Tiny::DumpFile('MYMETA.yml', $meta);
+}
+
 1;

Modified: trunk/liborlite-perl/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/inc/Module/Install/Win32.pm?rev=30843&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install/Win32.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install/Win32.pm Wed Feb 18 13:59:44 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.78';
+	$VERSION = '0.79';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

Modified: trunk/liborlite-perl/inc/Module/Install/With.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/inc/Module/Install/With.pm?rev=30843&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install/With.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install/With.pm Wed Feb 18 13:59:44 2009
@@ -8,7 +8,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.78';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: trunk/liborlite-perl/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/inc/Module/Install/WriteAll.pm?rev=30843&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install/WriteAll.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install/WriteAll.pm Wed Feb 18 13:59:44 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.78';
+	$VERSION = '0.79';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

Modified: trunk/liborlite-perl/lib/ORLite.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/lib/ORLite.pm?rev=30843&op=diff
==============================================================================
--- trunk/liborlite-perl/lib/ORLite.pm (original)
+++ trunk/liborlite-perl/lib/ORLite.pm Wed Feb 18 13:59:44 2009
@@ -4,15 +4,17 @@
 
 use 5.006;
 use strict;
-use Carp         ();
-use File::Spec   ();
-use File::Temp   ();
-use Params::Util qw{ _STRING _CLASS _HASHLIKE _CODELIKE };
-use DBI          ();
+use Carp           ();
+use File::Spec     ();
+use File::Temp     ();
+use File::Path     ();
+use File::Basename ();
+use Params::Util   qw{ _STRING _CLASS _HASHLIKE _CODELIKE };
+use DBI            ();
 
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.19';
+	$VERSION = '1.20';
 
 	# DBD::SQLite has a bug that generates a spurious warning
 	# at compile time, so we need to temporarily disable them.
@@ -82,6 +84,13 @@
 	# Connect to the database
 	my $file     = File::Spec->rel2abs($params{file});
 	my $created  = ! -f $params{file};
+	if ( $created ) {
+		# Create the parent directory
+		my $dir = File::Basename::dirname($file);
+		unless ( -d $dir ) {
+			File::Path::mkpath( $dir, { verbose => 0 } );
+		}
+	}
 	my $pkg      = $params{package};
 	my $readonly = $params{readonly};
 	my $dsn      = "dbi:SQLite:$file";
@@ -107,6 +116,8 @@
 my \$DBH = undef;
 
 sub orlite { '$VERSION' }
+
+sub sqlite { '$file' }
 
 sub dsn { '$dsn' }
 
@@ -249,9 +260,9 @@
 		# Generate the per-table code
 		foreach my $table ( @$tables ) {
 			# Generate the accessors
-			my $sql       = $table->{sql};
-			my @columns   = @{ $table->{columns} };
-			my @names     = map { $_->{name} } @columns;
+			my $sql     = $table->{sql};
+			my @columns = @{ $table->{columns} };
+			my @names   = map { $_->{name} } @columns;
 
 			# Generate the elements in all packages
 			$code .= <<"END_PERL";
@@ -379,10 +390,10 @@
 =head1 SYNOPSIS
 
   package Foo;
-  
+
   use strict;
   use ORLite 'data/sqlite.db';
-  
+
   my @awesome = Foo::Person->select(
      'where first_name = ?',
      'Adam',

Modified: trunk/liborlite-perl/t/02_basics.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/t/02_basics.t?rev=30843&op=diff
==============================================================================
--- trunk/liborlite-perl/t/02_basics.t (original)
+++ trunk/liborlite-perl/t/02_basics.t Wed Feb 18 13:59:44 2009
@@ -9,7 +9,7 @@
 	$^W = 1;
 }
 
-use Test::More tests => 49;
+use Test::More tests => 51;
 use File::Spec::Functions ':ALL';
 use t::lib::Test;
 
@@ -43,6 +43,11 @@
 
 Foo::Bar->begin;
 Foo::Bar->rollback;
+
+# Check the file name
+$file = rel2abs($file);
+is( Foo::Bar->sqlite, $file,              '->sqlite ok' );
+is( Foo::Bar->dsn,    "dbi:SQLite:$file", '->dsn ok'    );
 
 # Check the schema version
 is( Foo::Bar->pragma('user_version'), 0, '->user_version ok' );

Modified: trunk/liborlite-perl/t/lib/Test.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/t/lib/Test.pm?rev=30843&op=diff
==============================================================================
--- trunk/liborlite-perl/t/lib/Test.pm (original)
+++ trunk/liborlite-perl/t/lib/Test.pm Wed Feb 18 13:59:44 2009
@@ -8,7 +8,7 @@
 
 use vars qw{$VERSION @ISA @EXPORT};
 BEGIN {
-        $VERSION = '1.19';
+        $VERSION = '1.20';
 	@ISA     = qw{ Exporter };
 	@EXPORT  = qw{ test_db connect_ok create_ok };
 }




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