cvs: pear-core / package-PEAR.xml package2.xml /OS Guess.php

From: Date: Tue, 21 Nov 2006 03:32:50 +0000
Subject: cvs: pear-core / package-PEAR.xml package2.xml /OS Guess.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-5202@lists.php.net to get a copy of this message
cellog Tue Nov 21 03:32:50 2006 UTC Modified files: /pear-core/OS Guess.php /pear-core package-PEAR.xml package2.xml Log: * fix Bug #9355: Bug in GLIBC detection (OS/Guess.php), patch proposal http://cvs.php.net/viewvc.cgi/pear-core/OS/Guess.php?r1=1.23&r2=1.24&diff_format=u Index: pear-core/OS/Guess.php diff -u pear-core/OS/Guess.php:1.23 pear-core/OS/Guess.php:1.24 --- pear-core/OS/Guess.php:1.23 Fri Jun 16 11:42:16 2006 +++ pear-core/OS/Guess.php Tue Nov 21 03:32:50 2006 @@ -16,7 +16,7 @@ * @author Gregory Beaver <cellog@php.net> * @copyright 1997-2005 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Guess.php,v 1.23 2006/06/16 11:42:16 pajoye Exp $ + * @version CVS: $Id: Guess.php,v 1.24 2006/11/21 03:32:50 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since PEAR 0.1 */ @@ -201,12 +201,13 @@ if ($glibc !== false) { return $glibc; // no need to run this multiple times } + $major = $minor = 0; include_once "System.php"; - if (!@file_exists('/usr/bin/cpp') || !@is_executable('/usr/bin/cpp')) { - // Use glibc's <features.h> header file to - // get major and minor version number: - if (@file_exists('/usr/include/features.h') && - @is_readable('/usr/include/features.h')) { + // Use glibc's <features.h> header file to + // get major and minor version number: + if (@file_exists('/usr/include/features.h') && + @is_readable('/usr/include/features.h')) { + if (!@file_exists('/usr/bin/cpp') || !@is_executable('/usr/bin/cpp')) { $features_file = fopen('/usr/include/features.h', 'rb'); while (!feof($features_file)) { $line = fgets($features_file, 8192); @@ -238,28 +239,26 @@ return $glibc = ''; } return $glibc = 'glibc' . trim($glibc_major) . "." . trim($glibc_minor) ; + } // no cpp + $tmpfile = System::mktemp("glibctest"); + $fp = fopen($tmpfile, "w"); + fwrite($fp, "#include <features.h>\n__GLIBC__ __GLIBC_MINOR__\n"); + fclose($fp); + $cpp = popen("/usr/bin/cpp $tmpfile", "r"); + while ($line = fgets($cpp, 1024)) { + if ($line{0} == '#' || trim($line) == '') { + continue; + } + if (list($major, $minor) = explode(' ', trim($line))) { + break; + } } - return $glibc = ''; - } - $tmpfile = System::mktemp("glibctest"); - $fp = fopen($tmpfile, "w"); - fwrite($fp, "#include <features.h>\n__GLIBC__ __GLIBC_MINOR__\n"); - fclose($fp); - $cpp = popen("/usr/bin/cpp $tmpfile", "r"); - $major = $minor = 0; - while ($line = fgets($cpp, 1024)) { - if ($line{0} == '#' || trim($line) == '') { - continue; - } - if (list($major, $minor) = explode(' ', trim($line))) { - break; - } - } - pclose($cpp); - unlink($tmpfile); - if (!($major && $minor) && is_link('/lib/libc.so.6')) { + pclose($cpp); + unlink($tmpfile); + } // features.h + if (!($major && $minor) && @is_link('/lib/libc.so.6')) { // Let's try reading the libc.so.6 symlink - if (ereg('^libc-([.*])\.so$', basename(readlink('/lib/libc.so.6')), $matches)) { + if (ereg('^libc-(.*)\.so$', basename(readlink('/lib/libc.so.6')), $matches)) { list($major, $minor) = explode('.', $matches); } } http://cvs.php.net/viewvc.cgi/pear-core/package-PEAR.xml?r1=1.407&r2=1.408&diff_format=u Index: pear-core/package-PEAR.xml diff -u pear-core/package-PEAR.xml:1.407 pear-core/package-PEAR.xml:1.408 --- pear-core/package-PEAR.xml:1.407 Sun Nov 19 23:56:32 2006 +++ pear-core/package-PEAR.xml Tue Nov 21 03:32:50 2006 @@ -95,6 +95,7 @@ * fix Bug #9208: Typo error on abstract PEAR_Task_Common::validXml() method * fix Bug #9280: cannot install with --packagingroot package from non-php.net channel * fix Bug #9307: Validator generates warning on empty &lt;contents&gt; tag + * fix Bug #9355: Bug in GLIBC detection (OS/Guess.php), patch proposal * fix shell-test command with invalid usage (noticed by Christian Weiske) * fix notice when running &quot;pear sign&quot; (noticed by Christian Weiske) * implement Request #8827: add a yesno type handling for post-install scripts http://cvs.php.net/viewvc.cgi/pear-core/package2.xml?r1=1.302&r2=1.303&diff_format=u Index: pear-core/package2.xml diff -u pear-core/package2.xml:1.302 pear-core/package2.xml:1.303 --- pear-core/package2.xml:1.302 Sun Nov 19 23:56:32 2006 +++ pear-core/package2.xml Tue Nov 21 03:32:50 2006 @@ -100,6 +100,7 @@ * fix Bug #9208: Typo error on abstract PEAR_Task_Common::validXml() method * fix Bug #9280: cannot install with --packagingroot package from non-php.net channel * fix Bug #9307: Validator generates warning on empty &lt;contents&gt; tag + * fix Bug #9355: Bug in GLIBC detection (OS/Guess.php), patch proposal * fix shell-test command with invalid usage (noticed by Christian Weiske) * fix notice when running &quot;pear sign&quot; (noticed by Christian Weiske) * implement Request #8827: add a yesno type handling for post-install scripts

« previous php.pear.core (#5202) next »