From 7ec2cea42ff48a380e66445f3c1f56b9ff25c203 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Sun, 10 Oct 1999 06:33:15 +0000 Subject: [PATCH] install pods to 'pods' rather than 'pod' on cygwin (modified a patch suggested by cwilson@cc865179-c.chmbl1.ga.home.com) p4raw-id: //depot/perl@4333 --- installperl | 32 +++++++++++++++++++------------- lib/diagnostics.pm | 9 +++++++-- utils/perldoc.PL | 7 +++++++ 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/installperl b/installperl index faf1c70..d0d5eeb 100755 --- a/installperl +++ b/installperl @@ -113,6 +113,7 @@ my $libperl = $Config{libperl}; # Shared library and dynamic loading suffixes. my $so = $Config{so}; my $dlext = $Config{dlext}; +my $dlsrc = $Config{dlsrc}; my $d_dosuid = $Config{d_dosuid}; my $binexp = $Config{binexp}; @@ -161,14 +162,16 @@ if ($Is_Cygwin) { $perldll = 'perl56.' . $dlext if $Config{'ccflags'} =~ /PERL_OBJECT/i; } --f $perldll || die "No perl DLL built\n"; + if ($dlsrc != "dl_none.xs") { + -f $perldll || die "No perl DLL built\n"; # Install the DLL -safe_unlink("$installbin/$perldll"); -copy("$perldll", "$installbin/$perldll"); -chmod(0755, "$installbin/$perldll"); -} + safe_unlink("$installbin/$perldll"); + copy("$perldll", "$installbin/$perldll"); + chmod(0755, "$installbin/$perldll"); + } +} # if ($Is_W32 or $Is_Cygwin) # This will be used to store the packlist my $packlist = ExtUtils::Packlist->new("$installarchlib/.packlist"); @@ -365,19 +368,21 @@ if (! $versiononly) { } } -# Install pod pages. Where? I guess in $installprivlib/pod. +# Install pod pages. Where? I guess in $installprivlib/pod +# ($installprivlib/pods for cygwin). +my $pod = $Is_Cygwin ? 'pods' : 'pod'; unless ( $versiononly && !($installprivlib =~ m/\Q$]/)) { - mkpath("${installprivlib}/pod", 1, 0777); + mkpath("${installprivlib}/$pod", 1, 0777); # If Perl 5.003's perldiag.pod is there, rename it. - if (open POD, "${installprivlib}/pod/perldiag.pod") { + if (open POD, "${installprivlib}/$pod/perldiag.pod") { read POD, $_, 4000; close POD; # Some of Perl 5.003's diagnostic messages ended with periods. if (/^=.*\.$/m) { - my ($from, $to) = ("${installprivlib}/pod/perldiag.pod", - "${installprivlib}/pod/perldiag-5.003.pod"); + my ($from, $to) = ("${installprivlib}/$pod/perldiag.pod", + "${installprivlib}/$pod/perldiag-5.003.pod"); print " rename $from $to"; rename($from, $to) or warn "Couldn't rename $from to $to: $!\n" @@ -385,9 +390,10 @@ unless ( $versiononly && !($installprivlib =~ m/\Q$]/)) { } } - foreach my $file (@pods) { - # $file is a name like pod/perl.pod - copy_if_diff($file, "${installprivlib}/${file}"); + for (@pods) { + # $_ is a name like pod/perl.pod + (my $base = $_) =~ s#.*/##; + copy_if_diff($_, "${installprivlib}/$pod/${base}"); } } diff --git a/lib/diagnostics.pm b/lib/diagnostics.pm index f174ee5..05af621 100755 --- a/lib/diagnostics.pm +++ b/lib/diagnostics.pm @@ -177,9 +177,14 @@ if ($^O eq 'VMS') { $privlib = VMS::Filespec::unixify($privlib); $archlib = VMS::Filespec::unixify($archlib); } -@trypod = ("$archlib/pod/perldiag.pod", +@trypod = ( + "$archlib/pod/perldiag.pod", "$privlib/pod/perldiag-$].pod", - "$privlib/pod/perldiag.pod"); + "$privlib/pod/perldiag.pod" + "$archlib/pods/perldiag.pod", + "$privlib/pods/perldiag-$].pod", + "$privlib/pods/perldiag.pod" + ); # handy for development testing of new warnings etc unshift @trypod, "./pod/perldiag.pod" if -e "pod/perldiag.pod"; ($PODFILE) = ((grep { -e } @trypod), $trypod[$#trypod])[0]; diff --git a/utils/perldoc.PL b/utils/perldoc.PL index 7dc478b..e0f276a 100644 --- a/utils/perldoc.PL +++ b/utils/perldoc.PL @@ -243,6 +243,7 @@ sub minus_f_nocase { sub check_file { my($dir,$file) = @_; + return "" if length $dir and not -d $dir; if ($opt_m) { return minus_f_nocase($dir,$file); } @@ -278,6 +279,8 @@ sub searchfor { $ret = check_file $dir,"$s.bat") or ( $ret = check_file "$dir/pod","$s.pod") or ( $ret = check_file "$dir/pod",$s) + or ( $ret = check_file "$dir/pods","$s.pod") + or ( $ret = check_file "$dir/pods",$s) ) { return $ret; } @@ -708,6 +711,10 @@ and others. =cut # +# Version 1.15: Tue Aug 24 01:50:20 EST 1999 +# Charles Wilson +# changed /pod/ directory to /pods/ for cygwin +# to support cygwin/win32 # Version 1.14: Wed Jul 15 01:50:20 EST 1998 # Robin Barker # -strict, -w cleanups -- 2.7.4