r34133 - in /trunk/liborlite-migrate-perl: ./ debian/ inc/Module/ inc/Module/Install/ lib/ORLite/ lib/ORLite/Migrate/ t/ t/data/trivial/ t/lib/
gregoa at users.alioth.debian.org
gregoa at users.alioth.debian.org
Sat Apr 25 19:42:40 UTC 2009
Author: gregoa
Date: Sat Apr 25 19:42:35 2009
New Revision: 34133
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=34133
Log:
New upstream release.
Added:
trunk/liborlite-migrate-perl/inc/Module/Install/DSL.pm
- copied unchanged from r34132, branches/upstream/liborlite-migrate-perl/current/inc/Module/Install/DSL.pm
trunk/liborlite-migrate-perl/lib/ORLite/Migrate/
- copied from r34132, branches/upstream/liborlite-migrate-perl/current/lib/ORLite/Migrate/
trunk/liborlite-migrate-perl/t/data/trivial/migrate-03.pl
- copied unchanged from r34132, branches/upstream/liborlite-migrate-perl/current/t/data/trivial/migrate-03.pl
Removed:
trunk/liborlite-migrate-perl/inc/Module/Install/With.pm
Modified:
trunk/liborlite-migrate-perl/Changes
trunk/liborlite-migrate-perl/MANIFEST
trunk/liborlite-migrate-perl/META.yml
trunk/liborlite-migrate-perl/Makefile.PL
trunk/liborlite-migrate-perl/README
trunk/liborlite-migrate-perl/debian/changelog
trunk/liborlite-migrate-perl/inc/Module/Install.pm
trunk/liborlite-migrate-perl/inc/Module/Install/Base.pm
trunk/liborlite-migrate-perl/inc/Module/Install/Can.pm
trunk/liborlite-migrate-perl/inc/Module/Install/Fetch.pm
trunk/liborlite-migrate-perl/inc/Module/Install/Makefile.pm
trunk/liborlite-migrate-perl/inc/Module/Install/Metadata.pm
trunk/liborlite-migrate-perl/inc/Module/Install/Win32.pm
trunk/liborlite-migrate-perl/inc/Module/Install/WriteAll.pm
trunk/liborlite-migrate-perl/lib/ORLite/Migrate.pm
trunk/liborlite-migrate-perl/t/02_main.t
trunk/liborlite-migrate-perl/t/03_trivial.t
trunk/liborlite-migrate-perl/t/99_pmv.t
trunk/liborlite-migrate-perl/t/data/trivial/migrate-02.pl
trunk/liborlite-migrate-perl/t/data/trivial/migrate-1.pl
trunk/liborlite-migrate-perl/t/lib/Test.pm
Modified: trunk/liborlite-migrate-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/Changes?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/Changes (original)
+++ trunk/liborlite-migrate-perl/Changes Sat Apr 25 19:42:35 2009
@@ -1,4 +1,8 @@
Changes for Perl extension ORLite-Migrate
+
+0.03 Sun 19 Apr 2009
+ - Updating to Module::Install::DSL 0.83
+ - Copied in ORLite::Migrate::Patch from Padre::DB::Patch
0.02 Mon 16 Feb 2009
- Updating to Module::Install 0.79
Modified: trunk/liborlite-migrate-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/MANIFEST?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/MANIFEST (original)
+++ trunk/liborlite-migrate-perl/MANIFEST Sat Apr 25 19:42:35 2009
@@ -2,13 +2,14 @@
inc/Module/Install.pm
inc/Module/Install/Base.pm
inc/Module/Install/Can.pm
+inc/Module/Install/DSL.pm
inc/Module/Install/Fetch.pm
inc/Module/Install/Makefile.pm
inc/Module/Install/Metadata.pm
inc/Module/Install/Win32.pm
-inc/Module/Install/With.pm
inc/Module/Install/WriteAll.pm
lib/ORLite/Migrate.pm
+lib/ORLite/Migrate/Patch.pm
LICENSE
Makefile.PL
MANIFEST This list of files
@@ -21,5 +22,6 @@
t/98_pod.t
t/99_pmv.t
t/data/trivial/migrate-02.pl
+t/data/trivial/migrate-03.pl
t/data/trivial/migrate-1.pl
t/lib/Test.pm
Modified: trunk/liborlite-migrate-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/META.yml?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/META.yml (original)
+++ trunk/liborlite-migrate-perl/META.yml Sat Apr 25 19:42:35 2009
@@ -3,9 +3,12 @@
author:
- 'Adam Kennedy <adamk at cpan.org>'
build_requires:
+ ExtUtils::MakeMaker: 6.42
Test::More: 0.47
+configure_requires:
+ ExtUtils::MakeMaker: 6.42
distribution_type: module
-generated_by: 'Module::Install version 0.79'
+generated_by: 'Module::Install version 0.85'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -17,10 +20,10 @@
- inc
- t
requires:
- DBD::SQLite: 1.14
+ DBD::SQLite: 1.21
DBI: 1.58
File::Path: 2.04
- File::Spec: 0.80
+ File::Spec: 3.2701
File::pushd: 1.00
IPC::Run3: 0.042
ORLite: 1.20
@@ -28,5 +31,7 @@
Probe::Perl: 0.01
perl: 5.6.0
resources:
+ ChangeLog: http://fisheye2.atlassian.com/changelog/cpan/trunk/ORLite-Migrate
license: http://dev.perl.org/licenses/
-version: 0.02
+ repository: http://svn.ali.as/cpan/trunk/ORLite-Migrate
+version: 0.03
Modified: trunk/liborlite-migrate-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/Makefile.PL?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/Makefile.PL (original)
+++ trunk/liborlite-migrate-perl/Makefile.PL Sat Apr 25 19:42:35 2009
@@ -1,15 +1,8 @@
-use inc::Module::Install 0.79;
+use inc::Module::Install::DSL 0.83;
-all_from 'lib/ORLite/Migrate.pm';
-requires 'File::Spec' => winlike() ? '3.2701' : '0.80';
-requires 'File::Path' => '2.04';
-requires 'File::pushd' => '1.00';
-requires 'IPC::Run3' => '0.042';
-requires 'Params::Util' => '0.37';
-requires 'Probe::Perl' => '0.01';
-requires 'DBI' => '1.58';
-requires 'DBD::SQLite' => '1.14';
-requires 'ORLite' => '1.20';
-test_requires 'Test::More' => '0.47';
-
-WriteAll;
+all_from lib/ORLite/Migrate.pm
+requires_from lib/ORLite/Migrate.pm
+requires File::pushd 1.00
+requires IPC::Run3 0.042
+requires Probe::Perl 0.01
+test_requires Test::More 0.47
Modified: trunk/liborlite-migrate-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/README?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/README (original)
+++ trunk/liborlite-migrate-perl/README Sat Apr 25 19:42:35 2009
@@ -16,24 +16,24 @@
# migrate-1.pl - A trivial schema patch
#!/usr/bin/perl
-
- use strict;
+
+ use strict;
use DBI ();
-
- # Locate the SQLite database
+
+ # Locate the SQLite database
my $file = <STDIN>;
chomp($file);
unless ( -f $file and -w $file ) {
die "SQLite file $file does not exist";
}
-
- # Connect to the SQLite database
+
+ # Connect to the SQLite database
my $dbh = DBI->connect("dbi:SQLite(RaiseError=>1):$file");
unless ( $dbh ) {
die "Failed to connect to $file";
}
-
- $dbh->do( <<'END_SQL' );
+
+ $dbh->do( <<'END_SQL' );
create table foo (
id integer not null primary key,
name varchar(32) not null
Modified: trunk/liborlite-migrate-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/debian/changelog?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/debian/changelog (original)
+++ trunk/liborlite-migrate-perl/debian/changelog Sat Apr 25 19:42:35 2009
@@ -1,13 +1,15 @@
-liborlite-migrate-perl (0.02-1) UNRELEASED; urgency=low
+liborlite-migrate-perl (0.03-1) UNRELEASED; urgency=low
- NEEDS: libparams-util-perl (>= 0.37)
-
+ [ Brian Cassidy ]
* New upstream release
* debian/control:
+ added myself to Uploaders
+ updated deps
* debian/copyright:
+ updated copyright years
+
+ [ gregor herrmann ]
+ * New upstream release.
-- Brian Cassidy <brian.cassidy at gmail.com> Wed, 18 Feb 2009 10:19:05 -0400
Modified: trunk/liborlite-migrate-perl/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/inc/Module/Install.pm?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/inc/Module/Install.pm (original)
+++ trunk/liborlite-migrate-perl/inc/Module/Install.pm Sat Apr 25 19:42:35 2009
@@ -17,12 +17,10 @@
# 3. The ./inc/ version of Module::Install loads
# }
-BEGIN {
- require 5.004;
-}
+use 5.005;
use strict 'vars';
-use vars qw{$VERSION};
+use vars qw{$VERSION $MAIN};
BEGIN {
# All Module::Install core packages now require synchronised versions.
# This will be used to ensure we don't accidentally load old or
@@ -30,7 +28,10 @@
# 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.79';
+ $VERSION = '0.85';
+
+ # Storage for the pseudo-singleton
+ $MAIN = undef;
*inc::Module::Install::VERSION = *VERSION;
@inc::Module::Install::ISA = __PACKAGE__;
@@ -69,15 +70,26 @@
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
-if ( -f $0 and (stat($0))[9] > time ) { die <<"END_DIE" }
-
-Your installer $0 has a modification time in the future.
+if ( -f $0 ) {
+ my $s = (stat($0))[9];
+
+ # If the modification time is only slightly in the future,
+ # sleep briefly to remove the problem.
+ my $a = $s - time;
+ if ( $a > 0 and $a < 5 ) { sleep 5 }
+
+ # Too far in the future, throw an error.
+ my $t = time;
+ if ( $s > $t ) { die <<"END_DIE" }
+
+Your installer $0 has a modification time in the future ($s > $t).
This is known to create infinite loops in make.
Please correct this, then run $0 again.
END_DIE
+}
@@ -121,14 +133,22 @@
$sym->{$cwd} = sub {
my $pwd = Cwd::cwd();
if ( my $code = $sym->{$pwd} ) {
- # delegate back to parent dirs
+ # Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
$$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym";
- unless ( uc($1) eq $1 ) {
- unshift @_, ( $self, $1 );
- goto &{$self->can('call')};
+ my $method = $1;
+ if ( uc($method) eq $method ) {
+ # Do nothing
+ return;
+ } elsif ( $method =~ /^_/ and $self->can($method) ) {
+ # Dispatch to the root M:I class
+ return $self->$method(@_);
}
+
+ # Dispatch to the appropriate plugin
+ unshift @_, ( $self, $1 );
+ goto &{$self->can('call')};
};
}
@@ -153,6 +173,9 @@
delete $INC{"$self->{file}"};
delete $INC{"$self->{path}.pm"};
+ # Save to the singleton
+ $MAIN = $self;
+
return 1;
}
@@ -166,8 +189,7 @@
my @exts = @{$self->{extensions}};
unless ( @exts ) {
- my $admin = $self->{admin};
- @exts = $admin->load_all_extensions;
+ @exts = $self->{admin}->load_all_extensions;
}
my %seen;
@@ -250,7 +272,7 @@
sub load_extensions {
my ($self, $path, $top) = @_;
- unless ( grep { !ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
+ unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
unshift @INC, $self->{prefix};
}
@@ -314,7 +336,7 @@
#####################################################################
-# Utility Functions
+# Common Utility Functions
sub _caller {
my $depth = 0;
@@ -328,29 +350,68 @@
sub _read {
local *FH;
- open FH, "< $_[0]" or die "open($_[0]): $!";
- my $str = do { local $/; <FH> };
+ if ( $] >= 5.006 ) {
+ open( FH, '<', $_[0] ) or die "open($_[0]): $!";
+ } else {
+ open( FH, "< $_[0]" ) or die "open($_[0]): $!";
+ }
+ my $string = do { local $/; <FH> };
close FH or die "close($_[0]): $!";
- return $str;
+ return $string;
+}
+
+sub _readperl {
+ my $string = Module::Install::_read($_[0]);
+ $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg;
+ $string =~ s/(\n)\n*__(?:DATA|END)__\b.*\z/$1/s;
+ $string =~ s/\n\n=\w+.+?\n\n=cut\b.+?\n+/\n\n/sg;
+ return $string;
+}
+
+sub _readpod {
+ my $string = Module::Install::_read($_[0]);
+ $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg;
+ return $string if $_[0] =~ /\.pod\z/;
+ $string =~ s/(^|\n=cut\b.+?\n+)[^=\s].+?\n(\n=\w+|\z)/$1$2/sg;
+ $string =~ s/\n*=pod\b[^\n]*\n+/\n\n/sg;
+ $string =~ s/\n*=cut\b[^\n]*\n+/\n\n/sg;
+ $string =~ s/^\n+//s;
+ return $string;
}
sub _write {
local *FH;
- open FH, "> $_[0]" or die "open($_[0]): $!";
- foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!" }
+ if ( $] >= 5.006 ) {
+ open( FH, '>', $_[0] ) or die "open($_[0]): $!";
+ } else {
+ open( FH, "> $_[0]" ) or die "open($_[0]): $!";
+ }
+ foreach ( 1 .. $#_ ) {
+ print FH $_[$_] or die "print($_[0]): $!";
+ }
close FH or die "close($_[0]): $!";
}
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
-
sub _version ($) {
my $s = shift || 0;
- $s =~ s/^(\d+)\.?//;
+ my $d =()= $s =~ /(\.)/g;
+ if ( $d >= 2 ) {
+ # Normalise multipart versions
+ $s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg;
+ }
+ $s =~ s/^(\d+)\.?//;
my $l = $1 || 0;
- my @v = map { $_ . '0' x (3 - length $_) } $s =~ /(\d{1,3})\D?/g;
- $l = $l . '.' . join '', @v if @v;
+ my @v = map {
+ $_ . '0' x (3 - length $_)
+ } $s =~ /(\d{1,3})\D?/g;
+ $l = $l . '.' . join '', @v if @v;
return $l + 0;
+}
+
+sub _cmp ($$) {
+ _version($_[0]) <=> _version($_[1]);
}
# Cloned from Params::Util::_CLASS
@@ -360,7 +421,7 @@
and
! ref $_[0]
and
- $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*$/s
+ $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s
) ? $_[0] : undef;
}
Modified: trunk/liborlite-migrate-perl/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/inc/Module/Install/Base.pm?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/inc/Module/Install/Base.pm (original)
+++ trunk/liborlite-migrate-perl/inc/Module/Install/Base.pm Sat Apr 25 19:42:35 2009
@@ -1,7 +1,11 @@
#line 1
package Module::Install::Base;
-$VERSION = '0.79';
+use strict 'vars';
+use vars qw{$VERSION};
+BEGIN {
+ $VERSION = '0.85';
+}
# Suspend handler for "redefined" warnings
BEGIN {
@@ -12,51 +16,61 @@
### This is the ONLY module that shouldn't have strict on
# use strict;
-#line 41
+#line 45
sub new {
- my ($class, %args) = @_;
+ my ($class, %args) = @_;
- foreach my $method ( qw(call load) ) {
- *{"$class\::$method"} = sub {
- shift()->_top->$method(@_);
- } unless defined &{"$class\::$method"};
- }
+ foreach my $method ( qw(call load) ) {
+ next if defined &{"$class\::$method"};
+ *{"$class\::$method"} = sub {
+ shift()->_top->$method(@_);
+ };
+ }
- bless( \%args, $class );
+ bless( \%args, $class );
}
-#line 61
+#line 66
sub AUTOLOAD {
- my $self = shift;
- local $@;
- my $autoload = eval { $self->_top->autoload } or return;
- goto &$autoload;
+ my $self = shift;
+ local $@;
+ my $autoload = eval {
+ $self->_top->autoload
+ } or return;
+ goto &$autoload;
}
-#line 76
+#line 83
-sub _top { $_[0]->{_top} }
+sub _top {
+ $_[0]->{_top};
+}
-#line 89
+#line 98
sub admin {
- $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new;
+ $_[0]->_top->{admin}
+ or
+ Module::Install::Base::FakeAdmin->new;
}
-#line 101
+#line 114
sub is_admin {
- $_[0]->admin->VERSION;
+ $_[0]->admin->VERSION;
}
sub DESTROY {}
package Module::Install::Base::FakeAdmin;
-my $Fake;
-sub new { $Fake ||= bless(\@_, $_[0]) }
+my $fake;
+
+sub new {
+ $fake ||= bless(\@_, $_[0]);
+}
sub AUTOLOAD {}
@@ -69,4 +83,4 @@
1;
-#line 146
+#line 162
Modified: trunk/liborlite-migrate-perl/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/inc/Module/Install/Can.pm?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/inc/Module/Install/Can.pm (original)
+++ trunk/liborlite-migrate-perl/inc/Module/Install/Can.pm Sat Apr 25 19:42:35 2009
@@ -3,15 +3,13 @@
use strict;
use Module::Install::Base;
-use Config ();
-### This adds a 5.005 Perl version dependency.
-### This is a bug and will be fixed.
-use File::Spec ();
+use Config ();
+use File::Spec ();
use ExtUtils::MakeMaker ();
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.79';
+ $VERSION = '0.85';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
@@ -80,4 +78,4 @@
__END__
-#line 158
+#line 156
Modified: trunk/liborlite-migrate-perl/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/inc/Module/Install/Fetch.pm?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/inc/Module/Install/Fetch.pm (original)
+++ trunk/liborlite-migrate-perl/inc/Module/Install/Fetch.pm Sat Apr 25 19:42:35 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.79';
+ $VERSION = '0.85';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
Modified: trunk/liborlite-migrate-perl/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/inc/Module/Install/Makefile.pm?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/inc/Module/Install/Makefile.pm (original)
+++ trunk/liborlite-migrate-perl/inc/Module/Install/Makefile.pm Sat Apr 25 19:42:35 2009
@@ -7,7 +7,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.79';
+ $VERSION = '0.85';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
@@ -114,17 +114,32 @@
my $self = shift;
die "&Makefile->write() takes no arguments\n" if @_;
- # Make sure we have a new enough
+ # Check the current Perl version
+ my $perl_version = $self->perl_version;
+ if ( $perl_version ) {
+ eval "use $perl_version; 1"
+ or die "ERROR: perl: Version $] is installed, "
+ . "but we need version >= $perl_version";
+ }
+
+ # Make sure we have a new enough MakeMaker
require ExtUtils::MakeMaker;
- # MakeMaker can complain about module versions that include
- # an underscore, even though its own version may contain one!
- # Hence the funny regexp to get rid of it. See RT #35800
- # for details.
-
- $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
-
- # Generate the
+ if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) {
+ # MakeMaker can complain about module versions that include
+ # an underscore, even though its own version may contain one!
+ # Hence the funny regexp to get rid of it. See RT #35800
+ # for details.
+ $self->build_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
+ $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
+ } else {
+ # Allow legacy-compatibility with 5.005 by depending on the
+ # most recent EU:MM that supported 5.005.
+ $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 );
+ $self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
+ }
+
+ # Generate the MakeMaker params
my $args = $self->makemaker_args;
$args->{DISTNAME} = $self->name;
$args->{NAME} = $self->module_name || $self->name;
@@ -133,7 +148,7 @@
if ( $self->tests ) {
$args->{test} = { TESTS => $self->tests };
}
- if ($] >= 5.005) {
+ if ( $] >= 5.005 ) {
$args->{ABSTRACT} = $self->abstract;
$args->{AUTHOR} = $self->author;
}
@@ -147,7 +162,7 @@
delete $args->{SIGN};
}
- # merge both kinds of requires into prereq_pm
+ # Merge both kinds of requires into prereq_pm
my $prereq = ($args->{PREREQ_PM} ||= {});
%$prereq = ( %$prereq,
map { @$_ }
@@ -250,4 +265,4 @@
__END__
-#line 379
+#line 394
Modified: trunk/liborlite-migrate-perl/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/inc/Module/Install/Metadata.pm?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/inc/Module/Install/Metadata.pm (original)
+++ trunk/liborlite-migrate-perl/inc/Module/Install/Metadata.pm Sat Apr 25 19:42:35 2009
@@ -4,12 +4,17 @@
use strict 'vars';
use Module::Install::Base;
-use vars qw{$VERSION $ISCORE @ISA};
+use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.79';
+ $VERSION = '0.85';
+ @ISA = qw{Module::Install::Base};
$ISCORE = 1;
- @ISA = qw{Module::Install::Base};
-}
+}
+
+my @boolean_keys = qw{
+ sign
+ mymeta
+};
my @scalar_keys = qw{
name
@@ -37,16 +42,43 @@
repository
};
+my @array_keys = qw{
+ keywords
+};
+
sub Meta { shift }
+sub Meta_BooleanKeys { @boolean_keys }
sub Meta_ScalarKeys { @scalar_keys }
sub Meta_TupleKeys { @tuple_keys }
sub Meta_ResourceKeys { @resource_keys }
+sub Meta_ArrayKeys { @array_keys }
+
+foreach my $key ( @boolean_keys ) {
+ *$key = sub {
+ my $self = shift;
+ if ( defined wantarray and not @_ ) {
+ return $self->{values}->{$key};
+ }
+ $self->{values}->{$key} = ( @_ ? $_[0] : 1 );
+ return $self;
+ };
+}
foreach my $key ( @scalar_keys ) {
*$key = sub {
my $self = shift;
- return $self->{values}{$key} if defined wantarray and !@_;
- $self->{values}{$key} = shift;
+ return $self->{values}->{$key} if defined wantarray and !@_;
+ $self->{values}->{$key} = shift;
+ return $self;
+ };
+}
+
+foreach my $key ( @array_keys ) {
+ *$key = sub {
+ my $self = shift;
+ return $self->{values}->{$key} if defined wantarray and !@_;
+ $self->{values}->{$key} ||= [];
+ push @{$self->{values}->{$key}}, @_;
return $self;
};
}
@@ -55,12 +87,12 @@
*$key = sub {
my $self = shift;
unless ( @_ ) {
- return () unless $self->{values}{resources};
+ return () unless $self->{values}->{resources};
return map { $_->[1] }
grep { $_->[0] eq $key }
- @{ $self->{values}{resources} };
- }
- return $self->{values}{resources}{$key} unless @_;
+ @{ $self->{values}->{resources} };
+ }
+ return $self->{values}->{resources}->{$key} unless @_;
my $uri = shift or die(
"Did not provide a value to $key()"
);
@@ -69,54 +101,19 @@
};
}
-sub requires {
- my $self = shift;
- while ( @_ ) {
- my $module = shift or last;
- my $version = shift || 0;
- push @{ $self->{values}{requires} }, [ $module, $version ];
- }
- $self->{values}{requires};
-}
-
-sub build_requires {
- my $self = shift;
- while ( @_ ) {
- my $module = shift or last;
- my $version = shift || 0;
- push @{ $self->{values}{build_requires} }, [ $module, $version ];
- }
- $self->{values}{build_requires};
-}
-
-sub configure_requires {
- my $self = shift;
- while ( @_ ) {
- my $module = shift or last;
- my $version = shift || 0;
- push @{ $self->{values}{configure_requires} }, [ $module, $version ];
- }
- $self->{values}{configure_requires};
-}
-
-sub recommends {
- my $self = shift;
- while ( @_ ) {
- my $module = shift or last;
- my $version = shift || 0;
- push @{ $self->{values}{recommends} }, [ $module, $version ];
- }
- $self->{values}{recommends};
-}
-
-sub bundles {
- my $self = shift;
- while ( @_ ) {
- my $module = shift or last;
- my $version = shift || 0;
- push @{ $self->{values}{bundles} }, [ $module, $version ];
- }
- $self->{values}{bundles};
+foreach my $key ( grep { $_ ne "resources" } @tuple_keys) {
+ *$key = sub {
+ my $self = shift;
+ return $self->{values}->{$key} unless @_;
+ my @added;
+ while ( @_ ) {
+ my $module = shift or last;
+ my $version = shift || 0;
+ push @added, [ $module, $version ];
+ }
+ push @{ $self->{values}->{$key} }, @added;
+ return map {@$_} @added;
+ };
}
# Resource handling
@@ -135,29 +132,22 @@
if ( $name eq lc $name and ! $lc_resource{$name} ) {
die("Unsupported reserved lowercase resource '$name'");
}
- $self->{values}{resources} ||= [];
- push @{ $self->{values}{resources} }, [ $name, $value ];
- }
- $self->{values}{resources};
+ $self->{values}->{resources} ||= [];
+ push @{ $self->{values}->{resources} }, [ $name, $value ];
+ }
+ $self->{values}->{resources};
}
# Aliases for build_requires that will have alternative
# meanings in some future version of META.yml.
-sub test_requires { shift->build_requires(@_) }
-sub install_requires { shift->build_requires(@_) }
+sub test_requires { shift->build_requires(@_) }
+sub install_requires { shift->build_requires(@_) }
# Aliases for installdirs options
-sub install_as_core { $_[0]->installdirs('perl') }
-sub install_as_cpan { $_[0]->installdirs('site') }
-sub install_as_site { $_[0]->installdirs('site') }
-sub install_as_vendor { $_[0]->installdirs('vendor') }
-
-sub sign {
- my $self = shift;
- return $self->{values}{sign} if defined wantarray and ! @_;
- $self->{values}{sign} = ( @_ ? $_[0] : 1 );
- return $self;
-}
+sub install_as_core { $_[0]->installdirs('perl') }
+sub install_as_cpan { $_[0]->installdirs('site') }
+sub install_as_site { $_[0]->installdirs('site') }
+sub install_as_vendor { $_[0]->installdirs('vendor') }
sub dynamic_config {
my $self = shift;
@@ -165,13 +155,13 @@
warn "You MUST provide an explicit true/false value to dynamic_config\n";
return $self;
}
- $self->{values}{dynamic_config} = $_[0] ? 1 : 0;
+ $self->{values}->{dynamic_config} = $_[0] ? 1 : 0;
return 1;
}
sub perl_version {
my $self = shift;
- return $self->{values}{perl_version} unless @_;
+ return $self->{values}->{perl_version} unless @_;
my $version = shift or die(
"Did not provide a value to perl_version()"
);
@@ -184,20 +174,41 @@
die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
}
- $self->{values}{perl_version} = $version;
-}
+ $self->{values}->{perl_version} = $version;
+}
+
+#Stolen from M::B
+my %license_urls = (
+ perl => 'http://dev.perl.org/licenses/',
+ apache => 'http://apache.org/licenses/LICENSE-2.0',
+ artistic => 'http://opensource.org/licenses/artistic-license.php',
+ artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php',
+ lgpl => 'http://opensource.org/licenses/lgpl-license.php',
+ lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php',
+ lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html',
+ bsd => 'http://opensource.org/licenses/bsd-license.php',
+ gpl => 'http://opensource.org/licenses/gpl-license.php',
+ gpl2 => 'http://opensource.org/licenses/gpl-2.0.php',
+ gpl3 => 'http://opensource.org/licenses/gpl-3.0.html',
+ mit => 'http://opensource.org/licenses/mit-license.php',
+ mozilla => 'http://opensource.org/licenses/mozilla1.1.php',
+ open_source => undef,
+ unrestricted => undef,
+ restrictive => undef,
+ unknown => undef,
+);
sub license {
my $self = shift;
- return $self->{values}{license} unless @_;
+ return $self->{values}->{license} unless @_;
my $license = shift or die(
'Did not provide a value to license()'
);
- $self->{values}{license} = $license;
+ $self->{values}->{license} = $license;
# Automatically fill in license URLs
- if ( $license eq 'perl' ) {
- $self->resources( license => 'http://dev.perl.org/licenses/' );
+ if ( $license_urls{$license} ) {
+ $self->resources( license => $license_urls{$license} );
}
return 1;
@@ -239,7 +250,7 @@
sub provides {
my $self = shift;
- my $provides = ( $self->{values}{provides} ||= {} );
+ my $provides = ( $self->{values}->{provides} ||= {} );
%$provides = (%$provides, @_) if @_;
return $provides;
}
@@ -268,7 +279,7 @@
sub feature {
my $self = shift;
my $name = shift;
- my $features = ( $self->{values}{features} ||= [] );
+ my $features = ( $self->{values}->{features} ||= [] );
my $mods;
if ( @_ == 1 and ref( $_[0] ) ) {
@@ -296,16 +307,16 @@
while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) {
$self->feature( $name, @$mods );
}
- return $self->{values}{features}
- ? @{ $self->{values}{features} }
+ return $self->{values}->{features}
+ ? @{ $self->{values}->{features} }
: ();
}
sub no_index {
my $self = shift;
my $type = shift;
- push @{ $self->{values}{no_index}{$type} }, @_ if $type;
- return $self->{values}{no_index};
+ push @{ $self->{values}->{no_index}->{$type} }, @_ if $type;
+ return $self->{values}->{no_index};
}
sub read {
@@ -458,10 +469,18 @@
return 'unknown';
}
+sub _extract_bugtracker {
+ my @links = $_[0] =~ m#L<(\Qhttp://rt.cpan.org/\E[^>]+)>#g;
+ my %links;
+ @links{@links}=();
+ @links=keys %links;
+ return @links;
+}
+
sub bugtracker_from {
my $self = shift;
my $content = Module::Install::_read($_[0]);
- my @links = $content =~ m/L\<(http\:\/\/rt\.cpan\.org\/[^>]+)\>/g;
+ my @links = _extract_bugtracker($content);
unless ( @links ) {
warn "Cannot determine bugtracker info from $_[0]\n";
return 0;
@@ -474,6 +493,17 @@
# Set the bugtracker
bugtracker( $links[0] );
return 1;
+}
+
+sub 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->requires( $module => $version );
+ }
}
# Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
@@ -499,7 +529,7 @@
# MYMETA.yml Support
sub WriteMyMeta {
- $_[0]->write_mymeta;
+ die "WriteMyMeta has been deprecated";
}
sub write_mymeta {
@@ -507,6 +537,11 @@
# If there's no existing META.yml there is nothing we can do
return unless -f 'META.yml';
+
+ # We need YAML::Tiny to write the MYMETA.yml file
+ unless ( eval { require YAML::Tiny; 1; } ) {
+ return 1;
+ }
# Merge the perl version into the dependencies
my $val = $self->Meta->{values};
@@ -523,7 +558,6 @@
}
# Load the advisory META.yml file
- require YAML::Tiny;
my @yaml = YAML::Tiny::LoadFile('META.yml');
my $meta = $yaml[0];
@@ -539,7 +573,8 @@
}
# Save as the MYMETA.yml file
- YAML::Tiny::DumpFile('MYMETA.yml', $meta);
+ print "Writing MYMETA.yml\n";
+ YAML::Tiny::DumpFile('MYMETA.yml', $meta);
}
1;
Modified: trunk/liborlite-migrate-perl/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/inc/Module/Install/Win32.pm?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/inc/Module/Install/Win32.pm (original)
+++ trunk/liborlite-migrate-perl/inc/Module/Install/Win32.pm Sat Apr 25 19:42:35 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.79';
+ $VERSION = '0.85';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
Modified: trunk/liborlite-migrate-perl/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/inc/Module/Install/WriteAll.pm?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/inc/Module/Install/WriteAll.pm (original)
+++ trunk/liborlite-migrate-perl/inc/Module/Install/WriteAll.pm Sat Apr 25 19:42:35 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.79';
+ $VERSION = '0.85';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
@@ -22,7 +22,6 @@
);
$self->sign(1) if $args{sign};
- $self->Meta->write if $args{meta};
$self->admin->WriteAll(%args) if $self->is_admin;
$self->check_nmake if $args{check_nmake};
@@ -30,11 +29,22 @@
$self->makemaker_args( PL_FILES => {} );
}
+ # Until ExtUtils::MakeMaker support MYMETA.yml, make sure
+ # we clean it up properly ourself.
+ $self->realclean_files('MYMETA.yml');
+
if ( $args{inline} ) {
$self->Inline->write;
} else {
$self->Makefile->write;
}
+
+ # The Makefile write process adds a couple of dependencies,
+ # so write the META.yml files after the Makefile.
+ $self->Meta->write if $args{meta};
+ $self->Meta->write_mymeta if $self->mymeta;
+
+ return 1;
}
1;
Modified: trunk/liborlite-migrate-perl/lib/ORLite/Migrate.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/lib/ORLite/Migrate.pm?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/lib/ORLite/Migrate.pm (original)
+++ trunk/liborlite-migrate-perl/lib/ORLite/Migrate.pm Sat Apr 25 19:42:35 2009
@@ -4,14 +4,18 @@
use 5.006;
use strict;
-use Carp ();
-use Params::Util qw{ _STRING _CLASS _HASH };
-use DBI ();
-use ORLite ();
+use Carp ();
+use File::Spec 3.2701 ();
+use File::Path 2.04 ();
+use File::Basename ();
+use Params::Util 0.37 qw{ _STRING _CLASS _HASH };
+use DBI 1.58 ();
+use DBD::SQLite 1.21 ();
+use ORLite 1.20 ();
use vars qw{$VERSION @ISA};
BEGIN {
- $VERSION = '0.02';
+ $VERSION = '0.03';
@ISA = 'ORLite';
}
Modified: trunk/liborlite-migrate-perl/t/02_main.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/t/02_main.t?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/t/02_main.t (original)
+++ trunk/liborlite-migrate-perl/t/02_main.t Sat Apr 25 19:42:35 2009
@@ -18,7 +18,7 @@
my @patches = ORLite::Migrate::patches( $timeline );
is_deeply(
\@patches,
- [ undef, 'migrate-1.pl', 'migrate-02.pl' ],
+ [ undef, 'migrate-1.pl', 'migrate-02.pl', 'migrate-03.pl' ],
'Found the expected patch set',
);
@@ -26,7 +26,7 @@
my @plan = ORLite::Migrate::plan( $timeline, 1 );
is_deeply(
\@plan,
- [ 'migrate-02.pl' ],
+ [ 'migrate-02.pl', 'migrate-03.pl' ],
'Found expected plan',
);
Modified: trunk/liborlite-migrate-perl/t/03_trivial.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/t/03_trivial.t?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/t/03_trivial.t (original)
+++ trunk/liborlite-migrate-perl/t/03_trivial.t Sat Apr 25 19:42:35 2009
@@ -25,13 +25,13 @@
create => 1,
file => '$file',
timeline => '$timeline',
- user_version => 2,
+ user_version => 3,
};
1;
END_PERL
# The package should be migrated correctly
-is( Foo::Bar->pragma('user_version'), 2, 'New database migrated ok' );
+is( Foo::Bar->pragma('user_version'), 3, 'New database migrated ok' );
ok( Foo::Bar::Foo->can('count'), 'Created Foo table ok' );
-is( Foo::Bar::Foo->count, 2, 'Found expected number of rows' );
+is( Foo::Bar::Foo->count, 3, 'Found expected number of rows' );
Modified: trunk/liborlite-migrate-perl/t/99_pmv.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/t/99_pmv.t?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/t/99_pmv.t (original)
+++ trunk/liborlite-migrate-perl/t/99_pmv.t Sat Apr 25 19:42:35 2009
@@ -8,7 +8,10 @@
$^W = 1;
}
-my $MODULE = 'Test::MinimumVersion 0.008';
+my @MODULES = (
+ 'Perl::MinimumVersion 1.20',
+ 'Test::MinimumVersion 0.008',
+);
# Don't run tests for installs
use Test::More;
@@ -16,12 +19,14 @@
plan( skip_all => "Author tests not required for installation" );
}
-# Load the testing module
-eval "use $MODULE";
-if ( $@ ) {
- $ENV{RELEASE_TESTING}
- ? die( "Failed to load required release-testing module $MODULE" )
- : plan( skip_all => "$MODULE not available for testing" );
+# Load the testing modules
+foreach my $MODULE ( @MODULES ) {
+ eval "use $MODULE";
+ if ( $@ ) {
+ $ENV{RELEASE_TESTING}
+ ? die( "Failed to load required release-testing module $MODULE" )
+ : plan( skip_all => "$MODULE not available for testing" );
+ }
}
all_minimum_version_from_metayml_ok();
Modified: trunk/liborlite-migrate-perl/t/data/trivial/migrate-02.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/t/data/trivial/migrate-02.pl?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/t/data/trivial/migrate-02.pl (original)
+++ trunk/liborlite-migrate-perl/t/data/trivial/migrate-02.pl Sat Apr 25 19:42:35 2009
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
use strict;
use DBI ();
Modified: trunk/liborlite-migrate-perl/t/data/trivial/migrate-1.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/t/data/trivial/migrate-1.pl?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/t/data/trivial/migrate-1.pl (original)
+++ trunk/liborlite-migrate-perl/t/data/trivial/migrate-1.pl Sat Apr 25 19:42:35 2009
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
use strict;
use DBI ();
Modified: trunk/liborlite-migrate-perl/t/lib/Test.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-migrate-perl/t/lib/Test.pm?rev=34133&op=diff
==============================================================================
--- trunk/liborlite-migrate-perl/t/lib/Test.pm (original)
+++ trunk/liborlite-migrate-perl/t/lib/Test.pm Sat Apr 25 19:42:35 2009
@@ -9,7 +9,7 @@
use vars qw{$VERSION @ISA @EXPORT};
BEGIN {
- $VERSION = '0.01';
+ $VERSION = '0.03';
@ISA = qw{ Exporter };
@EXPORT = qw{ test_db connect_ok create_ok };
}
More information about the Pkg-perl-cvs-commits
mailing list