aboutsummaryrefslogtreecommitdiff
path: root/lang/perl/patches/320-copy-pod-hack.patch
blob: efe8e0c2993f161c16538a6fbc26c205f0667544 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--- a/cpan/podlators/Makefile.PL
+++ b/cpan/podlators/Makefile.PL
@@ -39,6 +39,19 @@ sub dist_version {
     die "$0: cannot find version in lib/Pod/Man.pm\n";
 }
 
+foreach (glob('scripts/pod*.PL')) {
+    # The various pod*.PL extractors change directory. Doing that with relative
+    # paths in @INC breaks. It seems the lesser of two evils to copy (to avoid)
+    # the chdir doing anything, than to attempt to convert lib paths to
+    # absolute, and potentially run into problems with quoting special
+    # characters in the path to our build dir (such as spaces)
+    require File::Copy;
+
+    my $temp = $_;
+    $temp =~ s!scripts/!!;
+    File::Copy::copy($_, $temp) or die "Can't copy $temp to $_: $!";
+}
+
 # Generate full paths for scripts distributed in the bin directory.  Appends
 # the .com extension to scripts on VMS, unless they already have the .PL
 # extension.
@@ -49,7 +62,7 @@ sub dist_version {
 #          (Scalar) Space-separated relative paths from top of distribution
 sub scripts {
     my (@scripts) = @_;
-    my @paths = map { File::Spec->catfile('scripts', $_) } @scripts;
+    my @paths = @scripts;
     if ($^O eq 'VMS') {
         @paths = map { m{ [.] PL \z }xms ? $_ : $_ . '.com' } @paths;
     }
@@ -101,8 +114,8 @@ my %metadata = (
 
     # Override the files that generate section 1 man pages.
     MAN1PODS => {
-        man1pod('scripts', 'pod2man.PL'),
-        man1pod('scripts', 'pod2text.PL'),
+        man1pod('.', 'pod2man.PL'),
+        man1pod('.', 'pod2text.PL'),
 
         # Perl core uses a separate copy in the top-level pod directory.
         ($ENV{PERL_CORE} ? () : man1pod('pod', 'perlpodstyle.pod')),