Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Devel-CheckOS CPAN distribution.

Report information
The Basics
Id: 83918
Status: rejected
Priority: 0/
Queue: Devel-CheckOS

People
Owner: Nobody in particular
Requestors: arfreitas [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.71
Fixed in: (no value)



Subject: list of permited OS is not being check entirely
Greetings, Thank you for providing Devel::CheckOS. I use it a lot to avoid getting errors from unsupported OS's during automated tests in CPAN for the distributions that I made available. I just put a new distribution at CPAN (Siebel::AssertOS) but I getting a lot of NA reports even in OS that should be supported. A simple test here shows me that the eval is not trapping the exception when trying to use Devel::CheckOS::MSWin32 in a Linux box, the code is just dying there without trying the other items in the Linux (unfornately, "linux" is the last item from the list of supported OS of Siebel::AssertOS). I attached a debugging sessions, I hope it is sufficient to see the error. I double checked the distribution to see if I'm not doing something wrong, but I think I playing fair with the rules. Please let me know if you need more information or new tests. Thank you in advance, Alceu
Subject: debug_session.txt
jackal@yggdrasil:~/Siebel-AssertOS-0.01/t$ perl -d -I /home/jackal/Siebel-AssertOS-0.01/lib ../t/Siebel-AssertOS.t Loading DB routines from perl5db.pl version 1.33 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. 1..1 main::CODE(0x21323d8)(../t/Siebel-AssertOS.t:10): 10: use_ok('Siebel::AssertOS') }; DB<1> require Devel::CheckOS DB<2> b Devel::CheckOS::os_is DB<3> c Devel::CheckOS::os_is(/usr/local/share/perl/5.14.2/Devel/CheckOS.pm:79): 79: my @targets = @_; DB<3> n Devel::CheckOS::os_is(/usr/local/share/perl/5.14.2/Devel/CheckOS.pm:80): 80: my $rval = 0; DB<3> x @targets 0 'MSWin32' 1 'aix' 2 'solaris' 3 'hpux' 4 'linux' DB<4> n Devel::CheckOS::os_is(/usr/local/share/perl/5.14.2/Devel/CheckOS.pm:81): 81: foreach my $target (@targets) { DB<4> Devel::CheckOS::os_is(/usr/local/share/perl/5.14.2/Devel/CheckOS.pm:82): 82: die("Devel::CheckOS: $target isn't a legal OS name\n") 83: unless($target =~ /^\w+(::\w+)*$/); DB<4> x $target 0 'MSWin32' DB<5> print $^O linux DB<6> n Devel::CheckOS::os_is(/usr/local/share/perl/5.14.2/Devel/CheckOS.pm:84): 84: eval "use Devel::AssertOS::$target"; DB<6> not ok 1 - use Siebel::AssertOS; # Failed test 'use Siebel::AssertOS;' # at ../t/Siebel-AssertOS.t line 10. # Tried to use 'Siebel::AssertOS'. # Error: OS unsupported # BEGIN failed--compilation aborted at /home/jackal/Siebel-AssertOS-0.01/lib/Siebel/AssertOS.pm line 4. # Compilation failed in require at (eval 18)[/usr/share/perl/5.14/Test/More.pm:885] line 2. # BEGIN failed--compilation aborted at (eval 18)[/usr/share/perl/5.14/Test/More.pm:885] line 2. Test::Builder::CODE(0x23a2028)(/usr/share/perl/5.14/Test/Builder.pm:2502): 2502: $Test->_ending if defined $Test; DB<6> # Looks like you failed 1 test of 1. Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, h q, h R or h o to get additional info. DB<6> q jackal@yggdrasil:~/Siebel-AssertOS-0.01/t$
First let's make sure that Devel::CheckOS DTRT when asked to consider a single OS: $ perl -e 'use Devel::CheckOS qw(os_is);@oses = qw(Linux); print "OS is ".(os_is(@oses) ? "" : "not ")."[".join(", ", @oses)."]\n"' OS is [Linux] $ perl -e 'use Devel::CheckOS qw(os_is);@oses = qw(MSWin32); print "OS is ".(os_is(@oses) ? "" : "not ")."[".join(", ", @oses)."]\n"' OS is not [MSWin32] That looks good. Now let's ask it to consider two OSes, one that matches and one that doesn't, with the matching one either first or last in the list. $ perl -e 'use Devel::CheckOS qw(os_is);@oses = qw(Linux MSWin32); print "OS is ".(os_is(@oses) ? "" : "not ")."[".join(", ", @oses)."]\n"' OS is [Linux, MSWin32] $ perl -e 'use Devel::CheckOS qw(os_is);@oses = qw(MSWin32 Linux); print "OS is ".(os_is(@oses) ? "" : "not ")."[".join(", ", @oses)."]\n"' OS is [MSWin32, Linux] That looks good too. That's with version 1.71. Rejected. No bug found.