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

franck at users.alioth.debian.org franck at users.alioth.debian.org
Mon Jul 26 13:47:16 UTC 2010


Author: franck
Date: Mon Jul 26 13:47:07 2010
New Revision: 60605

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=60605
Log:
Merging new upstream release into trunk.

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/DSL.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/08_prune.pl
    trunk/liborlite-perl/t/lib/Test.pm
    trunk/liborlite-perl/xt/meta.t
    trunk/liborlite-perl/xt/pmv.t
    trunk/liborlite-perl/xt/pod.t

Modified: trunk/liborlite-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/Changes?rev=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/Changes (original)
+++ trunk/liborlite-perl/Changes Mon Jul 26 13:47:07 2010
@@ -1,4 +1,9 @@
 Changes for Perl extension ORLite
+
+1.44 Fri 23 Jul 2010
+	- Upgrading to Module::Install::DSL 1.00 (ADAMK)
+	- Adding the per-table table_info method to get the columns (ADAMK)
+	- Adding tests for the per-table metadata methods (ADAMK)
 
 1.43 Mon 10 May 2010
 	- Ensure 100% of tables and columns are quoted correctly (ADAMK)

Modified: trunk/liborlite-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/META.yml?rev=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/META.yml (original)
+++ trunk/liborlite-perl/META.yml Mon Jul 26 13:47:07 2010
@@ -9,7 +9,7 @@
 configure_requires:
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
-generated_by: 'Module::Install version 0.97'
+generated_by: 'Module::Install version 1.00'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -35,4 +35,4 @@
   ChangeLog: http://fisheye2.atlassian.com/changelog/cpan/trunk/ORLite
   license: http://dev.perl.org/licenses/
   repository: http://svn.ali.as/cpan/trunk/ORLite
-version: 1.43
+version: 1.44

Modified: trunk/liborlite-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/Makefile.PL?rev=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/Makefile.PL (original)
+++ trunk/liborlite-perl/Makefile.PL Mon Jul 26 13:47:07 2010
@@ -1,4 +1,4 @@
-use inc::Module::Install::DSL 0.96;
+use inc::Module::Install::DSL 1.00;
 
 all_from      lib/ORLite.pm
 requires_from lib/ORLite.pm

Modified: trunk/liborlite-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/README?rev=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/README (original)
+++ trunk/liborlite-perl/README Mon Jul 26 13:47:07 2010
@@ -547,6 +547,26 @@
     from time to time you may need it programatically. If you do need it,
     you can use the "table" method to get the table name.
 
+  table_info
+      # List the columns in the underlying table
+      my $columns = Foo::Bar::User->table_info;
+      foreach my $c ( @$columns ) {
+         print "Column $c->{name} $c->{type}";
+         print " not null" if $c->{notnull};
+         print " default $c->{dflt_value}" if defined $c->{dflt_value};
+         print " primary key" if $c->{pk};
+         print "\n";
+      }
+
+    The "table_info" method is a wrapper around the SQLite "table_info"
+    pragma, and provides simplified access to the column metadata for the
+    underlying table should you need it for some advanced function that
+    needs direct access to the column list.
+
+    Returns a reference to an "ARRAY" containing a list of columns, where
+    each column is a reference to a "HASH" with the keys "cid",
+    "dflt_value", "name", "notnull", "pk" and "type".
+
   new
       my $user = Foo::Bar::User->new(
           name => 'Your Name',

Modified: trunk/liborlite-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/debian/changelog?rev=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/debian/changelog (original)
+++ trunk/liborlite-perl/debian/changelog Mon Jul 26 13:47:07 2010
@@ -1,3 +1,9 @@
+liborlite-perl (1.44-1) UNRELEASED; urgency=low
+
+  * New upstream release
+
+ -- Franck Joncourt <franck at debian.org>  Mon, 26 Jul 2010 15:46:36 +0200
+
 liborlite-perl (1.43-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=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install.pm Mon Jul 26 13:47:07 2010
@@ -22,7 +22,6 @@
 use Cwd        ();
 use File::Find ();
 use File::Path ();
-use FindBin;
 
 use vars qw{$VERSION $MAIN};
 BEGIN {
@@ -32,7 +31,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.97';
+	$VERSION = '1.00';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -231,7 +230,12 @@
 sub new {
 	my ($class, %args) = @_;
 
-	FindBin->again;
+	delete $INC{'FindBin.pm'};
+	{
+		# to suppress the redefine warning
+		local $SIG{__WARN__} = sub {};
+		require FindBin;
+	}
 
 	# ignore the prefix on extension modules built from top level.
 	my $base_path = Cwd::abs_path($FindBin::Bin);

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=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install/Base.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install/Base.pm Mon Jul 26 13:47:07 2010
@@ -4,7 +4,7 @@
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '1.00';
 }
 
 # Suspend handler for "redefined" warnings

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=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install/Can.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install/Can.pm Mon Jul 26 13:47:07 2010
@@ -9,7 +9,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '1.00';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: trunk/liborlite-perl/inc/Module/Install/DSL.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/inc/Module/Install/DSL.pm?rev=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install/DSL.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install/DSL.pm Mon Jul 26 13:47:07 2010
@@ -4,7 +4,7 @@
 use strict;
 use vars qw{$VERSION $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '1.00';
 	$ISCORE  = 1;
 	*inc::Module::Install::DSL::VERSION = *VERSION;
 	@inc::Module::Install::DSL::ISA     = __PACKAGE__;

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=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install/Fetch.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install/Fetch.pm Mon Jul 26 13:47:07 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '1.00';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

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=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install/Makefile.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install/Makefile.pm Mon Jul 26 13:47:07 2010
@@ -4,10 +4,11 @@
 use strict 'vars';
 use ExtUtils::MakeMaker   ();
 use Module::Install::Base ();
+use Fcntl qw/:flock :seek/;
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '1.00';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -364,9 +365,9 @@
 		. ($self->postamble || '');
 
 	local *MAKEFILE;
-	open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	eval { flock MAKEFILE, LOCK_EX };
 	my $makefile = do { local $/; <MAKEFILE> };
-	close MAKEFILE or die $!;
 
 	$makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
 	$makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
@@ -386,7 +387,8 @@
 	# XXX - This is currently unused; not sure if it breaks other MM-users
 	# $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
 
-	open  MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	seek MAKEFILE, 0, SEEK_SET;
+	truncate MAKEFILE, 0;
 	print MAKEFILE  "$preamble$makefile$postamble" or die $!;
 	close MAKEFILE  or die $!;
 
@@ -410,4 +412,4 @@
 
 __END__
 
-#line 539
+#line 541

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=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install/Metadata.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install/Metadata.pm Mon Jul 26 13:47:07 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '1.00';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -616,8 +616,15 @@
 	return $v;
 }
 
-
-
+sub add_metadata {
+    my $self = shift;
+    my %hash = @_;
+    for my $key (keys %hash) {
+        warn "add_metadata: $key is not prefixed with 'x_'.\n" .
+             "Use appopriate function to add non-private metadata.\n" unless $key =~ /^x_/;
+        $self->{values}->{$key} = $hash{$key};
+    }
+}
 
 
 ######################################################################

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=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install/Win32.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install/Win32.pm Mon Jul 26 13:47:07 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '1.00';
 	@ISA     = '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=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install/With.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install/With.pm Mon Jul 26 13:47:07 2010
@@ -8,7 +8,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '1.00';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

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=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/inc/Module/Install/WriteAll.pm (original)
+++ trunk/liborlite-perl/inc/Module/Install/WriteAll.pm Mon Jul 26 13:47:07 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';;
+	$VERSION = '1.00';
 	@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=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/lib/ORLite.pm (original)
+++ trunk/liborlite-perl/lib/ORLite.pm Mon Jul 26 13:47:07 2010
@@ -14,7 +14,7 @@
 
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.43';
+	$VERSION = '1.44';
 }
 
 # Support for the 'prune' option
@@ -391,6 +391,13 @@
 
 sub table { '$table->{name}' }
 
+sub table_info {
+	$pkg->selectall_arrayref(
+		"pragma table_info('$table->{name}')",
+		{ Slice => {} },
+	);
+}
+
 sub select {
 	my \$class = shift;
 	my \$sql   = '$table->{sql_select} ';
@@ -1204,6 +1211,27 @@
 from time to time you may need it programatically. If you do need it,
 you can use the C<table> method to get the table name.
 
+=head2 table_info
+
+  # List the columns in the underlying table
+  my $columns = Foo::Bar::User->table_info;
+  foreach my $c ( @$columns ) {
+     print "Column $c->{name} $c->{type}";
+     print " not null" if $c->{notnull};
+     print " default $c->{dflt_value}" if defined $c->{dflt_value};
+     print " primary key" if $c->{pk};
+     print "\n";
+  }
+
+The C<table_info> method is a wrapper around the SQLite C<table_info>
+pragma, and provides simplified access to the column metadata for the
+underlying table should you need it for some advanced function that
+needs direct access to the column list.
+
+Returns a reference to an C<ARRAY> containing a list of columns, where
+each column is a reference to a C<HASH> with the keys C<cid>, C<dflt_value>,
+C<name>, C<notnull>, C<pk> and C<type>.
+
 =head2 new
 
   my $user = Foo::Bar::User->new(

Modified: trunk/liborlite-perl/t/02_basics.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/t/02_basics.t?rev=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/t/02_basics.t (original)
+++ trunk/liborlite-perl/t/02_basics.t Mon Jul 26 13:47:07 2010
@@ -9,7 +9,7 @@
 	$^W = 1;
 }
 
-use Test::More tests => 71;
+use Test::More tests => 74;
 use File::Spec::Functions ':ALL';
 use t::lib::Test;
 
@@ -41,6 +41,7 @@
 1;
 END_PERL
 
+# Simple null transaction to stimulate any errors
 Foo::Bar->begin;
 Foo::Bar->rollback;
 
@@ -51,6 +52,29 @@
 
 # Check the schema version
 is( Foo::Bar->pragma('user_version'), 0, '->user_version ok' );
+
+# Check metadata methods in the test table
+is( Foo::Bar::TableOne->base, 'Foo::Bar', '->base ok' );
+is( Foo::Bar::TableOne->table, 'table_one', '->table ok' );
+my $columns = Foo::Bar::TableOne->table_info;
+is_deeply( $columns, [
+	{
+		cid        => 0,
+		dflt_value => undef,
+		name       => 'col1',
+		notnull    => 1,
+		pk         => 1,
+		type       => 'integer',
+	},
+	{
+		cid        => 1,
+		dflt_value => undef,
+		name       => 'col2',
+		notnull    => 0,
+		pk         => 0,
+		type       => 'string',
+	},
+], '->table_info ok' );
 
 # Populate the test table
 ok(

Modified: trunk/liborlite-perl/t/08_prune.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/t/08_prune.pl?rev=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/t/08_prune.pl (original)
+++ trunk/liborlite-perl/t/08_prune.pl Mon Jul 26 13:47:07 2010
@@ -4,7 +4,7 @@
 
 use strict;
 
-our $VERSION = '1.43';
+our $VERSION = '1.44';
 
 unless ( $ORLite::VERSION eq $VERSION ) {
 	die('Failed to load correct ORLite version');

Modified: trunk/liborlite-perl/t/lib/Test.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/t/lib/Test.pm?rev=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/t/lib/Test.pm (original)
+++ trunk/liborlite-perl/t/lib/Test.pm Mon Jul 26 13:47:07 2010
@@ -9,7 +9,7 @@
 
 use vars qw{$VERSION @ISA @EXPORT};
 BEGIN {
-	$VERSION = '1.43';
+	$VERSION = '1.44';
 	@ISA     = 'Exporter';
 	@EXPORT  = qw{ test_db connect_ok create_ok };
 }

Modified: trunk/liborlite-perl/xt/meta.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/xt/meta.t?rev=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/xt/meta.t (original)
+++ trunk/liborlite-perl/xt/meta.t Mon Jul 26 13:47:07 2010
@@ -8,7 +8,7 @@
 	$^W = 1;
 }
 
-my $MODULE = 'Test::CPAN::Meta 0.12';
+my $MODULE = 'Test::CPAN::Meta 0.17';
 
 # Don't run tests for installs
 use Test::More;

Modified: trunk/liborlite-perl/xt/pmv.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/xt/pmv.t?rev=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/xt/pmv.t (original)
+++ trunk/liborlite-perl/xt/pmv.t Mon Jul 26 13:47:07 2010
@@ -9,8 +9,8 @@
 }
 
 my @MODULES = (
-	'Perl::MinimumVersion 1.20',
-	'Test::MinimumVersion 0.008',
+	'Perl::MinimumVersion 1.25',
+	'Test::MinimumVersion 0.101080',
 );
 
 # Don't run tests for installs

Modified: trunk/liborlite-perl/xt/pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/xt/pod.t?rev=60605&op=diff
==============================================================================
--- trunk/liborlite-perl/xt/pod.t (original)
+++ trunk/liborlite-perl/xt/pod.t Mon Jul 26 13:47:07 2010
@@ -9,8 +9,8 @@
 }
 
 my @MODULES = (
-	'Pod::Simple 3.07',
-	'Test::Pod 1.26',
+	'Pod::Simple 3.14',
+	'Test::Pod 1.44',
 );
 
 # Don't run tests for installs




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