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

From: Date: Wed, 26 Oct 2005 19:33:09 +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-cvs+get-35881@lists.php.net to get a copy of this message
cellog Wed Oct 26 15:33:09 2005 EDT Modified files: /pear-core/OS Guess.php /pear-core package-PEAR.xml package2.xml Log: * implement Request #5527: alternative approach to determining glibc version http://cvs.php.net/diff.php/pear-core/OS/Guess.php?r1=1.19&r2=1.20&ty=u Index: pear-core/OS/Guess.php diff -u pear-core/OS/Guess.php:1.19 pear-core/OS/Guess.php:1.20 --- pear-core/OS/Guess.php:1.19 Mon Sep 26 22:55:26 2005 +++ pear-core/OS/Guess.php Wed Oct 26 15:33:03 2005 @@ -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.19 2005/09/27 02:55:26 cellog Exp $ + * @version CVS: $Id: Guess.php,v 1.20 2005/10/26 19:33:03 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since PEAR 0.1 */ @@ -201,10 +201,42 @@ if ($glibc !== false) { return $glibc; // no need to run this multiple times } - // Use glibc's <features.h> header file to - // get major and minor version number: 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 ($features_file = @fopen('/usr/include/features.h', 'rb') ) { + while (!feof($features_file)) { + $line = fgets($features_file, 8192); + if (!$line || (strpos($line, '#define') === false)) { + continue; + } + if (strpos($line, '__GLIBC__')) { + // major version number #define __GLIBC__ version + $line = preg_split('/\s+/', $line); + $glibc_major = trim($line[2]); + if (isset($glibc_minor)) { + break; + } + continue; + } + if (strpos($line, '__GLIBC_MINOR__')) { + // got the minor version number + // #define __GLIBC_MINOR__ version + $line = preg_split('/\s+/', $line); + $glibc_minor = trim($line[2]); + if (isset($glibc_major)) { + break; + } + continue; + } + } + fclose($features_file); + if (!isset($glibc_major) || !isset($glibc_minor)) { + return $glibc = ''; + } + return $glibc = 'glibc' . trim($glibc_major) . "." . trim($glibc_minor) ; + } return $glibc = ''; } $tmpfile = System::mktemp("glibctest"); http://cvs.php.net/diff.php/pear-core/package-PEAR.xml?r1=1.294&r2=1.295&ty=u Index: pear-core/package-PEAR.xml diff -u pear-core/package-PEAR.xml:1.294 pear-core/package-PEAR.xml:1.295 --- pear-core/package-PEAR.xml:1.294 Wed Oct 26 15:16:39 2005 +++ pear-core/package-PEAR.xml Wed Oct 26 15:33:08 2005 @@ -82,6 +82,7 @@ as well * implement SERIOUS improvement in list-all/remote-list speed. From 6 minutes down to about 16-30 seconds + * implement Request #5527: alternative approach to determining glibc version * fix Bug #5717: analyzeSourceCode() fails to process certain quote situations properly * fix Bug #5736: if registry can't lock registry or open filemap, http://cvs.php.net/diff.php/pear-core/package2.xml?r1=1.186&r2=1.187&ty=u Index: pear-core/package2.xml diff -u pear-core/package2.xml:1.186 pear-core/package2.xml:1.187 --- pear-core/package2.xml:1.186 Wed Oct 26 15:16:39 2005 +++ pear-core/package2.xml Wed Oct 26 15:33:09 2005 @@ -87,6 +87,7 @@ as well * implement SERIOUS improvement in list-all/remote-list speed. From 6 minutes down to about 16-30 seconds + * implement Request #5527: alternative approach to determining glibc version * fix Bug #5717: analyzeSourceCode() fails to process certain quote situations properly * fix Bug #5736: if registry can't lock registry or open filemap,

« previous php.pear.cvs (#35881) next »