This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
amigaos4: cpan/Pod-Perldoc: different paging
authorAndy Broad <andy@broad.ology.org.uk>
Fri, 14 Aug 2015 01:12:16 +0000 (21:12 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 5 Sep 2015 15:12:47 +0000 (11:12 -0400)
Upstreamed: https://rt.cpan.org/Ticket/Display.html?id=106798

cpan/Pod-Perldoc/lib/Pod/Perldoc.pm

index 969019d..a952466 100644 (file)
@@ -69,6 +69,7 @@ BEGIN {
  *is_cygwin  = $^O eq 'cygwin'  ? \&TRUE : \&FALSE unless defined &is_cygwin;
  *is_linux   = $^O eq 'linux'   ? \&TRUE : \&FALSE unless defined &is_linux;
  *is_hpux    = $^O =~ m/hpux/   ? \&TRUE : \&FALSE unless defined &is_hpux;
+ *is_amigaos = $^O eq 'amigaos' ? \&TRUE : \&FALSE unless defined &is_amigaos;
 }
 
 $Temp_File_Lifetime ||= 60 * 60 * 24 * 5;
@@ -484,7 +485,7 @@ sub init_formatter_class_list {
 
   $self->opt_M_with('Pod::Perldoc::ToPod');   # the always-there fallthru
   $self->opt_o_with('text');
-  $self->opt_o_with('term') unless $self->is_mswin32 || $self->is_dos
+  $self->opt_o_with('term') unless $self->is_mswin32 || $self->is_dos || $self->is_amigaos
        || !($ENV{TERM} && (
               ($ENV{TERM} || '') !~ /dumb|emacs|none|unknown/i
            ));
@@ -1912,10 +1913,15 @@ sub page {  # apply a pager to the output file
         #  many many corners of the OS don't like it.  So we
         #  have to force it to be "\" to make everyone happy.
 
+        # if we are on an amiga convert unix path to an amiga one
+        $output =~ s/^\/(.*)\/(.*)/$1:$2/ if $self->is_amigaos;
+
         foreach my $pager (@pagers) {
             $self->aside("About to try calling $pager $output\n");
             if ($self->is_vms) {
                 last if system("$pager $output") == 0;
+              } elsif($self->is_amigaos) {
+                last if system($pager, $output) == 0;
             } else {
                 # fix visible escape codes in ToTerm output
                 # https://bugs.debian.org/758689