r60603 - in /branches/upstream/liborlite-perl/current: ./ 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:46:09 UTC 2010
Author: franck
Date: Mon Jul 26 13:45:51 2010
New Revision: 60603
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=60603
Log:
[svn-upgrade] new version liborlite-perl (1.44)
Modified:
branches/upstream/liborlite-perl/current/Changes
branches/upstream/liborlite-perl/current/META.yml
branches/upstream/liborlite-perl/current/Makefile.PL
branches/upstream/liborlite-perl/current/README
branches/upstream/liborlite-perl/current/inc/Module/Install.pm
branches/upstream/liborlite-perl/current/inc/Module/Install/Base.pm
branches/upstream/liborlite-perl/current/inc/Module/Install/Can.pm
branches/upstream/liborlite-perl/current/inc/Module/Install/DSL.pm
branches/upstream/liborlite-perl/current/inc/Module/Install/Fetch.pm
branches/upstream/liborlite-perl/current/inc/Module/Install/Makefile.pm
branches/upstream/liborlite-perl/current/inc/Module/Install/Metadata.pm
branches/upstream/liborlite-perl/current/inc/Module/Install/Win32.pm
branches/upstream/liborlite-perl/current/inc/Module/Install/With.pm
branches/upstream/liborlite-perl/current/inc/Module/Install/WriteAll.pm
branches/upstream/liborlite-perl/current/lib/ORLite.pm
branches/upstream/liborlite-perl/current/t/02_basics.t
branches/upstream/liborlite-perl/current/t/08_prune.pl
branches/upstream/liborlite-perl/current/t/lib/Test.pm
branches/upstream/liborlite-perl/current/xt/meta.t
branches/upstream/liborlite-perl/current/xt/pmv.t
branches/upstream/liborlite-perl/current/xt/pod.t
Modified: branches/upstream/liborlite-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/Changes?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/Changes (original)
+++ branches/upstream/liborlite-perl/current/Changes Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/META.yml?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/META.yml (original)
+++ branches/upstream/liborlite-perl/current/META.yml Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/Makefile.PL?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/Makefile.PL (original)
+++ branches/upstream/liborlite-perl/current/Makefile.PL Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/README?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/README (original)
+++ branches/upstream/liborlite-perl/current/README Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/inc/Module/Install.pm?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/inc/Module/Install.pm (original)
+++ branches/upstream/liborlite-perl/current/inc/Module/Install.pm Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/inc/Module/Install/Base.pm?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/inc/Module/Install/Base.pm (original)
+++ branches/upstream/liborlite-perl/current/inc/Module/Install/Base.pm Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/inc/Module/Install/Can.pm?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/inc/Module/Install/Can.pm (original)
+++ branches/upstream/liborlite-perl/current/inc/Module/Install/Can.pm Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/inc/Module/Install/DSL.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/inc/Module/Install/DSL.pm?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/inc/Module/Install/DSL.pm (original)
+++ branches/upstream/liborlite-perl/current/inc/Module/Install/DSL.pm Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/inc/Module/Install/Fetch.pm?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/inc/Module/Install/Fetch.pm (original)
+++ branches/upstream/liborlite-perl/current/inc/Module/Install/Fetch.pm Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/inc/Module/Install/Makefile.pm?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/inc/Module/Install/Makefile.pm (original)
+++ branches/upstream/liborlite-perl/current/inc/Module/Install/Makefile.pm Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/inc/Module/Install/Metadata.pm?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/inc/Module/Install/Metadata.pm (original)
+++ branches/upstream/liborlite-perl/current/inc/Module/Install/Metadata.pm Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/inc/Module/Install/Win32.pm?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/inc/Module/Install/Win32.pm (original)
+++ branches/upstream/liborlite-perl/current/inc/Module/Install/Win32.pm Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/inc/Module/Install/With.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/inc/Module/Install/With.pm?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/inc/Module/Install/With.pm (original)
+++ branches/upstream/liborlite-perl/current/inc/Module/Install/With.pm Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/inc/Module/Install/WriteAll.pm?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/inc/Module/Install/WriteAll.pm (original)
+++ branches/upstream/liborlite-perl/current/inc/Module/Install/WriteAll.pm Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/lib/ORLite.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/lib/ORLite.pm?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/lib/ORLite.pm (original)
+++ branches/upstream/liborlite-perl/current/lib/ORLite.pm Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/t/02_basics.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/t/02_basics.t?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/t/02_basics.t (original)
+++ branches/upstream/liborlite-perl/current/t/02_basics.t Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/t/08_prune.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/t/08_prune.pl?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/t/08_prune.pl (original)
+++ branches/upstream/liborlite-perl/current/t/08_prune.pl Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/t/lib/Test.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/t/lib/Test.pm?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/t/lib/Test.pm (original)
+++ branches/upstream/liborlite-perl/current/t/lib/Test.pm Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/xt/meta.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/xt/meta.t?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/xt/meta.t (original)
+++ branches/upstream/liborlite-perl/current/xt/meta.t Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/xt/pmv.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/xt/pmv.t?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/xt/pmv.t (original)
+++ branches/upstream/liborlite-perl/current/xt/pmv.t Mon Jul 26 13:45:51 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: branches/upstream/liborlite-perl/current/xt/pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-perl/current/xt/pod.t?rev=60603&op=diff
==============================================================================
--- branches/upstream/liborlite-perl/current/xt/pod.t (original)
+++ branches/upstream/liborlite-perl/current/xt/pod.t Mon Jul 26 13:45:51 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