Fix Pod - RT#68563
[catagits/Catalyst-Devel.git] / lib / Module / Install / Catalyst.pm
index 7063dba..4c47bff 100644 (file)
@@ -8,9 +8,9 @@ require Module::Install::Base;
 
 use File::Find;
 use FindBin;
-use File::Copy::Recursive 'rcopy';
+use File::Copy::Recursive;
 use File::Spec ();
-use Getopt::Long qw(GetOptionsFromString :config no_ignore_case);
+use Getopt::Long ();
 use Data::Dumper;
 
 my $SAFETY = 0;
@@ -58,6 +58,11 @@ command called in C<Makefile.PL>.
 
 sub catalyst {
     my $self = shift;
+
+    if($Module::Install::AUTHOR) {
+        $self->include("File::Copy::Recursive");
+    }
+
     print <<EOF;
 *** Module::Install::Catalyst
 EOF
@@ -94,7 +99,7 @@ sub catalyst_files {
     my @path = split '-', $self->name;
     for my $orig (@files) {
         my $path = File::Spec->catdir( 'blib', 'lib', @path, $orig );
-        rcopy( $orig, $path );
+        File::Copy::Recursive::rcopy( $orig, $path );
     }
 }
 
@@ -109,7 +114,7 @@ sub catalyst_ignore_all {
     @IGNORE = @$ignore;
 }
 
-=head2 catalyst_ignore(\@ignore)
+=head2 catalyst_ignore(@ignore)
 
 Add a regexp to the list of ignored patterns. Can be called multiple times.
 
@@ -214,15 +219,20 @@ catalyst_par_options().
 
 sub catalyst_par_options {
     my ( $self, $optstring ) = @_;
-    my %o = ();
     eval "use PAR::Packer ()";
     if ($@) {
         warn "WARNING: catalyst_par_options ignored - you need PAR::Packer\n"
     }
     else {
-        GetOptionsFromString($optstring, \%o, PAR::Packer->options);
+        my $p = Getopt::Long::Parser->new(config => ['no_ignore_case']);
+        my %o;
+        require Text::ParseWords;
+        {
+            local @ARGV = Text::ParseWords::shellwords($optstring);
+            $p->getoptions(\%o, PAR::Packer->options);
+        }
         %PAROPTS = ( %PAROPTS, %o);
-    }  
+    }
 }
 
 =head2 catalyst_par_script($script)