Date: Mon, 4 Mar 2002 18:50:02 -0800 (PST) From: Alan Eldridge <alane@geeksrus.net> To: freebsd-ports@FreeBSD.org Subject: Re: ports/35548: New Port Message-ID: <200203050250.g252o2Q72745@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/35548; it has been noted by GNATS. From: Alan Eldridge <alane@geeksrus.net> To: Bob Bomar <bob@fly.homeunix.org> Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: ports/35548: New Port Date: Mon, 4 Mar 2002 21:36:28 -0500 On Mon, Mar 04, 2002 at 08:05:40PM -0600, Bob Bomar wrote: > > phpSysInfo is a PHP script that diplays infromation about the host being Bob, There are a couple of severe BSD releated bugs in the current version. I have sent patches to the author (you'll find me mentioned in the credits for the BSD related code now), but he decided to leave the bugs in (possibly because it was about a day before he did a release). There are two problems. One is the application of the array_values() function on the returned array from BSD::ide(). This caused the BSD device names to be lost, and the devices referred to as 0,1,2, etc. The second is the use of the array_unique() function (in the same line of code). This function has a bug, and it removes array items that are not duplicates. I have sent the author an email inquiring about applying the patches to his CVS tree. In the meantime, I'm sending them to you so you can issue a maintainer update (just dropping the patch in the files dir should do it). Let me know if you would rather that I submit a PR as soon as the new port is committed. The patch also inserts an else in between two "if" statements that are mutually exclusive. This can be omitted without harm. It's the other part of the patch that is essential to having the software work correctly. --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<-- Index: includes/os/class.BSD.common.inc.php =================================================================== RCS file: /cvsroot/phpsysinfo/phpsysinfo-dev/includes/os/class.BSD.common.inc.p\hp,v retrieving revision 1.4 diff -u -3 -r1.4 class.BSD.common.inc.php --- includes/os/class.BSD.common.inc.php 4 Feb 2002 01:27:30 -0000 \ 1.4 +++ includes/os/class.BSD.common.inc.php 17 Feb 2002 06:50:27 -0000 @@ -179,14 +179,17 @@ $results[$s]['model'] = $ar_buf[3]; $results[$s]['media'] = 'Hard Disk'; $results[$s]['capacity'] = $ar_buf[2] * 2048 * 1.049; - } - if (preg_match('/^(acd[0-9]): (.*) <(.*)> (.*)/', $buf, $ar_buf)) \{ + } else + if (preg_match('/^(acd[0-9]): (.*) <(.*)> (.*)/', $buf, $ar_buf)) { $s = $ar_buf[1]; $results[$s]['model'] = $ar_buf[3]; $results[$s]['media'] = 'CD-ROM'; } } - return array_values(array_unique($results)); + //return array_values(array_unique($results)); + //1. more useful to have device names + //2. php 4.1.1 array_unique() deletes non-unique values. + return $results; } function memory () --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<-- -- Alan Eldridge "Dave's not here, man." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203050250.g252o2Q72745>