r50566 - in /branches/upstream/liborlite-migrate-perl/current: Changes MANIFEST META.yml Makefile.PL README lib/ORLite/Migrate.pm lib/ORLite/Migrate/Patch.pm lib/ORLite/Migrate/Perl.pm t/01_compile.t t/lib/Test.pm

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sat Jan 9 17:53:36 UTC 2010


Author: jawnsy-guest
Date: Sat Jan  9 17:53:29 2010
New Revision: 50566

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=50566
Log:
[svn-upgrade] Integrating new upstream version, liborlite-migrate-perl (1.06)

Added:
    branches/upstream/liborlite-migrate-perl/current/lib/ORLite/Migrate/Perl.pm
Modified:
    branches/upstream/liborlite-migrate-perl/current/Changes
    branches/upstream/liborlite-migrate-perl/current/MANIFEST
    branches/upstream/liborlite-migrate-perl/current/META.yml
    branches/upstream/liborlite-migrate-perl/current/Makefile.PL
    branches/upstream/liborlite-migrate-perl/current/README
    branches/upstream/liborlite-migrate-perl/current/lib/ORLite/Migrate.pm
    branches/upstream/liborlite-migrate-perl/current/lib/ORLite/Migrate/Patch.pm
    branches/upstream/liborlite-migrate-perl/current/t/01_compile.t
    branches/upstream/liborlite-migrate-perl/current/t/lib/Test.pm

Modified: branches/upstream/liborlite-migrate-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-migrate-perl/current/Changes?rev=50566&op=diff
==============================================================================
--- branches/upstream/liborlite-migrate-perl/current/Changes (original)
+++ branches/upstream/liborlite-migrate-perl/current/Changes Sat Jan  9 17:53:29 2010
@@ -1,5 +1,9 @@
 Changes for Perl extension ORLite-Migrate
 
+1.06 Sat  9 Jan 2010
+	- Cloned in a copy of Padre::Perl as ORLite::Migrate::Perl
+	- Switch to using cperl
+	
 1.05 Sat 26 Sep 2009
 	- Some additional tweaks to the prune support
 

Modified: branches/upstream/liborlite-migrate-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-migrate-perl/current/MANIFEST?rev=50566&op=diff
==============================================================================
--- branches/upstream/liborlite-migrate-perl/current/MANIFEST (original)
+++ branches/upstream/liborlite-migrate-perl/current/MANIFEST Sat Jan  9 17:53:29 2010
@@ -10,6 +10,7 @@
 inc/Module/Install/WriteAll.pm
 lib/ORLite/Migrate.pm
 lib/ORLite/Migrate/Patch.pm
+lib/ORLite/Migrate/Perl.pm
 LICENSE
 Makefile.PL
 MANIFEST			This list of files

Modified: branches/upstream/liborlite-migrate-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-migrate-perl/current/META.yml?rev=50566&op=diff
==============================================================================
--- branches/upstream/liborlite-migrate-perl/current/META.yml (original)
+++ branches/upstream/liborlite-migrate-perl/current/META.yml Sat Jan  9 17:53:29 2010
@@ -24,6 +24,7 @@
   DBI: 1.58
   File::Path: 2.04
   File::Spec: 3.2701
+  File::Which: 1.07
   File::pushd: 1.00
   IPC::Run3: 0.042
   ORLite: 1.28
@@ -34,4 +35,4 @@
   ChangeLog: http://fisheye2.atlassian.com/changelog/cpan/trunk/ORLite-Migrate
   license: http://dev.perl.org/licenses/
   repository: http://svn.ali.as/cpan/trunk/ORLite-Migrate
-version: 1.05
+version: 1.06

Modified: branches/upstream/liborlite-migrate-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-migrate-perl/current/Makefile.PL?rev=50566&op=diff
==============================================================================
--- branches/upstream/liborlite-migrate-perl/current/Makefile.PL (original)
+++ branches/upstream/liborlite-migrate-perl/current/Makefile.PL Sat Jan  9 17:53:29 2010
@@ -5,5 +5,6 @@
 requires      File::pushd  1.00
 requires      IPC::Run3    0.042
 requires      Probe::Perl  0.01
+requires      File::Which  1.07
 requires      Params::Util 0.37
 test_requires Test::More   0.47

Modified: branches/upstream/liborlite-migrate-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-migrate-perl/current/README?rev=50566&op=diff
==============================================================================
--- branches/upstream/liborlite-migrate-perl/current/README (original)
+++ branches/upstream/liborlite-migrate-perl/current/README Sat Jan  9 17:53:29 2010
@@ -109,7 +109,7 @@
     Adam Kennedy <adamk at cpan.org>
 
 COPYRIGHT
-    Copyright 2009 Adam Kennedy.
+    Copyright 2009 - 2010 Adam Kennedy.
 
     This program is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.

Modified: branches/upstream/liborlite-migrate-perl/current/lib/ORLite/Migrate.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-migrate-perl/current/lib/ORLite/Migrate.pm?rev=50566&op=diff
==============================================================================
--- branches/upstream/liborlite-migrate-perl/current/lib/ORLite/Migrate.pm (original)
+++ branches/upstream/liborlite-migrate-perl/current/lib/ORLite/Migrate.pm Sat Jan  9 17:53:29 2010
@@ -8,14 +8,14 @@
 use File::Spec 3.2701 ();
 use File::Path   2.04 ();
 use File::Basename    ();
-use Params::Util 0.37 qw{ _STRING _CLASS _HASH };
+use Params::Util 0.37 ();
 use DBI          1.58 ();
 use DBD::SQLite  1.21 ();
 use ORLite       1.28 ();
 
 use vars qw{$VERSION @ISA};
 BEGIN {
-	$VERSION = '1.05';
+	$VERSION = '1.06';
 	@ISA     = 'ORLite';
 }
 
@@ -24,24 +24,24 @@
 
 	# Check for debug mode
 	my $DEBUG = 0;
-	if ( defined _STRING($_[-1]) and $_[-1] eq '-DEBUG' ) {
+	if ( defined Params::Util::_STRING($_[-1]) and $_[-1] eq '-DEBUG' ) {
 		$DEBUG = 1;
 		pop @_;
 	}
 
 	# Check params and apply defaults
 	my %params;
-	if ( defined _STRING($_[1]) ) {
+	if ( defined Params::Util::_STRING($_[1]) ) {
 		# Migrate needs at least two params
 		Carp::croak("ORLite::Migrate must be invoked in HASH form");
-	} elsif ( _HASH($_[1]) ) {
+	} elsif ( Params::Util::_HASH($_[1]) ) {
 		%params = %{ $_[1] };
 	} else {
 		Carp::croak("Missing, empty or invalid params HASH");
 	}
 	$params{create} = $params{create} ? 1 : 0;
 	unless (
-		defined _STRING($params{file})
+		defined Params::Util::_STRING($params{file})
 		and (
 			$params{create}
 			or
@@ -59,7 +59,7 @@
 	unless ( defined $params{package} ) {
 		$params{package} = scalar caller;
 	}
-	unless ( _CLASS($params{package}) ) {
+	unless ( Params::Util::_CLASS($params{package}) ) {
 		Carp::croak("Missing or invalid package class");
 	}
 	unless ( $params{timeline} and -d $params{timeline} and -r $params{timeline} ) {
@@ -108,12 +108,12 @@
 		}
 
 		# Load the modules needed for the migration
-		require Probe::Perl;
+		require ORLite::Migrate::Perl;
 		require File::pushd;
 		require IPC::Run3;
 
 		# Execute each script
-		my $perl  = Probe::Perl->find_perl_interpreter;
+		my $perl  = ORLite::Migrate::Perl::cperl();
 		my $pushd = File::pushd::pushd($timeline);
 		foreach my $patch ( @plan ) {
 			my $stdin = "$file\n";
@@ -302,7 +302,7 @@
 
 =head1 COPYRIGHT
 
-Copyright 2009 Adam Kennedy.
+Copyright 2009 - 2010 Adam Kennedy.
 
 This program is free software; you can redistribute
 it and/or modify it under the same terms as Perl itself.

Modified: branches/upstream/liborlite-migrate-perl/current/lib/ORLite/Migrate/Patch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-migrate-perl/current/lib/ORLite/Migrate/Patch.pm?rev=50566&op=diff
==============================================================================
--- branches/upstream/liborlite-migrate-perl/current/lib/ORLite/Migrate/Patch.pm (original)
+++ branches/upstream/liborlite-migrate-perl/current/lib/ORLite/Migrate/Patch.pm Sat Jan  9 17:53:29 2010
@@ -11,7 +11,7 @@
 
 use vars qw{$VERSION @ISA @EXPORT $FILE};
 BEGIN {
-	$VERSION = '1.05';
+	$VERSION = '1.06';
 	@ISA     = 'Exporter';
 	@EXPORT  = qw{
 		file

Added: branches/upstream/liborlite-migrate-perl/current/lib/ORLite/Migrate/Perl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-migrate-perl/current/lib/ORLite/Migrate/Perl.pm?rev=50566&op=file
==============================================================================
--- branches/upstream/liborlite-migrate-perl/current/lib/ORLite/Migrate/Perl.pm (added)
+++ branches/upstream/liborlite-migrate-perl/current/lib/ORLite/Migrate/Perl.pm Sat Jan  9 17:53:29 2010
@@ -1,0 +1,230 @@
+package ORLite::Migrate::Perl;
+
+# TO DO: Merge this into Probe::Perl some day in the future when this is
+#       perfected, stable and beyond reproach.
+
+=pod
+
+=head1 NAME
+
+ORLite::Migrate::Perl - A copy of Padre::Perl (an improved Probe::Perl)
+
+=head1 DESCRIPTION
+
+Even though it has only had a single release, L<Probe::Perl> is the "best
+practice" method for finding the current Perl interpreter, so that we can
+make a system call to a new instance of the same Perl environment.
+
+However, during the development of L<Padre> we have found the feature set
+of L<Probe::Perl> to be insufficient.
+
+C<ORLite::Migrate::Perl> is an experimental attempt to improve on L<Probe::Perl>
+and support a wider range of situations. The implementation is being
+contained to the L<Padre> project until we have competently "solved" all
+of the problems that we care about.
+
+=head2 GUI vs Command Line
+
+On some operating systems, different Perl binaries need to be called based
+on whether the process will be executing in a graphical environment versus
+a command line environment.
+
+On Microsoft Windows F<perl.exe> is the command line Perl binary and
+F<wperl.exe> is the windowing Perl binary.
+
+On Mac OS X (Darwin) F<perl.exe> is the command line Perl binary and
+F<wxPerl.exe> is a wxWidgets-specific Perl binary.
+
+=head2 PAR Support
+
+PAR executables do not typically support re-invocation, and implementations
+that do are only a recent invention, and do not support the normal Perl
+flags.
+
+Once implemented, we may try to implement support for them here as well.
+
+=head1 FUNCTIONS
+
+=cut
+
+use 5.006;
+use strict;
+use warnings;
+
+use vars qw{$VERSION @ISA};
+BEGIN {
+	$VERSION = '1.06';
+}
+
+my $perl = undef;
+
+=pod
+
+=head2 C<perl>
+
+The C<perl> function is equivalent to (and passes through to) the
+C<find_perl_interpreter> method of L<Probe::Perl>.
+
+It should be used when you simply need the "current" Perl executable and
+don't have any special needs. The other functions should only be used once
+you understand your needs in more detail.
+
+Returns the location of current F<perl> executable, or C<undef> if it
+cannot be found.
+
+=cut
+
+sub perl {
+
+	# Find the exact Perl used to launch Padre
+	return $perl if defined $perl;
+	require Probe::Perl;
+	require File::Which;
+
+	# Use the most correct method first
+	require Probe::Perl;
+	my $_perl = Probe::Perl->find_perl_interpreter;
+	if ( defined $_perl ) {
+		$perl = $_perl;
+		return $perl;
+	}
+
+	# Fallback to a simpler way
+	require File::Which;
+	$_perl = scalar File::Which::which('perl');
+	$perl  = $_perl;
+	return $perl;
+}
+
+=pod
+
+=head2 C<cperl>
+
+The C<cperl> function is a Perl executable location function that
+specifically tries to find a command line Perl. In some situations you
+may critically need a command line Perl so that proper C<STDIN>, C<STDOUT>
+and C<STDERR> handles are available.
+
+Returns a path to a command line Perl, or C<undef> if one cannot be found.
+
+=cut
+
+sub cperl {
+	my $path = perl();
+
+	# Cascade failure
+	unless ( defined $path ) {
+		return;
+	}
+
+	if ( $^O eq 'MSWin32' ) {
+		if ( $path =~ s/\b(wperl\.exe)\z// ) {
+
+			# Convert to non-GUI
+			if ( -f "${path}perl.exe" ) {
+				return "${path}perl.exe";
+			} else {
+				return "${path}wperl.exe";
+			}
+		}
+
+		# Unknown, give up
+		return $path;
+	}
+
+	if ( $^O eq 'darwin' ) {
+		if ( $path =~ s/\b(wxPerl)\z// ) {
+
+			# Convert to non-GUI
+			if ( -f "${path}perl" ) {
+				return "${path}perl";
+			} else {
+				return "${path}wxPerl";
+			}
+		}
+
+		# Unknown, give up
+		return $path;
+	}
+
+	# No distinction on this platform, or we have no idea
+	return $path;
+}
+
+=pod
+
+=head2 C<wxperl>
+
+The C<wxperl> function is a Perl executable location function that
+specifically tries to find a windowing Perl for running wxWidgets
+applications. In some situations you may critically need a wxWidgets
+Perl so that a command line box is not show (Windows) or so that Wx
+starts up properly at all (Mac OS X).
+
+Returns a path to a Perl suitable for the execution of L<Wx>-based
+applications, or C<undef> if one cannot be found.
+
+=cut
+
+sub wxperl {
+	my $path = perl();
+
+	# Cascade failure
+	unless ( defined $path ) {
+		return;
+	}
+
+	if ( $^O eq 'MSWin32' ) {
+		if ( $path =~ s/\b(perl\.exe)\z// ) {
+
+			# Convert to GUI version if we can
+			if ( -f "${path}wperl.exe" ) {
+				return "${path}wperl.exe";
+			} else {
+				return "${path}perl.exe";
+			}
+		}
+
+		# Unknown, give up
+		return $path;
+	}
+
+	if ( $^O eq 'darwin' ) {
+		if ( $path =~ s/\b(perl)\z// ) {
+
+			# Convert to Wx launcher
+			if ( -f "${path}wxPerl" ) {
+				return "${path}wxPerl";
+			} else {
+				return "${path}perl";
+			}
+		}
+
+		# Unknown, give up
+		return $path;
+	}
+
+	# No distinction on this platform, or we have no idea
+	return $path;
+}
+
+1;
+
+=pod
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2008-2010 The Padre development team
+
+This program is free software; you can redistribute
+it and/or modify it under the same terms as Perl itself.
+
+The full text of the license can be found in the
+LICENSE file included with this module.
+
+=cut
+
+# Copyright 2008-2010 The Padre development team as listed in Padre.pm.
+# LICENSE
+# This program is free software; you can redistribute it and/or
+# modify it under the same terms as Perl 5 itself.

Modified: branches/upstream/liborlite-migrate-perl/current/t/01_compile.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-migrate-perl/current/t/01_compile.t?rev=50566&op=diff
==============================================================================
--- branches/upstream/liborlite-migrate-perl/current/t/01_compile.t (original)
+++ branches/upstream/liborlite-migrate-perl/current/t/01_compile.t Sat Jan  9 17:53:29 2010
@@ -6,6 +6,8 @@
 	$^W = 1;
 }
 
-use Test::More tests => 1;
+use Test::More tests => 3;
 
-require_ok( 'ORLite::Migrate' );
+require_ok( 'ORLite::Migrate'        );
+require_ok( 'ORLite::Migrate::Perl'  );
+require_ok( 'ORLite::Migrate::Patch' );

Modified: branches/upstream/liborlite-migrate-perl/current/t/lib/Test.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liborlite-migrate-perl/current/t/lib/Test.pm?rev=50566&op=diff
==============================================================================
--- branches/upstream/liborlite-migrate-perl/current/t/lib/Test.pm (original)
+++ branches/upstream/liborlite-migrate-perl/current/t/lib/Test.pm Sat Jan  9 17:53:29 2010
@@ -9,7 +9,7 @@
 
 use vars qw{$VERSION @ISA @EXPORT};
 BEGIN {
-        $VERSION = '1.05';
+        $VERSION = '1.06';
 	@ISA     = 'Exporter';
 	@EXPORT  = qw{ test_db connect_ok create_ok };
 }




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