PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » PEAR » PEAR » Bug #5527

alternative approach to determining glibc version

Details

Request #5527alternative approach to determining glibc version
Submitted2005-09-26 21:04 UTC
Frombertrand at togg dot com
Assignedcellog
StatusClosed
PackagePEAR
PHP Version4.3.11
OSFC3
Roadmaps(Not assigned)

Comments

[2005-09-26 21:04 UTC] bertrand at togg dot com

Description:
------------
I loosed cpp:
# mv /usr/bin/cpp /usr/bin/cpp.sav
# hash -d cpp

# pear uninstall HTML_Template_Sigma
sh: /usr/bin/cpp: No such file or directory
pear/html_menu can be optionally used by installed package "pear/HTML_Template_Sigma"
pear/HTML_Template_Sigma (version >= 1.1.2) can be optionally used by installed package "pear/html_progress"
uninstall ok: channel://pear.php.net/HTML_Template_Sigma-1.1.3

[root@ancilla tw19]# pear install HTML_Template_Sigma
sh: /usr/bin/cpp: No such file or directory
downloading HTML_Template_Sigma-1.1.3.tgz ...
Starting to download HTML_Template_Sigma-1.1.3.tgz (27,068 bytes)
.........done: 27,068 bytes
install ok: channel://pear.php.net/HTML_Template_Sigma-1.1.3

What is this cpp complain ?
Where is pear needing that ?

Should I try to install raw pear in this state ?

(HTML_Template_Sigma is just an example here)
(reported on irc #pear , forward to the person possible)

[2005-10-09 01:24 UTC] soporte at onfocus dot cl

I have yet another aproach for the popen() and cpp stuff:

Index: Guess.php
===================================================================
RCS file: /repository/pear-core/OS/Guess.php,v
retrieving revision 1.19
diff -u -a -r1.19 Guess.php
--- Guess.php 27 Sep 2005 02:55:26 -0000 1.19
+++ Guess.php 9 Oct 2005 01:17:14 -0000
@@ -74,7 +74,7 @@
// Darwin home-eden.local 7.5.0 Darwin Kernel Version 7.5.0: Thu Aug 5 19:26:16 PDT 2004; root:xnu/xnu-517.7.21.obj~3/RELEASE_PPC Power Macintosh
//
// Mac OS X early versions
-//
+//

// }}}

@@ -207,6 +207,27 @@
if (!file_exists('/usr/bin/cpp') || !is_executable('/usr/bin/cpp')) {
return $glibc = '';
}
+ if ($features_file = @fopen('/usr/include/features.h','rb') ) {
+
+ while (!feof($features_file)) {
+
+ $line = fgets($features_file, 4096);
+
+ if ( strpos($line,'define') && strpos ($line,'__GLIBC__') ) {
+ //major version number
+ $glibc_major = substr($line ,17);
+
+ } elseif ( strpos($line,'define') && strpos ($line,'__GLIBC_MINOR__') ) {
+ // got the minor version number
+ $glibc_minor = substr($line ,23);
+
+ }
+ }
+ fclose($features_file);
+
+ return 'glibc' . trim($glibc_major) . "." . trim($glibc_minor) ;
+
+ }
$tmpfile = System::mktemp("glibctest");
$fp = fopen($tmpfile, "w");
fwrite($fp, "#include <features.h>\n__GLIBC__ __GLIBC_MINOR__\n");

of course your folks can to this better, you can think adding that patch as an alternative, or simple remove that "tricky" popen() call (BTW.. a warning is issued when popen() is forbidden ( listed on disable_functions) )

[2005-10-09 06:45 UTC] soporte at onfocus dot cl

_detectGlibcVersion() is affected by open_basedir (AFAIK)

cellog: Why the glibc _version_ is specifically needed (???)

what's done with that information ?

probably I'm missing something...