Skip Menu |

This queue is for tickets about the Unix-Uptime CPAN distribution.

Report information
The Basics
Id: 42527
Status: resolved
Priority: 0/
Queue: Unix-Uptime

People
Owner: PIOTO [...] cpan.org
Requestors: mopsfelder [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.1
Fixed in: 0.2



Subject: Patch for a successfully string matching and value assignment
Date: Mon, 19 Jan 2009 12:57:34 -0200
To: bug-Unix-Uptime [...] rt.cpan.org
From: "Murilo Opsfelder Araújo" <mopsfelder [...] gmail.com>
Hello Mike Kelly, I was facing problems with Unix::Uptime on my FreeBSD box [1]. So, I tried this patch [2] against Uptime.pm and now it seems to be ok. The comparison was not returning the correct boot seconds, but 1 for a successfully string match and 0 for a failed string match. I hope you enjoy the patch [2] and, please, let me know about any suggestions. [1] FreeBSD opsfelderm.bplab.local 8.0-CURRENT FreeBSD 8.0-CURRENT #37 r187296: Thu Jan 15 10:08:42 BRST 2009 root@opsfelderm.bplab.local:/usr/obj/usr/src/sys/PANDA i386 [2] diff -ruN Unix-Uptime-0.1.orig/lib/Unix/Uptime.pm Unix-Uptime-0.1/lib/Unix/Uptime.pm --- Unix-Uptime-0.1.orig/lib/Unix/Uptime.pm 2008-12-08 19:09:32.000000000 -0200 +++ Unix-Uptime-0.1/lib/Unix/Uptime.pm 2009-01-19 12:41:15.000000000 -0200 @@ -62,7 +62,8 @@ my $class = shift; my $boottime = `sysctl kern.boottime`; - my $boot_seconds = $boottime =~ /\s+sec\s+=\s+(\d+),/; + $boottime =~ /\s+sec\s+=\s+(\d+),/; + my $boot_seconds = $1; my $time = time(); my $uptime = $time - $boot_seconds; return $uptime; [3] $ perl -v This is perl, v5.8.8 built for i386-freebsd (with 1 registered patch, see perl -V for more detail) Best regards. -- Murilo Opsfelder Araujo mopsfelder@gmail.com {murilo,panda}@bsd.com.br BSD will never die.
I've fixed this with the patch at: http://git.pioto.org/gitweb/Unix-Uptime.git?a=commit;h=c6d8bf96edd88ebee8276e80b24a22c77dce0c2c I'll be pushing out a new version "soon". I'm looking into merging things with Sys::Uptime, but I'm still waiting on a reply from its maintainer.
Subject: Re: [rt.cpan.org #42527] Patch for a successfully string matching and value assignment
Date: Mon, 19 Jan 2009 19:16:40 -0200
To: bug-Unix-Uptime [...] rt.cpan.org
From: "Murilo Opsfelder Araújo" <mopsfelder [...] gmail.com>
On Mon, Jan 19, 2009 at 6:32 PM, Mike Kelly via RT <bug-Unix-Uptime@rt.cpan.org> wrote: Show quoted text
Hmm. I'm gonna try your patch and report you (un)success. Show quoted text
> I'll be pushing out a new version "soon". I'm looking into merging > things with Sys::Uptime, but I'm still waiting on a reply from its > maintainer.
I just sent you this email 'cause I didn't see any bugs opened at cpan rt. Let me know if you merge with Sys::Uptime to remove this perl module from FreeBSD ports. Thanks again. -- Murilo Opsfelder Araujo mopsfelder@gmail.com {murilo,panda}@bsd.com.br BSD will never die.
This should be fixed in version 0.2. Thanks for the report.