On Tue, May 14, 2002 at 05:41:54PM -0500, Randy Kobes wrote:
> Perhaps one place to start is
> http://www.cpan.org/modules/by-category/04_Operating_System_Interfaces/
> where there's, for example, Unix, VMS, BSD, MSDOS, Mac, Solaris,
> and so on. Win32 has a special category:
> http://www.cpan.org/modules/by-category/22_Microsoft_Windows_Modules.

Okay. Incremental patch follows; Report.pm as attached.

/Autrijus/

==== //depot/devel/lib/CPANPLUS/Internals/Report.pm#4 - 
/tmp/cpanplus/devel/lib/CPANPLUS/Internals/Report.pm ====
@@ -25,6 +25,35 @@
     $VERSION    =   $CPANPLUS::Internals::VERSION;
 }
 
+my %OS = (
+    Amiga       => 'amigaos',
+    Atari       => 'mint',
+    BSD         => 'bsdos|darwin|freebsd|openbsd|netbsd',
+    Be          => 'beos',
+    BeOS        => 'beos',
+    Darwin      => 'darwin',
+    EBCDIC      => 'os390|os400|posix-bc|vmesa',
+    HPUX        => 'hpux',
+    Linux       => 'linux',
+    MSDOS       => 'dos',
+    Mac         => 'MacOS',
+    MacPerl     => 'MacOS',
+    MacOSX      => 'darwin',
+    MPEiX       => 'mpeix',
+    OS2         => 'os2',
+    Plan9       => 'plan9',
+    RISCOS      => 'riscos',
+    SGI         => 'irix',
+    Solaris     => 'solaris',
+    Unix        => 'aix|bsdos|darwin|dgux|dynixptx|freebsd|'.
+                   'linux|hpux|machten|netbsd|next|openbsd|dec_osf|'.
+                   'svr4|sco_sv|unicos|unicosmk|solaris|sunos',
+    VMS         => 'VMS',
+    VOS         => 'VOS',
+    Win32       => 'MSWin32',
+    Win32API    => 'MSWin32',
+);
+
 ### Send out testing reports
 sub _send_report {
     my ($self, %args) = @_;
@@ -35,14 +64,24 @@
                  || $module->{author};
     my $email  = $self->_author_tree->{$module->{author}}{email}
                  || "$module->{author}\@cpan.org";
-    my $grade  = 'pass';
+    my $grade;
 
     if ($self->{_todo}{failed}{$name} or $failed) {
-        $grade = 'fail';
+        foreach my $platform (keys %OS) {
+            if ($name =~ /^$platform\b/i) {
+                # a platform-specific module
+                $grade = 'na' unless ($^O =~ /^(?:$OS{$platform})$/);
+                last;
+            }
+        }
+        $grade ||= 'fail';
     }
     elsif ($buffer =~ /^No tests defined for .* extension.\s*$/m) {
         $grade = 'unknown';
     }
+    else {
+        $grade = 'pass';
+    }
 
     $dist =~ s/(?:\.tar\.(?:gz|Z|bz2)|\.t[gb]z|\.zip)$//i;
 

Attachment: Report.pm
Description: Perl program

Attachment: msg33927/pgp00000.pgp
Description: PGP signature

Reply via email to