Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add the auto-determination of perl version from the current working d…

…irectory
  • Loading branch information...
commit 0f7ede5cdc62fb751e77939aacf741823be9f1c5 1 parent 2e6b054
Chris Williams authored
2  dist.ini
... ...
@@ -1,5 +1,5 @@
1 1
 name = Devel-PatchPerl
2  
-version = 0.14
  2
+version = 0.16
3 3
 author = Chris Williams <chris@bingosnet.co.uk>
4 4
 license = Perl_5
5 5
 copyright_holder = Chris Williams and Marcus Holland-Moritz
12  lib/Devel/PatchPerl.pm
@@ -124,6 +124,15 @@ sub patch_source {
124 124
   my $vers = shift;
125 125
   $vers = shift if eval { $vers->isa(__PACKAGE__) };
126 126
   my $source = shift || '.';
  127
+  if ( !$vers and $source eq '.' ) {
  128
+    $vers = _determine();
  129
+    if ( $vers ) {
  130
+      warn "Auto-guessed '$vers'\n";
  131
+    }
  132
+    else {
  133
+      die "You didn't provide a perl version and I don't appear to be in a perl source tree\n";
  134
+    }
  135
+  }
127 136
   $source = File::Spec->rel2abs($source);
128 137
   warn "No patch utility found\n" unless $patch_exe;
129 138
   {
@@ -1836,6 +1845,9 @@ functionality.
1836 1845
 Takes two parameters, a C<perl> version and the path to unwrapped perl source for that version.
1837 1846
 It dies on any errors.
1838 1847
 
  1848
+If you don't supply either a C<perl> version and the path to unwrapped perl source, it will assume
  1849
+the current working directory and attempt to auto-determine the C<perl> version.
  1850
+
1839 1851
 =back
1840 1852
 
1841 1853
 =head1 SEE ALSO

0 notes on commit 0f7ede5

Please sign in to comment.
Something went wrong with that request. Please try again.