Permalink
Browse files

Fixed a bug calling patch_source as a exported function

  • Loading branch information...
1 parent 2fafa11 commit 09dfd7daa6a1fe5bc172aad1ad1d57eb0af86227 @bingos committed May 17, 2010
Showing with 7 additions and 3 deletions.
  1. +3 −0 Changes
  2. +4 −3 lib/Devel/PatchPerl.pm
View
@@ -0,0 +1,3 @@
+==============
+End of Excerpt
+==============
@@ -8,7 +8,7 @@ use IO::File;
use IPC::Cmd qw[can_run run];
use vars qw[$VERSION @ISA @EXPORT_OK];
-$VERSION = '0.02';
+$VERSION = '0.04';
@ISA = qw(Exporter);
@EXPORT_OK = qw(patch_source);
@@ -104,10 +104,11 @@ my @patch = (
sub patch_source {
my $vers = shift;
- $vers = shift if $vers->isa(__PACKAGE__);
+ $vers = shift if $vers !~ /^[\d.]+$/ and $vers->isa(__PACKAGE__);
my $source = shift || '.';
$source = File::Spec->rel2abs($source);
warn "No patch utility found\n" unless $patch_exe;
+ return;
{
local $CWD = $source;
for my $p ( grep { _is( $_->{perl}, $vers ) } @patch ) {
@@ -129,7 +130,7 @@ sub _is
if (ref $s1) {
if (ref $s1 eq 'ARRAY') {
- is($_, $s2) and return 1 for @$s1;
+ _is($_, $s2) and return 1 for @$s1;
return 0;
}
return $s2 =~ $s1;

0 comments on commit 09dfd7d

Please sign in to comment.